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

The Neurosurgery Resident Who Proved Crouzeix's Conjecture [pdf]

https://alextownsend.net/essays/SIAMNews_CrouzeixConjecture.pdf
1•magoghm•51s ago•0 comments

YC startups are abandoning .com

https://www.orangecrumbs.com/stories/yc-domains
1•oyster143•2m ago•0 comments

How do you keep PM tools in sync with what happens in WhatsApp/Slack?

1•Harish_0089•2m ago•0 comments

Ohio Senator says Ohio Congressman abused his daughter and granddaughter

https://www.cnn.com/2026/08/06/politics/bernie-moreno-daughter-max-miller
1•Fellw•3m ago•0 comments

How can I perform a Copy­File in unbuffered mode?

https://devblogs.microsoft.com/oldnewthing/20260810-00/?p=112600
1•ibobev•3m ago•0 comments

The little-known winstart.bat batch file

https://devblogs.microsoft.com/oldnewthing/20260811-00/?p=112605
1•ibobev•3m ago•0 comments

Oh Lord, AI Reporters Are Breaking Big News

https://www.wired.com/story/ai-newsrooms-are-breaking-news-now-haha-im-in-danger/
1•pimienta•4m ago•0 comments

In 1962, Egypt's Missile Program Lost Its Key Scientist Without a Trace

https://www.popularmechanics.com/military/a73358518/nazi-rocket-scientist-disappearance/
1•bookofjoe•4m ago•1 comments

Fly in Your Web Browser

https://www.geo-fs.com/
1•hakkikonu•5m ago•0 comments

Show HN: Insect species in 3D, generated from code (no model files)

https://insect-world.pages.dev/en/
1•XR843•6m ago•0 comments

The Digital Asylum

https://www.bitchute.com/video/X0PQCKy2aofa/
1•untiledsource•8m ago•0 comments

Show HN: MintPDF – HTML/Markdown to PDF API with an MCP Server

https://mintpdf.dev
1•Stackedboost•9m ago•0 comments

Show HN: 3D-printed marble-maze-blind-box solved by tilt and sound [video]

https://www.youtube.com/shorts/6cTblV2nCsU
1•belforn•10m ago•1 comments

AI was supposed to destroy jobs. Where's the carnage?

https://www.theguardian.com/technology/2026/aug/12/ai-job-destruction
2•pseudolus•11m ago•0 comments

From Grid Generator to Shape the Pixel

https://hugodaniel.com/posts/from-gridgenerator-to-shape-the-pixel/
1•ibobev•11m ago•0 comments

I built a personal AI agent in Swift on top of what macOS ships

https://github.com/ivan-magda/swift-claw
1•strong-self•12m ago•0 comments

Apple Executive in Charge of Pay and Wallet Services Is Leaving

https://www.bloomberg.com/news/articles/2026-08-11/apple-executive-in-charge-of-apple-pay-and-wal...
2•mgh2•12m ago•0 comments

SIMO Educación 2026: A Practical Exhibitor Guide EdTech Companies Ifema Madrid

https://adamexpostand.substack.com/p/simo-educacion-2026-a-practical-exhibitor
1•AdamExpoStand•14m ago•0 comments

The Bullshit Detector

https://www.bitchute.com/video/bWdZhGIKH97b/
1•untiledsource•15m ago•0 comments

Flock is just the latest example of using surveillance to stalk women

https://19thnews.org/2026/08/flock-surveillance-technology-women-abuse/
1•cdrnsf•16m ago•0 comments

Coin-Sized Device Can Hack a Boeing 737

https://www.wired.com/story/this-coin-sized-device-can-hack-a-boeing-737/
1•pimienta•16m ago•0 comments

It's been a revelation: how heat pumps can cool your home as temperatures soar

https://www.theguardian.com/environment/2026/aug/12/heat-pumps-cool-home-heatwave-hot-weather
1•rustoo•17m ago•0 comments

After WWII, Mutton Fell Out of Favor in the U.S. Can It Make a Comeback?

https://www.npr.org/sections/thesalt/2019/11/26/781652195/after-wwii-mutton-fell-out-of-favor-in-...
1•thunderbong•18m ago•0 comments

Local police departments prepare to deploy autonomous surveillance drones

https://truthout.org/articles/first-came-the-flock-cameras-now-local-cops-want-autonomous-drones/
1•iamnothere•20m ago•0 comments

Free NASA e-Books [pdf]

https://www.nasa.gov/ebooks/
1•NKosmatos•20m ago•0 comments

.new links are shortcuts to actions on the websites

https://whats.new/
1•Error6571•21m ago•0 comments

Tracking extreme heat by the hour makes climate change seem worse

https://arstechnica.com/science/2026/08/tracking-extreme-heat-by-the-hour-makes-climate-change-se...
1•rbanffy•22m ago•0 comments

The fastest double-to-string algorithm you've never heard of

https://vitaut.net/posts/2026/yy-dtoa/
2•signa11•22m ago•0 comments

Why I Play Board Games (and So Should You)

https://brainbaking.com/post/2026/08/why-i-play-board-games/
2•ingve•22m ago•0 comments

Show HN: Eigshow Interactive Web App

https://eigshow-app.web.app/
2•cecinuga•23m ago•0 comments