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

Russia bans diesel exports after Ukrainian attacks, straining global market

https://www.cnn.com/2026/07/09/business/russia-diesel-ban-ukrainian-strikes-intl
1•breve•2m ago•0 comments

What Happens When the Public Record Shrinks

https://www.theatlantic.com/newsletters/2026/07/trump-administration-public-record-data-holes/687...
1•paulpauper•3m ago•0 comments

Childhood and Education #20: Phones and Screens

https://thezvi.substack.com/p/childhood-and-education-20-phones
1•paulpauper•5m ago•0 comments

AI #176 Part 1: Doing It Live

https://thezvi.substack.com/p/ai-176-part-1-doing-it-live
1•paulpauper•6m ago•0 comments

Show HN: Fortress – Give your agents unlimited access to the web

4•armanluthra_•9m ago•0 comments

Ambient Website Background Clouds

https://github.com/paradise-runner/background-clouds
1•dividedcomet•16m ago•0 comments

I Made a JavaScript Obfuscater

https://potassiumv1.netlify.app/
1•ImOnHere•19m ago•0 comments

Command and Conquer: Red Alert Mac/Android/iOS ported using Codex

https://github.com/dk8827/ra-port
1•bananaboy•21m ago•1 comments

UST is bringing Claude to physical AI

https://www.anthropic.com/news/ust-claude
1•surprisetalk•21m ago•0 comments

China's giant Gobi solar plant runs after dark on salt, not batteries

https://electrek.co/2026/07/09/china-hami-solar-molten-salt-storage/
1•Bender•22m ago•0 comments

LibreOffice 26.8 Beta Released for Improving This Free Software Office Suite

https://www.phoronix.com/news/LibreOffice-26.8-Beta-1
2•Bender•23m ago•1 comments

Linux Prepares for New USB-C Security Feature on Lenovo ThinkPads

https://www.phoronix.com/news/ThinkPad-USB-C-Restricted-Mode
2•Bender•23m ago•0 comments

Phone on Feminism

https://conversationalist.org/2019/09/13/feminism-explains-our-toxic-relationships-with-our-smart...
3•cratermoon•23m ago•0 comments

Karl Sims – Liquid Selves (1992)

https://www.karlsims.com/liquid-selves.html
1•connorboyle•25m ago•0 comments

Focus

https://boz.com/articles/focus
3•iacguy•26m ago•0 comments

Building an AI legal companion for domestic and sexual violence survivors

https://apps.apple.com/us/app/lea-by-legali-ai/id6759547127?see-all=reviews&platform=iphone
1•irawati_puteri•34m ago•1 comments

Volkswagen to Slash Half Its Models as Sales Fall

https://www.nytimes.com/2026/07/09/business/volkswagen-china-sales.html
3•bookofjoe•34m ago•1 comments

Stack Rankings: A Comprehensive Guide

https://www.thehumancapitalhub.com/articles/stacked-rankings-a-comprehensive-guide
1•akkartik•37m ago•0 comments

Can A.I. Keep a Parent Alive?

https://www.newyorker.com/news/as-told-to/can-ai-keep-a-parent-alive
1•petethomas•41m ago•0 comments

Study: "Mommy, do you love your phone more than me?"

https://www.frontiersin.org/journals/psychology/articles/10.3389/fpsyg.2026.1766665/full
2•hbcondo714•46m ago•0 comments

Show HN: I built a free app for New Yorkers to save money on groceries

https://sbnyc.app/
7•eli_yumnik•49m ago•1 comments

Fraym – AI that creates product demo videos for you

https://tryfraym.com
1•jrud•49m ago•0 comments

Just shipped rate limiting for hypersonic.js

https://github.com/hypersonic-js/hypersonic-js
1•joaquim_d•50m ago•1 comments

What will define Elon Musk's legacy? DOGE cuts to USAID Ebola programs

https://www.theguardian.com/technology/2026/jul/07/elon-musk-doge-cuts-usaid-ebola
6•tastyface•51m ago•3 comments

We cannot wait for better post-quantum signature algorithms

https://blog.cloudflare.com/ml-dsa-will-have-to-do/
3•mappu•55m ago•0 comments

Cleveland Fed's Hammack says AI could fuel inflation, rate hikes may be needed

https://www.cnbc.com/2026/06/30/cleveland-fed-president-hammack-sees-ai-fueling-inflation-says-ra...
3•mapping365•56m 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•compiler-guy•59m ago•0 comments

Surgeons face higher infertility rates. UC may make it even harder to have kids

https://sfstandard.com/2026/07/09/ucsf-surgical-residents-fertility-benefits-occupational-hazard/
3•littlexsparkee•1h ago•1 comments

Warsh picks ex-BoE chief Mervyn King and tech boss Marc Andreessen to reform Fed

https://www.ft.com/content/e45a34e0-cd96-4b72-9ff3-380efc28a705
1•JumpCrisscross•1h ago•0 comments

Ukraine: How a kamikaze drone partially AI operated is attacking Russian convoys

https://www.france24.com/en/europe/20260601-ukraine-kamikaze-drone-partially-operated-ai-attackin...
2•rawgabbit•1h ago•0 comments