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

Woman's hip replacement disintegrates, causing metal poisoning

https://arstechnica.com/health/2026/07/womans-puzzling-decline-turns-out-to-be-cobalt-poisoning-f...
1•Qem•4m ago•0 comments

Life as a State Machine; a Framework for Action-Taking

https://medium.com/@techandsundry/why-just-do-it-doesnt-work-c8b85a1e39c2
1•sgkey28•6m ago•0 comments

The Chinese Resignation Letter That Caused a CEO-Toppling Storm

https://www.sixthtone.com/news/1018741
2•firexcy•7m ago•0 comments

Why AI Orchestration Belongs in the Browser

https://www.esri.com/en-us/software-engineering/blog/articles/ai-orchestration-in-the-browser
1•dhrumil83•8m ago•0 comments

Caught a .git/Config Crawler

https://bruceediger.com/posts/git-config-spider/
2•birdculture•9m ago•0 comments

Artificiety – Agentic society in a fantasy world (early access)

https://artificiety.world
1•Haldt•12m ago•1 comments

Ternlight – 7 MB embedding model that runs in browser (WASM)

https://ternlight-demo.vercel.app/
1•soycaporal•13m ago•1 comments

Boffins bet on quantum computers, AI supers to solve fusion fuel dilemma

https://www.theregister.com/science/2026/07/06/boffins-bet-on-quantum-computers-ai-supers-to-solv...
1•Bender•13m ago•0 comments

Tesla app code reveals cabin camera will verify driver before FSD

https://electrek.co/2026/07/06/tesla-cabin-camera-fsd-identity-check/
2•Bender•14m ago•0 comments

Show HN: Cindy – Managing infrastructure at breakneck speed

https://cindy.rs
1•martinkroner•14m ago•0 comments

Ask HN: Buy Me a Coffee Alternative

2•sudo_cowsay•18m ago•1 comments

Fable turned remarkable into Tom Riddle's diary from Harry Potter

https://github.com/MaximeRivest/Riddle
1•modinfo•19m ago•0 comments

Things Will Escalate This Week Oil Prices Will Surge [video]

https://www.youtube.com/watch?v=uCJ02B4DcDM
2•Bender•21m ago•0 comments

Home made 8192 Core RISC-V Cluster [video]

https://www.youtube.com/watch?v=qMR3IXF2sWw
1•boznz•22m ago•1 comments

Google CEO brought optimism to Stanford commencement. Some graduates walked out

https://www.mercurynews.com/2026/06/14/stanford-google-sundar-pichai-israel-gaza/
1•gnabgib•23m ago•1 comments

NASA's request to the private sector for plans for commercial space stations

https://sam.gov/workspace/contract/opp/19a8a55c066441ef891e33bac770dd9d/view
1•ohjeez•26m ago•0 comments

Vessel

https://claude.ai/public/artifacts/2c647671-3f94-4d22-b3c1-f2b5a0e17b6e
1•schwarzarno•31m ago•1 comments

Proton now using 100% Chinese LLM's – drops European and US

https://old.reddit.com/r/BuyFromEU/comments/1up518w/proton_now_using_100_chinese_llms_drops_europ...
4•doener•33m ago•0 comments

Speechify's Simba 3.2 API takes the #1 spot on Artificial Analysis Speech Arena

https://artificialanalysis.ai/text-to-speech/leaderboard/selected-voice
3•lukeocodes•33m ago•0 comments

Joseph Brant

https://en.wikipedia.org/wiki/Joseph_Brant
1•vinnyglennon•33m ago•0 comments

Commits · antirez/ds4 glm5.2 branch

https://github.com/antirez/ds4/commits/glm5.2/
1•tingletech•35m ago•0 comments

Generating Dynamic Open Graph Images on Cloudflare Workers

https://vinayakkulkarni.dev/articles/dynamic-og-images-on-cloudflare-workers/
1•vinayakkulkarni•37m ago•0 comments

Not everything should cost a token: the case for deterministic AI

https://www.vybe.build/blog/learn-what-not-to-tokenize
1•marwann•43m ago•0 comments

Show HN: L9gpu – GPU telemetry that ties each GPU to the K8s pod or Slurm job

https://github.com/last9/gpu-telemetry
2•nishantmodak•45m ago•0 comments

OpenSSH 10.4/10.4p1 Released

https://www.openssh.org/txt/release-10.4
3•throw0101a•46m ago•2 comments

Elon Musk promotes 'anti-migrant' Armie Hammer film with free download on X

https://www.theguardian.com/film/2026/jun/30/elon-musk-anti-migrant-armie-hammer-film-free-downlo...
5•croes•47m ago•1 comments

Claude and Codex and Grok: my current workflow and its friction

https://www.nativesoul.dev/
2•fillipecordeiro•47m ago•0 comments

X509-limbo: testvectors and tooling for evaluating X.509 path validation

https://x509-limbo.com/
2•sscaryterry•48m ago•0 comments

Acronym Fatigue Series Introduction: why I'm wary of acronyms

https://devz.cl/posts/acryonym-fatigue-series-why-i-m-wary-of-engineering-acronyms/
1•DanielVZ•49m ago•0 comments

I'm adding QR Codes on my cables

https://old.reddit.com/r/homelab/comments/1upbg07/im_adding_qr_codes_on_my_cables/
5•andresribeiro•50m ago•1 comments