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

New abstraction level in software developing

https://codechroma.dev/
1•DmitriiUshakov•1m ago•1 comments

Can Self-Hosting Be Simple?

https://tedium.co/2026/08/26/self-hosting-third-place-strategy/
1•andsoitis•1m ago•0 comments

Justice: What's the right thing to do? [video]

https://www.youtube.com/watch?v=kBdfcR-8hEY
1•eamag•2m ago•0 comments

What to learn for AI Researcher interview?

https://github.com/sergey-kurshev/AiPrepLab
1•skrushev•2m ago•0 comments

Cursed Napster

https://tedium.co/2026/09/21/napster-ai-pivot/
1•andsoitis•2m ago•0 comments

Show HN: Models[.]Dev Index on a Globe

https://modex.aunai.org/
1•omerasifdevops•2m ago•0 comments

Choice of Agonies [pdf]

https://freebsdfoundation.org/wp-content/uploads/2026/09/FreeBSDJournal.2026.Fall_.Lucas_.Letters...
1•jruohonen•6m ago•0 comments

Ask HN: How do you keep track of the articles, papers and videos you save?

1•Cenga387•7m ago•1 comments

The brain-body gap explanation for obesity

https://greyenlightenment.com/2026/10/29/the-brain-body-gap-explanation-for-obesity/
1•paulpauper•7m ago•0 comments

Show HN: R-eyesy: robo eyes that live on an old phone or a browser tab

https://wispplayer.com/reyesy/
2•Serg75•8m ago•0 comments

Halo: Combat Evolved in the Browser

https://opencommunityedition.com/
2•MrBruh•9m ago•1 comments

Show HN: NLP capabilities of Opus, Astra, Argon measured by Codenames skills

https://wordspies.com/hn
1•daluan•9m ago•1 comments

Show HN: Browser extension shows where to buy current domain name

https://domdb.com/tools/browser-extension
1•timbowhite•12m ago•0 comments

Ex-PlayStation boss says "true innovation" would be making a $300 console again

https://www.gamesradar.com/platforms/playstation/ps6-doesnt-need-more-power-ex-playstation-boss-s...
4•haunter•13m ago•0 comments

Write your own Wayland compositor: Rendering windows

https://nekidev.github.io/2026/11/07/1-welcome-to-wlroots-part-3.html
1•nyeki•14m ago•0 comments

Show HN: An offline desktop companion to help maintain a healthy blink rhythm

https://eyesrhythm.com/
3•prnysoni•18m ago•0 comments

Billion Watts in the Speaker [video]

https://www.youtube.com/watch?v=PHOcTXYaMfg
2•Element_•20m ago•0 comments

Learning in a World of Notes

https://engram.com/blog/learning-in-a-world-of-notes
1•cat-whisperer•21m ago•0 comments

Show HN: Levithas

https://levithas.app
2•monidp•26m ago•0 comments

AI productivity boost UK firms

https://www.theregister.com/ai-and-ml/2026/11/06/bank-of-england-pours-cold-water-on-ai-productiv...
1•frevib•29m ago•0 comments

The Behavior Gap: Why Investors Earn Less Than Their Own Funds [video]

https://www.youtube.com/watch?v=Fnmhunxb2l0
1•enjoyyourlife•30m ago•0 comments

Skitch.app Abandoned. Sitch Is MIT Alternative

https://phalladar.github.io/Sitch/
1•michael-sumner•31m ago•3 comments

The French Cake Cooked on a Spit (2018) [video]

https://www.youtube.com/watch?v=havcACdx0Y0
1•NaOH•37m ago•0 comments

Unfix – we unfix your fix, to prove it

https://unfix.dev/
1•_doctor_love•38m ago•0 comments

Prediction as Grounds: On How the State Is Learning to Punish Before the Crime

https://medium.com/@smoking2man/prediction-as-grounds-on-how-the-state-is-learning-to-punish-befo...
1•Aldus551•40m ago•0 comments

The Paradox of Standardisation

https://paulitaylor.com/2026/05/05/the-paradox-of-standardisation/
1•andsoitis•43m ago•0 comments

World of Warcraft: Forever Has Its First Level 60 Player

https://www.vice.com/en/article/world-of-warcraft-forever-has-its-first-level-60-player/
3•doener•43m ago•0 comments

Amutable Foundations: A Technical Overview

https://lwn.net/Articles/1105934/
1•jruohonen•43m ago•0 comments

A new open-source browser engine in V

https://vox-browser.org/
4•rakibtg•47m ago•1 comments

Segmentation Drives Market Share Wins in AI

https://tomtunguz.com/anthropic-repriced-the-enterprise/
2•gmays•51m ago•0 comments