frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•1y ago
I'd like to do some statistics over the machine code gcc generates, such as a histogram of used instructions, average volatile/preserved registers usage of functions etc. For now just x86_64 SysV-ABI would be enough.

However I'm not aware of any pre-existing tool that lets me easily do this. The options I currently see are either make gcc output assembly and write a parser for the GNU Assembler format (possibly by reusing the asm-parser of the compiler-explorer project), or write a tool that reads (disassembles) object files directly using elfutils.

Any hints, prior work, further ideas, links to useful resources, or any other kind of help would be much appreciated.

Comments

baobun•1y ago
"Static analysis" should be a relevant search term. Assuming you don't need to tie the instructions back to C code then the "gcc" part seems circumstancial for implementation? I guess you might want to parse the ASM into an Abstract Syntax Tree (AST) represenation and work on that?

If you do want to tie it back to the source, this looks relevant: http://icps.u-strasbg.fr/~pop/gcc-ast.html

phafu•1y ago
For my purpose I don't need to get back to the original source, no.

The gcc part is only relevant with regards to what dialect of assembler I need to parse. If I go that route, I'd write a parser for the GNU assembler, and that would of course work with any code in that dialect, regardless from which compiler it came from (I haven't checked whether other compilers can produce GNU assembler though).

Commentary on N Guilty Men

https://medium.com/luminasticity/commentary-on-n-guilty-men-fc47d9dd0674
1•bryanrasmussen•1m ago•0 comments

The Cost of China's Free A.I

https://www.nytimes.com/2026/07/29/opinion/ai-china-us-free-models.html
1•kuboble•2m ago•0 comments

Spacesphere Live

https://spacesphere.sygnito.com/en
1•SYGNITO•3m ago•0 comments

Ran Moonshot's 2.8T-parameter Kimi K3 on a GPU-less mini-PC

https://github.com/ferrumox/rabbit
1•manuelslemos•6m ago•0 comments

AIs Don't Take Showers

https://chipx86.blog/2026/07/26/ais-dont-take-showers/
2•bw86•7m ago•0 comments

Proofchain – verify any database's history without trusting the operator

https://github.com/cipherxsniper/proofchain
2•cipherxsniper•8m ago•0 comments

Mapping CVEs to Mitre ATT&CK Techniques

https://arxiv.org/abs/2607.25572
2•adulau•18m ago•1 comments

Folding Paper Globes

https://foldingglobes.com/globes
2•dango2506•19m ago•0 comments

U of T mathematician Jacob Tsimerman awarded prestigious Fields Medal

https://www.utoronto.ca/news/nobel-prize-mathematics-u-t-mathematician-jacob-tsimerman-awarded-pr...
1•gregsadetsky•20m ago•0 comments

Chemical recycling plants closing in EU and US

https://www.chemistryworld.com/news/chemical-recycling-plants-closing-in-eu-and-us/4023904.article
2•latexr•25m ago•0 comments

Preempting the Prefill

https://inmyhead.is/blog/preempting-the-prefill-part-1/
3•adityau19•25m ago•0 comments

Claude Chat Container

https://claude.ai/share/24074801-092c-4a9c-970f-e533f58e88cd
3•_continuation•29m ago•1 comments

Security Determination on the Threat Posed by Foreign-Produced Power Inverters [pdf]

https://www.fcc.gov/sites/default/files/power-inverter-fcc-determination.pdf
1•Stevvo•36m ago•0 comments

Google rivals line up seeking damages after record $1B EU fine

https://www.reuters.com/legal/litigation/google-rivals-line-up-seeking-damages-after-record-1-bil...
3•1vuio0pswjnm7•38m ago•0 comments

Why Christopher Nolan shot "The Odyssey" on IMAX film [video]

https://www.youtube.com/watch?v=1GEqDZ3hQSo
1•handfuloflight•39m ago•0 comments

eBay pays $46M to journalists it targeted in harassment campaign

https://arstechnica.com/tech-policy/2026/07/ebay-former-execs-pay-56m-to-settle-bloody-pig-mask-h...
4•robin_reala•40m ago•1 comments

Dreams Drain Energy: The REM Sleep Paradox

https://www.tohoku.ac.jp/en/press/dreams_drain_energy_the_rem_sleep_paradox.html
2•giuliomagnifico•40m ago•0 comments

Raw Data, Wrong Answers

https://www.theclimatebrink.com/p/raw-data-wrong-answers
1•adrianN•40m ago•0 comments

Web Rendering in Iced: What Works

https://gofranz.com/blog/web-rendering-in-iced-what-actually-works/
1•chironjit•42m ago•0 comments

Kids who own phones have poorer reading comprehension scores than those who dont

https://newsroom.ucla.edu/releases/owning-a-cell-phone-associated-with-poorer-reading-comprehensi...
2•JeanKage•43m ago•0 comments

Paseo: Open-source desktop and mobile app for TUI coding agents (Codex, CC)

https://paseo.sh/
1•maxloh•43m ago•0 comments

Towards Automating Eval Engineering

https://twitter.com/Vtrivedy10/status/2079976006644072796
1•gmays•43m ago•0 comments

Show HN: FOSS sandbox platform for zero trust remote access without secrets

https://github.com/octelium/cordium
1•geoctl•44m ago•0 comments

Google reported its first negative quarter since going public

https://finance.yahoo.com/technology/ai/articles/google-spent-490-million-day-163000234.html
4•mgh2•50m ago•2 comments

Grammar.lol: open-source Grammarly using existing ChatGPT or Grok Subscription

https://grammar.lol
2•KitN•51m ago•1 comments

WhatsApp Opening:Threema Rejects Integration Not Just Because of Data Protection

https://www.heise.de/en/news/WhatsApp-Opening-Threema-Rejects-Integration-Not-Just-Because-of-Dat...
1•Markoff•52m ago•1 comments

New airliner sets record flying 24 hrs nonstop from Australia to France

https://arstechnica.com/gadgets/2026/07/new-airliner-sets-record-flying-24-hrs-nonstop-from-austr...
8•divbzero•1h ago•2 comments

Show HN: PR review time decreased by N3MO:impact analyzer (15 days free trial)

https://n3mo.vercel.app
2•RajX_dev•1h ago•1 comments

PJM board proposes backstop capacity auction, data center curtailment plans

https://finance.yahoo.com/energy/articles/pjm-board-proposes-backstop-capacity-100932204.html
2•measurablefunc•1h ago•0 comments

China tests largest superconducting fusion magnets ever built

https://theprint.in/india/breakthrough-china-artificial-sun-project-6-5-tesla-magnet/2999321/
6•soniman•1h ago•1 comments