frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•8mo 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•8mo 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•8mo 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).

Trump says US used secret weapon to disable Venezuelan equipment in Maduro raid

https://apnews.com/article/trump-venezuela-weapon-maduro-drug-strikes-c052fd24a350a04a458f501b4b5...
1•colinprince•1m ago•0 comments

The Politics of Struggling Americans

https://www.gojiberries.io/the-politics-of-struggling-americans/
1•neehao•3m ago•0 comments

A Poem That Behaves Like a Machine

https://medium.com/@darwingosal/a-poem-that-behaves-like-a-machine-737fce2791f4
1•CharlesW•4m ago•0 comments

Environmentalists worry Google behind bid to control Oregon town's water

https://www.sfgate.com/national-parks/article/mount-hood-water-google-21307223.php
1•voxadam•7m ago•0 comments

Gemini team, please add URL query parameter support (?q= or?prompt=)

1•hiddenest•14m ago•0 comments

A New Hardware Class of 2026

https://www.recordsofthought.com/signal-to-source
1•colinprince•15m ago•0 comments

The Atelier: Craft, Code, and the Coming Guild

https://jamesmunsch.com/words/2026-01-18-the-atelier--craft--code--and-the-coming-guild.html
1•b1n•16m ago•1 comments

Show HN: WhyThere – Compare cities side-by-side to decide where to move

https://whythere.life
1•daversa•16m ago•0 comments

We built an AI coding tool that stores nothing on our servers

https://shakespeare.diy
3•ravenbitcoin•19m ago•2 comments

Central Banks Hit Next Stage in Cross-Border Payment Project

https://www.pymnts.com/news/cross-border-commerce/cross-border-payments/2026/central-banks-hit-ne...
1•shorsher•23m ago•0 comments

NukeCast: If it happened today, where would the fallout go

https://nukecast.com/
1•todd_tracerlab•26m ago•1 comments

Loki Mode: Autonomous System for Claude, Codex and Gemini CLI

https://github.com/asklokesh/loki-mode
1•slogansand•27m ago•2 comments

Don't Wait Until the Midterms. Act Now: FeedbackFridays

10•peerless-app•27m ago•0 comments

Windows 11's Patch Tuesday nightmare: Microsoft says some PCs might not boot

https://www.windowscentral.com/microsoft/windows-11/windows-11s-botched-patch-tuesday-update-nigh...
2•speckx•35m ago•0 comments

It Was One Guy

https://dannyman.toldme.com/2026/01/26/it-was-one-guy/
2•saulpw•38m ago•0 comments

The pandemic's hidden toll: chronic conditions left undiagnosed

https://medicalxpress.com/news/2026-01-pandemic-hidden-toll-millions-chronic.html
1•WaitWaitWha•39m ago•0 comments

Japan Bond Crash Unleashes a $7T Risk for Global Markets

https://www.bloomberg.com/news/features/2026-01-25/japan-bond-market-crash-raises-alarm-for-globa...
2•zerosizedweasle•40m ago•0 comments

Doghot369

https://doghot.app/
1•jdojsinfn•43m ago•0 comments

Tech CEOs attend Amazon-funded "Melania" screening at White House

https://www.hollywoodreporter.com/movies/movie-news/white-house-vip-melania-screening-mike-tyson-...
20•camillomiller•43m ago•11 comments

Preparing Investigators for Trauma Exposure in Digital Forensics

https://www.forensicfocus.com/podcast/preparing-investigators-for-trauma-exposure-in-digital-fore...
1•WaitWaitWha•44m ago•0 comments

ChatGPT Is Pulling Answers from Elon Musk's Grokipedia

https://techputs.com/chatgpt-pulling-answers-from-grokipedia/
1•voxadam•47m ago•0 comments

Werewolf Romance 101: quick trope map and what to watch for

1•XiayMu•55m ago•0 comments

Ted Chiang and What it is like to be an A.I

https://jonathantdneil.substack.com/p/ted-chiang-and-what-it-is-like-to
1•hkhn•1h ago•0 comments

Yarbo autonomous snow blower clearing driveway during storm

https://twitter.com/tommolog/status/2015450792065376656
1•ChrisArchitect•1h ago•0 comments

Compiled Node.js 18 from source on jailbroken iPhone to run Claude Code

1•BryanTheCynic•1h ago•0 comments

Exhalation by Ted Chiang

https://www.lightspeedmagazine.com/fiction/exhalation/
2•hkhn•1h ago•1 comments

Demand Accountability. Impeach Trump. Again

https://www.impeachtrumpagain.org
7•hkhn•1h ago•0 comments

You can just port things to Cloudflare Workers

https://sigh.dev/posts/you-can-just-port-things-to-cloudflare-workers/
1•STRiDEX•1h ago•0 comments

SF Microclimates

https://microclimates.solofounders.com/
1•rmason•1h ago•0 comments

The Cathedral, the Bazaar and the Workshop

https://jamesmunsch.com/words/2026-01-18-the-atelier--craft--code--and-the-coming-guild.html#the-...
1•b1n•1h ago•2 comments