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

Show HN: Autonomous daily AI news briefing blog

https://ai0.news/
1•Komte•53s ago•0 comments

PlanningPoker / Agile Estimations – Free, no-signup for sprint planning

https://planning-poker.teamretro.com/
1•jlufacilitator•6m ago•0 comments

Big Stupid Has Infiltrated the State Department

https://www.esquire.com/news-politics/a73320214/state-department-africa-map-mislabeled/
1•Alien1Being•9m ago•1 comments

True Cost of Cross-Border Payments: Correspondent Banking Myths vs. Reality

https://paybitz.io/true-cost-of-cross-border-payments-correspondent-banking-myths-vs-reality/
1•PayBitz•10m ago•0 comments

The Book That Predicted Pete Hegseth's Failures

https://foreignpolicy.com/2026/07/31/hegseth-norman-dixon-iran-war/
1•Alien1Being•12m ago•0 comments

Show HN: AI Presentaions, Posters, and All Visual Designs

https://starrykit.com
1•Mine77•13m ago•0 comments

The Future of Gnome Boxes

https://blogs.gnome.org/feborges/future-of-boxes/
1•birdculture•16m ago•1 comments

Live Full Stack Domain Specific Web Coding Agent Demo [video]

https://www.youtube.com/watch?v=ZJOE_EuyRTY
1•marianoguerra•17m ago•0 comments

"Clean" Code, Horrible Performance [video]

https://www.youtube.com/watch?v=tD5NrevFtbU
1•FrojoS•19m ago•0 comments

Bending Spoons acquires Airtable for 1.285B

https://en.ilsole24ore.com/art/first-move-nasdaqs-bending-spoons-acquires-airtable-for-1285-billi...
2•napolux•20m ago•0 comments

The Tungsten Market Is Warning of an Upcoming War

https://www.bloomberg.com/news/audio/2026-08-03/odd-lots-tungsten-market-is-warning-of-upcoming-w...
1•Alien1Being•21m ago•0 comments

Claude Code can read plaintext secrets even when Read is denied

https://jankovd.substack.com/p/claude-can-read-your-secrets
1•jdex•21m ago•0 comments

Show HN: I made a private self-destructing image hosting site in Golang

https://picburn.xyz/
2•shelldweller•26m ago•0 comments

Why the Legendary Erdős Problems Are Falling to AI

https://www.quantamagazine.org/why-the-legendary-erdos-problems-are-falling-to-ai-20260803/
1•isaacfrond•27m ago•0 comments

Show HN: Doomscroll GitHub Instead of TikTok

https://roamers.dev
1•momo5502•27m ago•0 comments

Show HN: Made Our BI v7 – Free Open Source with All Features (AI, SSO, RLS etc.)

2•nikhelical•32m ago•0 comments

Ask HN: Has anyone tried a minimal AGENTS.md that grows with you repo?

1•xinbenlv•33m ago•0 comments

Bending Spoons entered definitive agreement to acquire Airtable for $1.28B

https://www.businesswire.com/news/home/20260730994716/en/Bending-Spoons-has-entered-into-a-defini...
10•BoorishBears•35m ago•2 comments

Runaway online rumors sparked frantic rush by migrants to Ceuta

https://apnews.com/article/ceuta-spain-morocco-migration-f3a7f514a7792c39d8b8d5d814fa5158
2•geox•36m ago•0 comments

NHS apologises and admits Palantir have access to identifiable patient data

https://www.publictechnology.net/2026/08/03/health-and-social-care/nhs-apologises-and-admits-pala...
84•robin_reala•38m ago•11 comments

Show HN: A GenAI image benchmark for production design work

https://img.ly/ai-benchmarks/
1•buss_jan•39m ago•0 comments

Show HN: I made a private self-destructing image hosting site in Golang

https://picburn.xzy
1•shelldweller•39m ago•1 comments

Amiga announces out-of-court settlement with Hyperion

https://www.amiga-news.de/en/news/AN-2026-08-00022-EN.html
1•codewiz•40m ago•0 comments

AGs have instructed OpenAI to keep everything related to the Hugging Face hack

https://www.businessinsider.com/openai-attorney-general-preserve-hugging-face-evidence-2026-8
4•theanonymousone•44m ago•0 comments

Wikipedia article "Ship of Theseus" has changed entirely since its inception

https://en.wikipedia.org/wiki/Ship_of_Theseus
2•beardyw•44m ago•2 comments

Decomposing a $46K Vercel bill: what would it cost to self-host

https://docs.dollardeploy.com/blog/decomposing-a-46k-vercel-bill-what-would-it-cost-to-self-host/
1•huksley•46m ago•0 comments

Ask HN: What programs have you written by yourself that you use regularly?

3•robalni•50m ago•2 comments

I Got Banned for Helping Trans People

https://vanzasetia.xyz/blog/banned-for-helping/
1•meysamazad•52m ago•4 comments

Disney+ brings 4K streaming back to European customers, HDR still on to-do list

https://www.techradar.com/streaming/disney-plus/disney-brings-4k-streaming-back-to-european-custo...
1•HelloUsername•52m ago•0 comments

Pi: Remove Redundant GitHub MCP

https://perrotta.dev/2026/08/pi-remove-redundant-github-mcp/
1•meysamazad•53m ago•0 comments