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

The ability to regrow body parts is dormant in mammals, not lost

https://www.sciencedaily.com/releases/2026/06/260617032207.htm
2•nryoo•2m ago•0 comments

Was lucky to have tested fable 5 on chess-bench

https://www.chess-bench.com
1•hardikvora•5m ago•0 comments

Claude Guillemot, co-founder of Ubisoft, dies in plane crash

https://www.cbsnews.com/news/claude-guillemot-dies-age-69-ubisoft-assassins-creed/
1•iugtmkbdfil834•7m ago•0 comments

Floppy Disk Piracy: How Software Was Shared Before the Internet

https://comuniq.xyz/post?t=1280
1•01-_-•7m ago•0 comments

I improved my old project "ScoreCast" after 3 years

https://github.com/Costasgk/ScoreCast
1•costas_8•8m ago•1 comments

Dialog

https://dialog.org/
1•paulpauper•9m ago•0 comments

Are You in the Weights?

https://intheweights.com/p/peterboettke
1•paulpauper•9m ago•0 comments

Refik Anadol's Dataland, the first AI art museum

https://www.theartnewspaper.com/2026/06/18/refik-anadol-dataland-opens-los-angeles
1•paulpauper•10m ago•0 comments

AIPropel, AI-powered proposal generation for freelancers and agencies

https://www.aipropel.app/
1•omardakelbab1•11m ago•0 comments

Tangled: Knot-Stored Cob Proposal

https://leaflet.pub/p/did:plc:xasnlahkri4ewmbuzly2rlc5/3mmex6biynk2g
1•jeremyjh•11m ago•0 comments

That which is unique, breaks

https://map.simonsarris.com/p/that-which-is-unique-breaks
1•mmphosis•11m ago•0 comments

Shard your locks: benchmarking 6 Go cache designs

https://strebkov.dev/posts/shard-your-locks/
1•kluyg•13m ago•0 comments

You probably don't need event-driven architecture

https://openacme.org/blog/you-dont-need-event-driven
1•theanonymousone•13m ago•0 comments

I Stopped Trusting SSH Key Files

https://igorstechnoclub.com/why-i-stopped-trusting-ssh-key-files/
1•Tomte•16m ago•1 comments

How to Attract Bats to Your Backyard

https://www.batcon.org/bat-house-tips-tricks/
1•andsoitis•17m ago•0 comments

We built an internal data analytics agent

https://github.blog/ai-and-ml/github-copilot/how-we-built-an-internal-data-analytics-agent/
1•Brajeshwar•25m ago•0 comments

UHF X11: X11 Built for VisionOS and Apple Vision Pro

https://www.lispm.net/apps/uhf-x11/
3•zdw•25m ago•0 comments

Bun has an open PR adding shared-memory threads to JavaScriptCore

https://github.com/oven-sh/WebKit/pull/249
3•gr4vityWall•27m ago•0 comments

Lena Walks

https://www.nomadicmatt.com/
2•docscannerss•28m ago•0 comments

SMPTE Makes Its Standards Freely Accessible

https://www.smpte.org/blog/smpte-makes-its-standards-freely-accessible-openingstandards-library-t...
14•zdw•28m ago•1 comments

Before SpaceX IPO, investors in China acquired stakes

https://www.propublica.org/article/spacex-elon-musk-ipo-foreign-investors-china
1•joozio•29m ago•0 comments

Ember, a native iOS Hacker News reader I built around accessibility

https://github.com/DatanoiseTV/ember-hackernews
7•sylwester•29m ago•1 comments

Hoog: Europe Is Losing [video]

https://www.youtube.com/watch?v=C84Lnyv0gTs
1•Klaster_1•29m ago•0 comments

How I Work

https://www3.nccu.edu.tw/~jthuang/krugman.html
1•jruohonen•31m ago•0 comments

Kagi Small Web

https://github.com/kagisearch/smallweb
1•dgellow•31m ago•2 comments

A Single Cobalt Shock Could Trigger Global EV Battery Supply Chaos

https://www.sciencedaily.com/releases/2026/06/260619101402.htm
2•karakoram•34m ago•0 comments

The frontier is open-source today

https://www.southbridge.ai/blog/offmute-v2-glm-vs-opus
3•hrishi•37m ago•1 comments

Hand-powered LLM (YouTube) [video]

https://www.youtube.com/watch?v=HSapdLYpmWY
2•mcchen51•38m ago•0 comments

Every DFU Button Is a Failure

https://umi.engineering/blogs/engineering/every-dfu-button-is-a-failure
2•liamkinne•40m ago•0 comments

Palmier-pro: macOS video editor built for AI

https://github.com/palmier-io/palmier-pro
3•nateb2022•41m ago•0 comments