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

Ethereum deploys AI agents to hunt bugs, discovers libp2p vulnerability

https://thecoinheadlines.com/tech-and-ai/ethereum-deploys-ai-agents-to-hunt-bugs-discovers-libp2p...
1•ar_writer•3m ago•0 comments

Dozens rescued in southeastern Missouri as 1-in-1k-year rainfall

https://www.cnn.com/2026/07/10/weather/missouri-flood-rescues-campers-climate
1•Bender•6m ago•0 comments

Show HN: A free and open source session recording Chrome extension

3•mohsen1•6m ago•0 comments

The 4-Bitter Lesson: Balancing Stability and Performance in NVFP4 RL

https://humansand.ai/blog/nvfp4-rl
1•Areibman•7m ago•0 comments

Show HN: My lunch-break transformer in C became a book about my toddlers

https://github.com/carlovalenti/TRiP/blob/main/My_TRiP_through_AI-Chapter3.md
1•carlovalenti•8m ago•0 comments

FCC Approves Reflect Orbital's Space Mirror Satellite That Astronomers Hate

https://www.pcmag.com/news/fcc-approves-reflect-orbitals-giant-mirror-satellite-that-astronomers-...
2•healsdata•8m ago•0 comments

Millions told to stay indoors lung-penetrating toxins sweep across two US states

https://www.dailymail.com/sciencetech/article-15969309/toxic-air-arizona-colorado-wildfire-smoke....
1•Bender•9m ago•0 comments

Musk tells Tesla staff to switch to Grok, a model he admits is worse

https://electrek.co/2026/07/10/musk-tells-tesla-staff-switch-grok/
1•Bender•10m ago•0 comments

I run my agency's 10 AI agents from launchd, no n8n, 0 dependencies

https://github.com/Botfather90/digiton-agent-fleet
2•Brandon99pt•13m ago•0 comments

Shuji Nakamura, Nobel Prize winning inventor of Blue LED, working on fusion

https://www.cnn.com/science/shuji-nakamura-lit-up-the-world-and-now-wants-to-power-it-spc
3•osnium123•17m ago•0 comments

Looks good, feels bad? Review explains why modern design can strain your brain

https://www.stir.ac.uk/news/2026/july-2026-news/looks-good-feels-bad-stirling-led-review-explains...
2•hhs•18m ago•0 comments

Let us now praise famous shape rotators

https://hollisrobbinsanecdotal.substack.com/p/let-us-now-praise-famous-shape-rotators
1•HR01•21m ago•0 comments

AIsteels – Materials Intelligence Stack

https://www.aisteels.it/
1•DrNuke•21m ago•0 comments

A Brief History of the Crazy Old 7-Segment Display

https://hackaday.com/2026/07/09/a-brief-history-of-the-crazy-old-7-segment-display/
2•kristianp•22m ago•1 comments

WolfIP Doesn't Allocate

https://hackaday.com/2026/04/09/wolfip-doesnt-allocate/
1•kristianp•22m ago•0 comments

Plants get wearables to track their health

https://now.tufts.edu/2026/07/08/plants-get-wearables-track-their-health
2•hhs•24m ago•0 comments

Gesamtwerk // Metaphysische Systemtheorie Ein Zustandsraum-Modell

https://www.academia.edu/169875498/GESAMTWERK_METAPHYSISCHE_SYSTEMTHEORIE_Ein_Zustandsraum_Modell...
1•MMSI•25m ago•0 comments

Arizona toddler declared dead was found alive in the morgue

https://www.nbcnews.com/news/us-news/arizona-toddler-declared-dead-was-found-alive-morgue-rcna352853
3•type0•27m ago•0 comments

Gary Kildall's Death Investigation

https://dfarq.homeip.net/gary-kildalls-death-investigation/
3•rbanffy•28m ago•0 comments

Show HN: I scrape an $8.5M-ARR company run by AI agents and chart it live

https://maertspolsia.mzpx.ai
1•pro_methe5•28m ago•0 comments

Stop Making Threads

https://moonside.games/posts/stop-making-threads/
1•chnoblouch•31m ago•0 comments

China takes a page from SpaceX and recaptures first stage of rocket to reuse it

https://apnews.com/article/china-rocket-space-reuse-6d695fcad64a101dc3991c1bfa0e7357
1•tocs3•35m ago•0 comments

Tip

https://vivaldi.com/blog/tips/tip-830/
1•nahidai•35m ago•0 comments

Go Pop quiz: what time was it?

https://dave.cheney.net/2025/12/18/pop-quiz-what-time-was-it
1•kristianp•39m ago•0 comments

Einstein's relativity rules chemical bonds in heavy elements, new research shows

https://www.brown.edu/news/2026-07-09/chemical-bonds-relativity
12•hhs•41m ago•6 comments

China recovered its first reusable rocket and showed a new way to do it

https://arstechnica.com/space/2026/07/china-recovered-its-first-reusable-rocket-and-showed-a-new-...
2•sohkamyung•42m ago•0 comments

It's Now Imperative That You Copy That Floppy

https://hackaday.com/2026/07/07/its-now-imperative-that-you-copy-that-floppy/
1•rbanffy•43m ago•0 comments

OmFest Interest Form

https://docs.google.com/forms/d/e/1FAIpQLScyY9c5MowPFW6BmIitqaaF3T-ykM_d8eD2pq2XqwSt7N50zg/viewform
1•mooreds•46m ago•0 comments

Old Icons – All This

https://leancrew.com/all-this/2026/07/old-icons/
1•rbanffy•46m ago•0 comments

Neobrutalism Layouts

https://www.neobrutalism.dev/
1•modinfo•48m ago•0 comments