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

Under federal rule, colleges must leave grads better off or lose financial aid

https://www.npr.org/2026/06/30/nx-s1-5835631/turner-camhi-do-no-harm-college-loans
2•nradov•3m ago•0 comments

A Captive Audience

https://seths.blog/2026/07/a-captive-audience/
1•herbertl•11m ago•0 comments

In defense of not understanding your codebase

https://www.seangoedecke.com/in-defense-of-not-understanding-your-codebase/
1•herbertl•11m ago•0 comments

Cloudflare Threatens to Cut Google Off from Their Publishers in Searches

https://www.nakedcapitalism.com/2026/07/cloudflare-threatens-to-cut-google-off-from-their-publish...
3•hackandthink•20m ago•0 comments

Show HN: Dgxtop: Rust Monitor for DGX or need to monitor GPU status

https://github.com/DennySORA/dgxtop
1•dennysora-main•21m ago•0 comments

Run Claude and Codex in the Browser [video]

https://www.youtube.com/watch?v=wgNbFRgQXwU
4•Ellis_dev•24m ago•2 comments

The Mind-Bending Company That Gets a Million Job Applications–and Rejects 99.9%

https://www.wsj.com/business/bending-spoons-jobs-hiring-stock-eaed2b8e
1•Stratoscope•27m ago•1 comments

Notion database based form builder

https://ndbforms.com/
2•nookeshkarri7•29m ago•0 comments

Martin van Creveld Interview

https://www.sonshi.com/martin-van-creveld-interview.html
1•fisheuler•30m ago•0 comments

The Entire History of Tetris Game Design

https://www.youtube.com/watch?v=mGuYUEuVDYc
1•euthymiclabs•36m ago•0 comments

Negotiating AI in Open Source Software Communities: A Case Study of LLVM Project

https://gupea.ub.gu.se/server/api/core/bitstreams/ad9b523e-f6d5-4dc2-b632-64f9734484cf/content
1•matt_d•39m ago•0 comments

What do you do when your to-do list gets out of hand?

https://www.taskloco.com/
2•taskloco_nyc•49m ago•1 comments

I built my DREAM New York City apartment from SCRATCH in 93 days [video]

https://www.youtube.com/watch?v=9hL4V3KFTKQ
1•tekacs•49m ago•0 comments

The Task Is Not the Unit of Work

https://sekoudoumbouya.com/blog/the-task-is-not-the-unit-of-work/
1•fakoli•53m ago•0 comments

Why the world is ordering buildings from China [video]

https://www.youtube.com/watch?v=qGqYaULHPV4
1•thelastgallon•53m ago•0 comments

Forward Deployed

https://andys.blog/forward-deployed/
1•andytratt•53m ago•0 comments

Why are US consumers so angry? It's not just high prices

https://www.theguardian.com/us-news/ng-interactive/2026/jun/04/us-consumer-rage-prices-economy
11•dilawar•53m ago•1 comments

Supernormal Stimulus

https://en.wikipedia.org/wiki/Supernormal_stimulus
1•thunderbong•55m ago•0 comments

TalkFitly – Practice high-EQ conversations with AI

https://apps.apple.com/us/app/talkfitly/id6776912365
1•sghick•57m ago•0 comments

Reducing HBM Bottlenecks in JAX-Based LLM Training with Host Offloading

https://developer.nvidia.com/blog/reducing-high-bandwidth-memory-bottlenecks-in-jax-based-llm-tra...
2•matt_d•1h ago•0 comments

Compiler Testing – Part 2: Metamorphic Testing with Verified Identities

https://nowarp.io/blog/compiler-testing-part-2/
2•matt_d•1h ago•0 comments

Martha Lillard, last US polio patient using iron lung, dies at 78 in Oklahoma

https://apnews.com/article/iron-lung-last-patient-died-polio-41e5b4da4f4e710344dd0872d7fcf987
2•gscott•1h ago•1 comments

OpenAI Engineer's 'LOL' Moment Set Stage for Legal Fight with Apple

https://www.bloomberg.com/news/articles/2026-07-11/openai-engineer-s-lol-moment-set-stage-for-leg...
2•sbulaev•1h ago•1 comments

All the Government's 385,837 frames of UFO files released thus far

https://hypergrid.systems/war.gov-ufo-viewer/microfilm5
1•keepamovin•1h ago•0 comments

Ukraine accuses Russia of creating conditions for the spread of anthrax

https://outbreaknewstoday.substack.com/p/ukraine-accuses-russia-of-creating
5•pinewurst•1h ago•1 comments

Don't You Mean Extinct?

https://fabiensanglard.net/extinct/index.html
1•markus_zhang•1h ago•0 comments

Survival guide: Key advice for what to do if you find yourself in a wildfire

https://www.euronews.com/my-europe/2026/07/10/survival-guide-key-advice-for-what-to-do-if-you-fin...
3•rawgabbit•1h ago•0 comments

Small Inventors Are Being Squeezed by a Convoluted Patent Process

https://www.nationalreview.com/news/small-inventors-are-being-squeezed-by-a-convoluted-patent-pro...
11•petethomas•1h ago•0 comments

Show HN: We beat Anubis with our stealth MCP

https://tilion.dev/blog/anubis-proof-of-work
8•armanluthra_•1h ago•3 comments

Show HN: Quantum-Qec / Matrix-Free Quantum Homeostatic Engine(Blueprint)

https://github.com/PJHkorea/quantum-mesh-qec
3•PJHkorea•1h ago•3 comments