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

In Praise of Memcached

https://jchri.st/blog/in-praise-of-memcached/
1•j03b•1m ago•0 comments

Universal basic income, the utopian idea resurging in Silicon Valley

https://www.lemonde.fr/en/opinion/article/2026/06/14/universal-basic-income-the-utopian-idea-resu...
1•nreece•1m ago•0 comments

Every Choice Changes Everything: The Show

https://blog.codinghorror.com/every-choice-changes-everything-the-show/
1•doppp•3m ago•0 comments

Death by a Thousand Comments

https://royalicing.com/2026/death-by-a-thousand-comments
2•burntcaramel•5m ago•0 comments

69 Ways to Mess Up Your Deploy

https://kellyshortridge.com/blog/posts/69-ways-to-mess-up-your-deploy/
2•rzk•9m ago•0 comments

Shall We Play a Coordination Game?

https://kellyshortridge.com/blog/posts/shall-we-play-a-coordination-game/
2•rzk•10m ago•0 comments

Hackers Publish Knicks and Madison Square Garden Data Online

https://itnerd.blog/2026/06/18/hackers-publish-knicks-and-madison-square-garden-data-online/
1•mooreds•12m ago•0 comments

Palmier Pro: macOS video editor built for AI

https://github.com/palmier-io/palmier-pro
1•maxloh•12m ago•0 comments

AI's Brokenomics

https://www.wheresyoured.at/brokenomics/
3•Anon84•15m ago•0 comments

Elescend Marketing

https://www.elescendmarketing.com
1•jemswilliams•20m ago•0 comments

The biggest problem I see with people trying to sell to Pharma

1•rshadow117•21m ago•0 comments

Eyewitness at the Triangle (1911)

http://trianglefire.ilr.cornell.edu/index.html
1•NaOH•22m ago•0 comments

Polymarket's viral videos showed people winning big, but the bets were fake

https://arstechnica.com/tech-policy/2026/06/polymarkets-viral-videos-showed-people-winning-big-bu...
32•pseudolus•29m ago•8 comments

Gee-haw whimmy diddle toy [video]

https://www.youtube.com/watch?v=miznyTxjT3k
2•1970-01-01•30m ago•0 comments

Facial recognition on public buses sparks debate over security and privacy

https://apnews.com/article/kansas-city-facial-recognition-ai-cameras-privacy-87847f57c94b6c2a9e22...
8•devonnull•31m ago•1 comments

Ando

https://www.ando.so/
3•handfuloflight•39m ago•0 comments

Graphviz MCP Provider

https://graphviz-provider.rodmena.app/
4•rodmena•45m ago•0 comments

Show HN: DELN – An interactive atlas of AI training datasets

https://deln.ai/atlas
2•yshunnar•49m ago•0 comments

AI is changing biological and nuclear risks; governance must change accordingly

https://thebulletin.org/2026/06/ai-is-changing-biological-and-nuclear-risks-governance-must-chang...
2•pseudolus•50m ago•0 comments

The future of oil prices may depend on China

https://www.cnn.com/2026/06/22/energy/oil-price-china-dependence-iran-war-intl-hnk
2•toomuchtodo•54m ago•1 comments

California police are using drones to disarm people, make arrests

https://www.sfgate.com/bayarea/article/california-police-drone-responders-22315437.php
4•pseudolus•57m ago•1 comments

We built the fastest API for GLM-5.2 (280 TPS)

https://www.baseten.co/blog/how-we-built-the-worlds-fastest-api-for-glm-52/
6•philipkiely•58m ago•0 comments

Why Are LLMs Smart?

https://kevinkelly.substack.com/p/why-are-llms-smart
2•sgallant•1h ago•0 comments

Vietnam plans to discontinue IPv4 by 2030

https://vietnamnet.vn/en/vietnam-launches-ipv6-only-roadmap-to-power-next-digital-era-2527244.html
5•ivlad•1h ago•1 comments

A hedged NSA briefing line became "Mythos hacked the NSA"

https://old.reddit.com/r/AICognitiveWatch/
3•GlyphWeaver_a•1h ago•0 comments

How transparent is DiffusionGemma (and why it matters)

https://www.lesswrong.com/posts/zoYXpdaMgFT43Wc24/how-transparent-is-diffusiongemma-and-why-it-ma...
2•gmays•1h ago•0 comments

Porting Moebius 0.2B image inpainting model to run in browser with Claude Code

https://simonwillison.net/2026/Jun/22/porting-moebius/
3•lumpa•1h ago•0 comments

Music retailer sues Fender over C&Ds in Stratocaster copyright dispute

https://www.guitarworld.com/gear/electric-guitars/thomann-is-suing-fender
4•ilamont•1h ago•0 comments

The Complete Kubrick

https://www.criterion.com/boxsets/9000-the-complete-kubrick
3•pentagrama•1h ago•1 comments

SpaceX turns to bond market to raise capital, reports $100.8B cash

https://www.reuters.com/business/media-telecom/spacex-launches-notes-offering-discloses-1008-bill...
7•voxadam•1h ago•2 comments