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

What you can build with TypeSafe AI Jev

https://vercel.com/i/jev-use-cases
1•flashbrew•3m ago•0 comments

Deploy Drunk

https://korshakov.com/posts/deploy-drunk
1•denysvitali•5m ago•0 comments

Genesis – The Bible verse that far-right Americans misinterpret to defend Israel

https://www.trtworld.com/article/5081f8ade0cf
2•timeoperator•5m ago•0 comments

Keep Using Your Intel Mac in 2025?

https://aslihan.live/posts/why-intel-mac-in2025/
2•aslihana•8m ago•2 comments

Perpetual underdog AMD nips at Nvidia's heels as it joins the $1T club

https://www.theregister.com/systems/2026/09/21/perpetual-underdog-amd-nips-at-nvidias-heels-as-it...
3•mdp2021•10m ago•0 comments

Can gzip be a language model?

https://nathan.rs/posts/gzip-lm/
1•networked•11m ago•0 comments

Daily Geography Adventures

https://maptap.gg/
1•yitchelle•13m ago•0 comments

Mirror Node Reconnaissance

https://sgaillabs.com
1•sgaillabs•16m ago•0 comments

How AI Creates a Capability Mirage

https://sloanreview.mit.edu/article/how-ai-creates-a-capability-mirage/
1•ventana•17m ago•1 comments

PyTorch Written in C

https://github.com/thevoxium/bare-lm
1•docuru•17m ago•0 comments

Maki, the efficient coder

https://maki.sh/
1•abc42•18m ago•1 comments

Orchestrat

https://orchestrat.dev
1•armanghev•21m ago•0 comments

A TypeScript Server Just Outran Rust's Hyper

https://geastack.com/blog-typescript-server-outran-hyper
1•k3030•24m ago•0 comments

Rust code faster than SOTA libraries by asking agents to make the code faster

https://minimaxir.com/2026/09/agentic-iteration/
2•sdoering•28m ago•0 comments

Pedagogy in the Times of AI [video]

https://www.youtube.com/watch?v=N2a1J0UPeL4
1•tarunvelli•28m ago•0 comments

Firmware Freedom

https://playtaurus.com/blog/firmware-freedom
6•arbayi•31m ago•1 comments

Lex Friedman Brings Back Strategery

https://daringfireball.net/linked/2026/09/21/strategery-friedman
1•Tomte•34m ago•0 comments

How HN: ScribeToAny – Free Audio and Video to Text Transcription

https://scribetoany.com/
1•hypercube67•36m ago•0 comments

Flomo: A two-person notes app from China that bought a product from ByteDance

https://www.sinosphere.app/p/flomo-two-people-one-text-box-and
1•Nyloc1•40m ago•0 comments

Why AI resembles a charismatic religious leader

https://theconversation.com/why-ai-resembles-a-charismatic-religious-leader-291831
6•billybuckwheat•41m ago•1 comments

I made ByeBlocked: hide blocked users

https://github.com/8ug8ird/ByeBlocked
1•8ug8irdchoom•42m ago•0 comments

EveryCli: Natural-language CLI assistant that runs 100% locally (Rust and ONNX)

https://github.com/HE11032006/EveryCli
2•Euloge•44m ago•0 comments

Apple Music to open concert venue in Battersea Power Station

https://www.bbc.com/news/articles/c607l2j2rj8ro
25•dabinat•47m ago•5 comments

Hacking a BYD [video]

https://www.youtube.com/watch?v=_TZFcyzGEiY
2•testrun•47m ago•1 comments

Live-Cell Imaging and the Limits of Structural Biology – Eric Betzig [video]

https://www.youtube.com/watch?v=RUB37QhWNkw
1•pillars•50m ago•0 comments

Microsoft, Google took down $66M marketplace selling VMs with pirated software

https://www.techradar.com/pro/security/microsoft-google-took-down-usd66-million-cybercrime-market...
2•theanonymousone•51m ago•0 comments

Agent Disco at the Edge

https://edgedisco.com/
1•nickjam•51m ago•0 comments

The secret Cold War bioweapons test that exposed millions in the Bay Area

https://www.sfgate.com/bayarea/article/cold-war-bioweapons-test-22425855.php
3•bcaulfield•52m ago•0 comments

Apache Fory JSON: High-Performance JSON Serialization for Kotlin

https://fory.apache.org/blog/fory_kotlin_json/
2•chaokunyang•53m ago•1 comments

Using Apache Fory JSON with Spring MVC, WebFlux, and Spring Boot

https://fory.apache.org/blog/fory_json_spring/
1•chaokunyang•54m ago•0 comments