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

Apple's Vision Pro Tool Contains Traces of Defunct Game Engine 'The Machinery'

https://www.macrumors.com/2026/06/23/apple-reality-composer-pro-the-machinery/
1•bananaboy•4m ago•0 comments

AI that builds and runs your business, 24/7

https://www.leapd.ai
2•Cyrus2050•7m ago•3 comments

Xiaomi Opens a 38B World Model Built to Generate Robot Data

https://topicqueue.substack.com/p/xiaomi-opens-a-38b-world-model-built
2•DISCURSIVE•10m ago•0 comments

Scouting Uncertainty: adding value to soccer (football) data scouting results

https://marclamberts.medium.com/scouting-uncertainty-adding-value-to-data-scouting-results-f68d8c...
2•sebg•16m ago•0 comments

The Self-Driving Company

https://twitter.com/amasad/status/2077802290304684404
2•bilsbie•18m ago•0 comments

Why Not HP Printers (2019)

https://productrevue.ca/index.php/2019/04/23/why-not-hp-printers/
2•thisislife2•20m ago•0 comments

Cyberattack at Nichirei leads to food shortages at eateries, stores

https://www.asahi.com/ajw/articles/16731347
3•rawgabbit•22m ago•0 comments

AI Data Centers and the Concentration of Wealth

https://www.schneier.com/blog/archives/2026/07/ai-data-centers-and-the-concentration-of-wealth.html
4•birdculture•29m ago•0 comments

Can AI make honest mistakes?

https://twitter.com/thsottiaux/status/2077630111499882637
3•throwaway2027•32m ago•1 comments

The Rise and Fall of a Tech Company

https://amrshawky.com/posts/rise-and-fall/
4•amr_shawky•35m ago•0 comments

AegisDB – self-hosted memory for AI agents, in one C binary

https://github.com/d4n-larsson/aegisdb
2•d4n-larsson•36m ago•0 comments

Trends That Defined AI Engineering at Fair 2026

https://www.latent.space/p/aiewf26trends
2•gmays•38m ago•0 comments

Mortality (Book)

https://en.wikipedia.org/wiki/Mortality_(book)
3•chistev•39m ago•1 comments

Show HN: Deadly Dispatch – A physics puzzle game 13 years in the making

https://store.steampowered.com/app/4890070/Deadly_Dispatch/
1•BernardGatt•39m ago•0 comments

What Is a Smith Chart?

https://www.arenaphysica.com/publications/smith-charts
5•sebg•41m ago•0 comments

SecretSpec 0.15: Provider Credentials, Azure Key Vault / Gopass, and PHP SDK

https://secretspec.dev/blog/secretspec-0-15-provider-credentials-azure-key-vault-gopass-and-php-sdk/
2•domenkozar•45m ago•0 comments

Kalshi says it caught Trump's teleprompter operator insider trading

https://www.theverge.com/news/966676/trump-teleprompter-operator-kalshi-bets-mention-markets-inve...
8•sbulaev•45m ago•1 comments

Red Dead Redemption 2, Dominoes, and Motorcycles

https://brettfisher.dev/posts/rdr2-dominoes-motorcycles/
2•fisher-brett•46m ago•0 comments

Kimi K3 beats GPT 5.6 Sol in agentic knowledge work

https://artificialanalysis.ai/evaluations/aa-briefcase#results-tabs
2•declanjackson•50m ago•0 comments

Find Your Good Sources of Dopamine

https://nik.art/find-your-good-sources-of-dopamine/
3•herbertl•51m ago•0 comments

Latent Thought Flows with Text Compression

https://latent-thought-flows.vercel.app/
2•sebg•52m ago•0 comments

GitHub API Outage

https://www.githubstatus.com/incidents/gxycch3076xk
18•jfirebaugh•53m ago•0 comments

SpaceX Starship Flight 13 scrubbed

https://x.com/i/broadcasts/1MKgNNXAZdmxL
7•elinear•54m ago•2 comments

Show HN: Ferritin, a new front end for Rust docs, built on rustdoc JSON

https://ferritin.rs
2•jbr•55m ago•0 comments

InfiniWolf: A Procedural Map Generator for Wolf3d

https://github.com/voidnullvalue/InfiniWolf
2•voidnullvalue•56m ago•0 comments

Chrome is prototyping HTML client-side includes

2•dfabulich•57m ago•0 comments

Show HN: Moltshit.com – An Imageboard for AI Agents

https://moltshit.com
2•jetbalsa•58m ago•0 comments

He Mined 300 Bitcoin, Then Sold the Computer for $200 [video]

https://www.youtube.com/watch?v=XHeMsXDyw2A
2•pierres7•58m ago•0 comments

The Work of Helping A.I. Destroy Work

https://www.nytimes.com/2026/07/10/business/ai-white-collar-jobs.html
4•reaperducer•1h ago•1 comments

We Stopped Selling to Humans

https://www.trybluemagma.com/blog/we-stopped-selling-to-humans-to-beat-vanta
2•ajouffray•1h ago•0 comments