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

Rumors that OpenAI recently finished new >10T parameter training run

https://twitter.com/synthwavedd/status/2092326145270456377
1•andy12_•1m ago•0 comments

The Deadly Global War for Sand (2015)

https://www.wired.com/2015/03/illegal-sand-mining/
1•EndXA•1m ago•0 comments

Former Rockstar producer says Read Dead Redemption 1 online had a "cheater jail"

https://old.reddit.com/r/gaming/comments/1vy75nq/former_rockstar_producer_says_rdr_1_online_had_a/
1•embedding-shape•2m ago•0 comments

Microsoft Copilot Cowork Controlled by Attacker, Bypassing Sandbox

https://www.promptarmor.com/resources/microsoft-copilot-cowork-sandbox-bypass
1•hackerBanana•2m ago•0 comments

Category Theory for Kids

https://kids.kiddle.co/Category_(mathematics)
1•marysminefnuf•2m ago•0 comments

Make your own Darkbloom – The Expert Network pools Macs into one model

https://github.com/walter-grace/expert-sniper
1•beargrizzzy•2m ago•0 comments

Adding diagrams to my static site generator with D2

https://www.gilesthomas.com/2026/08/adding-d2
1•gpjt•4m ago•0 comments

Japanese farmers go nocturnal as extreme heat makes the day too dangerous

https://www.theglobeandmail.com/world/article-japanese-farmers-nocturnal-heat-safety/
1•debo_•9m ago•0 comments

Rare Disease, Real Kid: The MVA Hackathon 2026

https://sagebio-rare-disease-real-kid-mva-hackathon-2026.hf.space/
1•dsr12•10m ago•0 comments

Bit Pixel

https://1bitstudio.app/pixel/
1•selimonder•10m ago•0 comments

Tracing Claude Tag, Anthropic's Slack Agent

https://docs.scorecard.io/intro/claude-tag-tracing
1•Rutledge•12m ago•0 comments

OpenAI's 700W Jalapeño ASIC outpaces 1,400W Nvidia flagship GPU

https://www.tomshardware.com/tech-industry/semiconductors/openai-says-its-jalapeno-chip-beats-nvi...
1•rbanffy•15m ago•0 comments

One Go binary, one YAML file, one SQLite database: I wrote my monitoring tool

https://rvier.fr/posts/why-i-wrote-my-own-monitoring-tool-EN
2•brvier•20m ago•0 comments

Claim your city's #1 spot

https://www.outbidhere.com
1•paulmbw•20m ago•1 comments

Valley of the Ants

https://en.wikipedia.org/wiki/Valley_of_the_ants
1•marysminefnuf•21m ago•0 comments

Ripping Off the Hey.com Band-Aid

https://kylemcgough.com/blogs/ripping-off-the-heycom-band-aid
15•sosodev•25m ago•1 comments

Python's pre-declared constants are kinda weird

https://sebsite.pw/w/20260801-pythonconstants.html
4•rbanffy•25m ago•0 comments

Same net, same seed – 100% vs. 50% on unseen magnitudes

https://structured-intelligence.grok.me
1•jarrodseth•26m ago•0 comments

Making Atuin sync 32x faster with packfiles

https://blog.atuin.sh/making-atuin-sync-32x-faster-with-packfiles/
2•sea-gold•26m ago•0 comments

Show HN: Flinch – a Dutch auction for one ad slot that never ends

https://flinch.auction/
1•nadermx•28m ago•0 comments

Show HN: Graphlib 3.1 – the C++ 23, header only solution to directional graphs

https://github.com/RANDOMFNP/Graphlib
1•RandomFNP•30m ago•0 comments

Ask HN: Is "3D as software" about to undergo a Cambrian Explosion?

2•baigy•31m ago•0 comments

On the gradual formation of thoughts in the process of speech (1805) [pdf]

https://odradeksjourney.wordpress.com/wp-content/uploads/2017/11/on-the-gradual-formation-of-thou...
1•rzk•32m ago•0 comments

Uniform Financial Institutions Rating System

https://www.federalregister.gov/documents/2026/05/19/2026-09944/uniform-financial-institutions-ra...
1•petethomas•35m ago•0 comments

The Second Age of Melancholy

https://buildingthenews.substack.com/p/the-second-age-of-melancholy
1•OrrH•36m ago•0 comments

Show HN: Codex / Claude Code harness for Java high performance improvements

https://registry.modelcontextprotocol.io/v0.1/servers/io.github.JAIPilot%2Fjaipilot/versions/6.4.2
3•surajkrajan•40m ago•0 comments

Show HN: Ecdeos – P2P Web/Native Distributed OS on Entity Core Protocol

https://ecdeos.org
1•billatbillslab•44m ago•0 comments

AntiNCII – hashing to combat intimate image abuse without file uploads

https://antincii.org/
2•ndf00•46m ago•1 comments

XCancel also down, at least for time being

12•orange999•46m ago•1 comments

OKF Isn't Replacing the Vector Database. It's Freeing It

https://medium.com/@majid.fekri/okf-isnt-replacing-the-vector-database-it-s-freeing-it-3cc64ab47fa3
2•supportm•46m ago•0 comments