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

I Gave ChatGPT a Body [video]

https://www.youtube.com/watch?v=S67z2aekBrI
1•gmays•48s ago•0 comments

The Measured Listener

https://lareviewofbooks.org/article/music-algorithm-spotify-eugenics-measure-talent-raymond-cattell/
1•cainxinth•1m ago•0 comments

Amusing Numerology: How Base-5 Domain Numbers Reveal a Single Hidden Campaign

https://www.infoblox.com/blog/security/amusing-numerology-analysis-of-the-numbers-in-domain-names/
1•speckx•2m ago•0 comments

TCS and Anthropic partner to bring Claude to regulated industries

https://www.anthropic.com/news/tcs-anthropic-partnership
1•surprisetalk•4m ago•0 comments

Most Beautiful Will Ever Made (1936)

https://paperspast.natlib.govt.nz/newspapers/DOM19360307.2.43
1•cf100clunk•4m ago•0 comments

Fail loudly: a plea to stop hiding bugs

https://alejo.ch/3gk
1•afc•5m ago•0 comments

Elon Musk becomes first trillionaire as SpaceX shares soar

https://www.bbc.com/news/live/czj8dd0kyl7t
2•bazzmt•5m ago•0 comments

Prompting Claude Fable 5

https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5
1•mfiguiere•6m ago•0 comments

Donor Scraper for Fairfax Cryobank

https://github.com/tgys/cryobankscraper
1•autocatt•8m ago•0 comments

The Lorem Ipsum Mystery [video]

https://www.youtube.com/watch?v=kL1PDqzqhM4
1•dsr12•8m ago•0 comments

China's Deadly "Bubble Face" Disaster [video][14 Mins]

https://www.youtube.com/watch?v=yMk1OSSAW28
1•Bender•8m ago•0 comments

UK to ban under-16s from 'high risk' social media apps

https://www.theguardian.com/uk-news/2026/jun/12/uk-to-ban-under-16s-from-high-risk-social-media-apps
1•kefabean•10m ago•0 comments

Ask HN: Why is the term forward deployed engineer (FDE) popular all of a sudden?

2•palidanx•13m ago•3 comments

Are Americans Too Old?

https://www.newyorker.com/culture/open-questions/are-americans-too-old
1•littlexsparkee•13m ago•2 comments

New GreatXML Exploit Bypasses Windows BitLocker via Recovery Partition XML Files

https://github.com/MSNightmare/GreatXML
2•uukelele•14m ago•0 comments

SealedKeys – Zero-knowledge team password manager with post-quantum crypto

https://sealedkeys.com
1•michaelgartlan•14m ago•0 comments

Shares in Elon Musk's SpaceX surge after biggest IPO

https://www.reuters.com/world/us/live-elon-musks-spacex-set-stock-market-trading-after-worlds-big...
2•layer8•14m ago•0 comments

Ten Years of Having a Personal Website

https://blog.greenpants.net/ten-years-of-personal-websites-from-student-to-senior/
2•Greenpants•15m ago•0 comments

System Call Stack Alignment

https://www.humprog.org/~stephen/blog/2026/06/12/#system-calling-alignment
2•matt_d•19m ago•0 comments

Run local agentic AI on the Mac using MLX (WWDC 2026) [video]

https://developer.apple.com/videos/play/wwdc2026/232/
2•sebiw•20m ago•0 comments

Joan Didion: Staking Out California (1979)

https://www.nytimes.com/1979/06/10/books/didion-calif.html
1•jxmorris12•21m ago•0 comments

Four ways AI is making your life more expensive

https://www.washingtonpost.com/technology/2026/06/06/inflation-is-being-driven-up-by-huge-investm...
1•1vuio0pswjnm7•22m ago•0 comments

No updates on Cryptome since June 2025?

https://cryptome.org/
3•joering2•24m ago•4 comments

Factorio: Flip, Flow, and Fresh Paint

https://factorio.com/blog/post/fff-442
1•ibobev•25m ago•0 comments

I Am Not a Reverse Centaur

https://blog.miguelgrinberg.com/post/i-am-not-a-reverse-centaur
5•ibobev•26m ago•0 comments

"Don't You Just Upload It to ChatGPT?"

https://correresmidestino.com/dont-you-just-upload-it-to-chatgpt/
12•speckx•26m ago•5 comments

Tesla Full Self Driving uses bicycle lane in official Denmark approval video

https://politiken.dk/danmark/forbrug/biler/art10875514/Allerede-12-sekunder-inde-i-PR-videoen-beg...
16•Veserv•29m ago•3 comments

Judge Punishes 4 Lawyers After Catching Both Sides Using A.I. In Lawsuit

https://www.nytimes.com/2026/06/09/us/ai-lawyers-sanctioned-mississippi.html
4•thm•29m ago•0 comments

Great Reshuffling of the Agentic Era: The 6 Career Archetypes

https://aidoses.substack.com/p/great-reshuffling-of-the-agentic
1•ryanrad•29m ago•0 comments

Treating pancreatic tumours may have revealed cancer's master switch

https://www.economist.com/science-and-technology/2026/06/12/treating-pancreatic-tumours-may-have-...
2•rndsignals•30m ago•0 comments