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

BYD's flagship electric SUV won an anti-motion-sickness certification

https://electrek.co/2026/06/30/byds-flagship-electric-suv-wins-anti-motion-sickness-certification/
1•dabinat•1m ago•0 comments

I need some inspiration for Diploma

3•sky_flower•3m ago•1 comments

Scaling PgBouncer across every core with SO_REUSEPORT and peering

https://clickhouse.com/blog/pgbouncer-clickhouse-managed-postgres
1•cauchyk•4m ago•0 comments

The 'Father of the Internet' is finally retiring

https://techcrunch.com/2026/06/30/the-father-of-the-internet-is-finally-retiring/
2•Brajeshwar•5m ago•0 comments

Statistical Picture of Quantum Mechanics

https://scottlocklin.wordpress.com/2026/06/27/statistical-picture-of-quantum-mechanics/
1•surprisetalk•6m ago•0 comments

GPT-5.6 cheats so much its testers couldn't measure it

https://www.transformernews.ai/p/openai-gpt-56-sol-cheating-scheming-metr
3•shakeelhashim•7m ago•1 comments

Show HN: A simulation of a hybrid pulse-position and duration modulation concept

https://github.com/Morphsec88/vse-compute-over-storage
1•Morphsec88•8m ago•0 comments

Show HN: Do you want a semantic cache for free with zero code changes?

https://github.com/GuglielmoCerri/khazad
1•guglielmoce•10m ago•0 comments

Meta loses bid to dismiss US states' claims that FB, Instagram addict children

https://www.reuters.com/legal/government/meta-loses-bid-dismiss-us-states-claims-that-facebook-in...
2•tartoran•10m ago•0 comments

How To Read Something: The book is a block of wood

https://chillphysicsenjoyer.substack.com/p/how-to-read-something
1•crescit_eundo•13m ago•1 comments

We Can Pay for College Just Changed. What Borrowers Need to Know

https://www.wsj.com/personal-finance/student-loans-repayment-deadline-8bbc06e4
1•JumpCrisscross•13m ago•0 comments

The worst API ever made (2014)

https://caseymuratori.com/blog_0025
1•KomoD•14m ago•0 comments

Wallpaper Engine: Removal of Application Wallpapers from the Workshop

https://store.steampowered.com/news/app/431960/view/699894448411116924
1•haunter•14m ago•0 comments

We're Making an Open Source American Kei Truck [video]

https://www.youtube.com/watch?v=tlZlyp55dww
1•abetusk•15m ago•1 comments

AOL Owner to Go Public at over $18B Valuation

https://www.wsj.com/finance/stocks/aol-owner-to-go-public-at-over-18-billion-valuation-d00f302c
1•JumpCrisscross•15m ago•0 comments

HamsterOS jams a 32-bit GUI operating system in a single 1.44 MB floppy disk

https://www.tomshardware.com/video-games/retro-gaming/hamsteros-jams-a-32-bit-gui-operating-syste...
2•LorenDB•16m ago•0 comments

Ozone depletion began decades before discovery of ozone hole

https://news.mit.edu/2026/scientists-find-ozone-depletion-began-decades-before-ozone-hole-discove...
1•gmays•16m ago•0 comments

What's holding up the rollout of persistent domain validation for ACME?

https://www.turbolightsolutions.com/posts/dns-persist-01-rollout-blocked-by-security-issue/
2•keydown•18m ago•0 comments

The Origin of Tweet (2013)

https://furbo.org/2013/06/28/the-origin-of-tweet/
1•downbad_•19m ago•0 comments

More Americans Are Installing Residential Battery Storage

https://www.bloomberg.com/news/articles/2026-07-01/us-home-battery-installations-boosted-by-state...
1•toomuchtodo•19m ago•1 comments

Kim Dotcom Loses Court of Appeal Bid to Block Extradition to the U.S.

https://torrentfreak.com/kim-dotcom-loses-court-of-appeal-bid-to-block-extradition-to-the-u-s/
4•Brajeshwar•19m ago•1 comments

Optimization tales with CockroachDB: the slow logout

https://gaultier.github.io/blog/optimization-tales-cockroachdb-part2-slow-logout.html
1•broken_broken_•20m ago•0 comments

In Praise of Observational Evidence

https://asteriskmag.com/issues/14/in-praise-of-observational-evidence
1•fi-le•21m ago•0 comments

A small island in Estonia negotiated special rights

https://news.err.ee/1610067196/ruhnu-residents-sought-to-join-sweden-after-estonia-regained-indep...
1•NalNezumi•21m ago•0 comments

Why changing your productivity system is good

https://birchtree.me/blog/why-changing-your-productivity-system-is-good-actually/
1•surprisetalk•21m ago•0 comments

How We Made IPFS Content Publishing 10x Faster

https://probelab.io/blog/optimistic-provide/
3•dennis-tra•21m ago•0 comments

AI-native workflows have a moat problem

https://ai.gopubby.com/ai-native-workflows-have-a-moat-problem-49992bcc3088
1•oddish-tv•22m ago•0 comments

Show HN: LiveComment "Who Is Hiring?" Plugin

1•ellis0n•22m ago•0 comments

The Annotated Triple Product Property Matrix Multiplication Algorithm

https://leetarxiv.substack.com/p/triple-product-property-matrix-multiplication
1•theanonymousone•23m ago•0 comments

Who Thrives Using AI

https://www.theatlantic.com/ideas/2026/06/ai-open-ai-anthropic/687689/
1•sanj•23m ago•0 comments