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).

Measuring Strait of Hormuz ship traffic and how Big Oil profits from it

https://wherobots.com/blog/hormuz-vessel-detection/
1•dr-jia-yu•2m ago•0 comments

Polygon Discovers Fire Emblem: Fortune's Weave Requires the Console It Was Made

https://noisypixel.net/fire-emblem-fortunes-weave-switch-2-exclusive/
1•jamarna•4m ago•0 comments

Packing Malware in Rosetta 2

https://kernelkennel.com/blog/summercon2026-rosetta/
1•n0blenote•5m ago•0 comments

American killed by lightning while climbing Italian volcano

https://www.newsweek.com/american-killed-by-lightning-while-climbing-italian-volcano-12330506
1•jamarna•5m ago•0 comments

Slack Code Is Live

https://twitter.com/Benioff/status/2090240159115853956
1•ramoz•6m ago•1 comments

Armwood High graduate uses 40 scholarships to attend Princeton

https://baynews9.com/fl/tampa/news/2026/08/14/armwood-high-graduate-uses-scholarships-to-make-pri...
2•banimak•8m ago•0 comments

SeedSQL – Generate realistic SQL mock data with foreign key integrity

https://seed-sql.ai.studio
2•hrdhanush•9m ago•0 comments

Cloudflare Workers Spectre Attack Leaks JWT at 12 Bits/S

https://cyberupdates365.com/cloudflare-workers-spectre-attack/
2•sysadmin_diarie•10m ago•0 comments

MiniageOS: "Dumbphone" Version of LineageOS

https://github.com/ofdryads/miniageOS
2•ashenke•10m ago•0 comments

Fool's Gold: Defensive Deception Against Safety-Removal Attacks on Open-Weight

https://arxiv.org/abs/2608.17202
2•sbulaev•10m ago•0 comments

Scenic spot in Italian mountains overrun by tourists seeking the perfect pastry

https://www.ctvnews.ca/lifestyle/article/scenic-spot-in-italian-mountains-overrun-by-tourists-see...
2•mafidia•11m ago•0 comments

GEN-1.5, a one-shot learner robotics foundational model [video]

https://www.youtube.com/watch?v=1cllCVK-9lo
2•AareyBaba•11m ago•0 comments

Imging – Local Image Tools

https://imging.cn/en/
1•fgghyyfk•13m ago•0 comments

'It wasn't me': Weed use in Allegheny County jury room forces homicide mistrial

https://triblive.com/privacy/
1•hussnymoba•13m ago•0 comments

Cost-Aware Optimization for Agentic Query Execution

https://arxiv.org/abs/2606.03152
1•matt_d•14m ago•0 comments

Invited media and military members held at gunpoint at Space Force base in Calif

https://apnews.com/article/vandenberg-space-force-base-california-journalists-detained-4815c999cb...
3•barnoka•17m ago•0 comments

Hamilton's Theory of Turns Revisited

https://arxiv.org/abs/0904.4787
1•oliculipolicula•17m ago•0 comments

Forty First Dates and Still Searching

https://www.nytimes.com/2026/08/18/well/family/forty-first-dates-and-still-searching.html
1•gmays•17m ago•0 comments

Crypto's (and AI's) midterm PAC machine

https://www.politico.com/newsletters/politico-influence/2026/08/19/a-rare-setback-for-cryptos-mid...
1•mmooss•19m ago•0 comments

Scaling RAG building an efficient pipeline for 500k chunks with Gemini

https://www.rsolitario.com/scaling-rag-building-an-efficient-pipeline-for-500k-chunks-with-gemini...
1•caruasdo•19m ago•0 comments

Cannabis facility goes up in smoke near High River

https://www.ctvnews.ca/calgary/article/cannabis-facility-goes-up-in-smoke-near-high-river/
1•madkoor•20m ago•0 comments

The Shadow Work Journal: A Guided Journey to Self-Discovery and Healing

https://pdfsellernew.netlify.app/
1•athrayasaas•21m ago•0 comments

The VC Days: So many miracles

https://ricomariani.medium.com/the-vc-days-so-many-miracles-21a12e5ecdb8
1•bananaboy•22m ago•0 comments

Blackadder II the Historic Second Series (1995 UK VHS)

https://archive.org/details/blackadder-the-entire-historic-second-series-1995-uk-vhs
2•petethomas•23m ago•0 comments

Where Does Computation End?

https://sslog.dpdns.org/where-does-computation-end.html
2•Shaurya_Sharma•29m ago•0 comments

Natural Independence Incentives

https://www.jefftk.com/p/natural-independence-incentives
1•luu•32m ago•0 comments

Successful first‑stage recovery of the Zhuque‑3 rocket

https://www.reddit.com/r/SpaceXLounge/comments/1vs6mqr/successful_firststage_recovery_of_the_zhuq...
2•pinewurst•38m ago•0 comments

Building high-performance flat 2D arrays in Rust (SIMD, L1 Cache)

https://developerlife.com/2026/07/14/build-high-performance-flat-2d-arrays-in-rust/
2•nazmulidris•39m ago•0 comments

Market Close data in an easy to read email

https://www.theclose.email/
2•mattmerrick•41m ago•1 comments

Show HN: MatrAIx – simulate users before reality (Survey/Chat/Web/App)

https://github.com/MatrAIx-ai/MatrAIx-Persona-8B
3•YuexingHao•43m ago•0 comments