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

Anthropic Changed the Sonnet 5 Chart After It Made Sonnet Look Bad

https://www.vincentschmalbach.com/anthropic-changed-sonnet-5-chart-after-it-made-sonnet-look-bad/
1•vincent_s•36s ago•0 comments

AOL and Eventbrite owner Bending Spoons soars 40% on Nasdaq debut

https://www.ft.com/content/aebe2dbb-6d8b-4b3d-82c8-e64aebd4ef70
1•bookofjoe•1m ago•1 comments

OpenAI proposes 5% stake to Trump administration to ease Washington pressure

https://www.cnbc.com/2026/07/02/openai-proposes-us-government-own-5percent-stake-to-address-polit...
1•BafS•3m ago•0 comments

Roosevelt Would Not Understand the E.U.'S Antitrust Fine Against Google (2017)

https://www.newyorker.com/business/adam-davidson/teddy-roosevelt-wouldnt-understand-the-eus-antit...
1•Tomte•4m ago•0 comments

Enabling the use of digital verification services for alcohol age checks in Eng

https://enablingdigitalidentity.blog.gov.uk/2026/06/30/enabling-the-use-of-digital-verification-s...
1•kaelyx•8m ago•1 comments

Ratatui without OS, directly in UEFI

https://github.com/sermuns/ratatuefi
1•sermuns•13m ago•0 comments

Show HN: ScoreMarket – A digital sheet music marketplace

https://www.scoremarket.co.uk
1•anthonydaly•14m ago•0 comments

OpenCode Is Down

2•defly•15m ago•2 comments

A return to two-pizza culture

https://www.allthingsdistributed.com/2026/06/return-to-two-pizza-culture.html
1•ingve•18m ago•0 comments

The Anthropic Fable Ban Is Over. The Battle over How to Tame AI Has Just Begun

https://www.wsj.com/tech/ai/the-anthropic-fable-ban-is-over-the-battle-over-how-to-tame-ai-has-ju...
2•cebert•19m ago•2 comments

Artificial Adventures

https://www.scattered-thoughts.net/writing/artificial-adventures/
2•noelwelsh•19m ago•0 comments

When your software systems don't talk to each other

https://laurieyoung.co.uk/articles/when-your-software-doesnt-talk/
1•Wildfalcon•20m ago•0 comments

Utrecht's fish doorbell closes for the season after 12M views

https://nltimes.nl/2026/07/02/utrechts-fish-doorbell-closes-season-12-million-views
1•TechTechTech•20m ago•0 comments

Trainety – a marketplace for AI project publishers and providers

https://www.trainety.com/
1•xuxurimu•24m ago•0 comments

"Learning to Replicate Expert Judgment in Financial Tasks" – Thinking Machines

https://thinkingmachines.ai/news/learning-to-replicate-expert-judgment-in-financial-tasks/
1•upmind•25m ago•0 comments

Show HN: A YouTube transcript API that survives YouTube's bot war

https://ytranscript.com/developers
1•nopxuan•25m ago•0 comments

'Titan is actually a very reasonable destination for humans'

https://www.space.com/astronomy/saturn/titan-is-actually-a-very-reasonable-destination-for-humans...
1•bookofjoe•26m ago•0 comments

Why I'm Forced to Say Farewell: Google Management Has Lost Its Moral Compass

https://docs.google.com/document/d/1SH9QRTAlL02THgAN2AGmWe9El0_2ZJF6hhgDBx8k97c/edit?tab=t.0
6•vrganj•26m ago•1 comments

Help Test Bahriya – A New Distributed Container Cloud

https://bahriya.cloud
1•meezaan•27m ago•1 comments

What I've Learned from Hacker News (2009)

https://paulgraham.com/hackernews.html
1•adletbalzhanov•28m ago•0 comments

OpenAI in talks to give Trump administration a 5% stake in the company

https://www.cnn.com/2026/07/02/business/openai-trump-stake-intl
2•chirau•28m ago•1 comments

How Datadog measure data completeness at scale

https://www.datadoghq.com/blog/engineering/data-pipeline-completeness/
1•eywek•30m ago•0 comments

Kim Dotcom's legal battle to stay in NZ and avoid extradition to the US

https://www.rnz.co.nz/news/crime-and-justice/652867/kim-dotcom-s-legal-battle-to-stay-in-nz-and-a...
3•Tomte•31m ago•0 comments

The cloud has an address. And that address can burn

https://appedus.com/the-cloud-has-an-address-and-that-address-can-burn/
1•Fisher_L•31m ago•0 comments

Show HN: SophMate – AI Copilot for WordPress/WooCommerce

https://sophmate.ai
1•ahmed_duski•33m ago•0 comments

The cannibalistic trade-off: Why human cannibalism emerges

https://www.pnas.org/doi/10.1073/pnas.2605120123
2•Tomte•35m ago•1 comments

Omarchy Impersonated at Omarchy[.]Net

https://github.com/basecamp/omarchy/discussions/6160
1•arusekk•40m ago•1 comments

Ancient grain shows early lab promise against a key Alzheimer's protein

https://sciencex.com/news/2026-07-ancient-grain-early-lab-key.html
3•pseudolus•42m ago•0 comments

Prototyping medial axis implementation for area routing

https://www.openstreetmap.org/user/Paco%20Albacete%20Chicano/diary/408990
2•altilunium•43m ago•0 comments

AI Is Getting Dumber. That's Not a Good Thing. [video]

https://www.youtube.com/watch?v=vXHPRQTwrr4
2•unfocso•46m ago•0 comments