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 Insider

https://randsinrepose.com/archives/the-insider/
1•aray07•26s ago•0 comments

Aethyro – AI chat SaaS, and a billing bypass I found by attacking my own product

https://aethyro.com/
1•leer4030•57s ago•0 comments

Ask HN: What router will remain secure during the vulnpocalypse?

1•nonfunctional•3m ago•0 comments

Wall Street prepares for AI's "day after"

https://www.axios.com/2026/10/23/ai-catastrophe-wall-street
1•toomuchtodo•8m ago•0 comments

Claude made me a DOOM II level [video]

https://www.youtube.com/watch?v=o6tNhFPuYjE
2•audiodude•8m ago•0 comments

Elections Are More Predictable Than They Look

https://www.caltech.edu/about/news/elections-are-more-predictable-than-they-look
1•armcat•9m ago•0 comments

Small, calm welcome screen for Emacs (a warm extensible dashboard)

https://codeberg.org/jjba23/welkomscherm.el
1•jjba23•18m ago•0 comments

Show HN: Codex quota tracker Garmin watch face

https://github.com/greg76/token-quota/tree/main
1•gregkb•21m ago•0 comments

12 Angry Agents

1•anuptalwalkar•23m ago•0 comments

Conservation of Compute

https://nishantjosh.dev/blogs/conservation-of-compute/
1•cat-whisperer•24m ago•1 comments

I ran the full 2.8T-parameter Kimi-K3 on a 64GB Mac Mini

https://github.com/sjdthree/kimi-k3-mlx-macmini
2•sjdthree•25m ago•1 comments

German court calls Google aerial imagery 'spying'

https://www.courthousenews.com/german-court-calls-google-aerial-imagery-spying/
2•rdmuser•25m ago•0 comments

Narrative Deck – AI Agent skill for creating interactive web stories

https://aakatheeri.github.io/narrative-deck/
2•aakatheeri•25m ago•0 comments

Greece passes social media ban for children under 15

https://www.reuters.com/legal/litigation/greece-passes-social-media-ban-children-under-15-2026-10...
5•thunderbong•29m ago•0 comments

I Am New Here

1•dev_man•31m ago•1 comments

Show HN: You Can Just Filter YouTube Playlists in the 'Save to Playlist' Dialog

2•ydoc5212•33m ago•0 comments

iPhone Duo jailbroken on launch day

https://www.macrumors.com/2026/10/23/iphone-duo-jailbreak/
4•gloxkiqcza•35m ago•1 comments

A Fix for Softmax and Cross-Entropy

https://jonbarron.info/softmaxfix/
3•Georgelemental•36m ago•0 comments

Oil spill washes up on UAE beaches after tanker strike

https://www.bbc.com/news/articles/c6rey3n974g5o
4•blondie9x•38m ago•1 comments

Birdwatching rewires the brain and slows cognitive decline

https://www.bbc.com/future/article/20261019-birdwatching-rewires-the-brain-and-slows-cognitive-de...
2•cisc•39m ago•2 comments

The same AI question emits more carbon dioxide in Texas than in Sweden

https://www.cio.com/article/4238689/the-same-ai-project-emits-more-carbon-dioxide-in-texas-than-i...
2•wltyn•40m ago•0 comments

Google will pay people to use less electricity so its data centers can use more

https://www.computerworld.com/article/4239858/google-will-pay-people-to-use-less-electricity-so-i...
7•mikelgan•40m ago•1 comments

Learning as Freedom (2012)

https://www.nytimes.com/2012/09/06/opinion/john-deweys-vision-of-learning-as-freedom.html
1•alasr•41m ago•1 comments

AI devours a fifth of companies' IT budgets

https://www.computerworld.com/article/4239898/ai-accounts-for-one-fifth-of-companies-it-budgets.html
3•mikelgan•44m ago•0 comments

Why have coding agents not brought easter-egg utopia?

https://rallywith.ai/blog/bring-back-easter-eggs/
1•ajuhasz•46m ago•1 comments

HumanLayer is now Open Source

https://www.hlyr.dev/blog/open-sourcing-humanlayer
5•dhorthy•46m ago•1 comments

AI Just Raised the Stakes on Continuous Delivery

https://www.bradoyler.com/ai/continuous-delivery-is-a-security-feature/
1•bradoyler•50m ago•0 comments

Window Heat Pumps Offer Efficient Heating and Cooling Without Ductwork

https://www.wsj.com/business/energy-oil/window-heat-pumps-heating-cooling-fd552926
3•bookofjoe•51m ago•1 comments

Factorio version 2.1, the final major update for the game, has been released

https://factorio.com/blog/post/fff-449
3•haunter•52m ago•0 comments

Ritmo: Type-safe ECS runtime for TypeScript

https://ritmo.typeonce.dev/
2•sandromaglione•56m ago•0 comments