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

A return to two-pizza culture

https://www.allthingsdistributed.com/2026/06/return-to-two-pizza-culture.html
1•futurecat•2m ago•0 comments

Nsram: The Artificial Neuron on a Silicon Chip

https://spectrum.ieee.org/artificial-neurons-on-silicon-chips
1•rbanffy•6m ago•0 comments

Best AI Coding Token Plans in 2026: A Practical Comparison for Developers

https://medium.com/@VibeHacker/best-ai-coding-token-plans-in-2026-a-practical-comparison-for-deve...
1•Timmyzzz•6m ago•0 comments

Nano Banana 2 Lite

https://twitter.com/GoogleAIStudio/status/2071989578672595413
4•aurenvale•8m ago•0 comments

Reddit is going to force you to log in to use old Reddit

https://www.theverge.com/tech/959779/reddit-old-log-in
4•vrganj•11m ago•0 comments

Show HN: Abstractions – Weekly newsletters explaining your codebase

https://useabstractions.com
2•nshntarora•11m ago•0 comments

Show HN: Agentic Data Engineering

https://www.revos.ai/blog/agentic-data-engineering
2•zubairov•12m ago•0 comments

Register Korea's First PC 'SE-8001' as a National Important Material

https://www.dongascience.com/en/news/30374
3•mushstory•14m ago•0 comments

Panasonic launches CO₂ air-to-water heat pump with CoP of 6.1

https://www.pv-magazine.com/2026/06/29/panasonic-launches-co%e2%82%82-air-to-water-heat-pump-with...
2•flipbrad•14m ago•0 comments

Core dump epidemiology: fixing an 18-year-old bug

https://openai.com/index/core-dump-epidemiology-data-infrastructure-bug/
2•blerb795•16m ago•0 comments

Bird nests of fibre-optic cables show war's impact on Ukraine

https://www.reuters.com/business/aerospace-defense/bird-nests-fibre-optic-cables-show-wars-impact...
3•ZeljkoS•17m ago•0 comments

Splash Canvas

https://artsandculture.google.com/experiment/vQFCtQB7FDnYkA
2•reasonableklout•18m ago•0 comments

Puri.li private search with own index

https://puri.li
2•skillplayed•18m ago•0 comments

Claude Command Classifier: availability issues

2•oger•19m ago•0 comments

Show HN: A Wordle-style daily trading challenge

https://kandlequiz.trade/
2•ssarcandy•19m ago•0 comments

Big loads offgrid with a small battery (sidelined)

https://joeyh.name/blog/entry/big_loads_offgrid_with_a_small_battery_sidelined/
3•JNRowe•19m ago•0 comments

Show HN: ChDB-WASM – ClickHouse running in the browser via WebAssembly

https://wasm.chdb.io/
2•auxten•23m ago•0 comments

Murders and Executions: M&A in the games industry

https://www.owenmahoney.ai/owen-mahoney-blog/murders-and-executions
2•temp7000•29m ago•0 comments

Show HN: Erlangchain – A tiny Erlang client for LLMs

https://github.com/abhavk/erlangchain
2•Abhavk•29m ago•0 comments

Contributor Poker and Zig's AI Ban

https://kristoff.it/blog/contributor-poker-and-ai/
2•birdculture•31m ago•0 comments

Show HN: World Model MCP v0.10.0 – cross-runtime memory across 7 coding agents

https://github.com/SaravananJaichandar/world-model-mcp
2•saravanan2294•31m ago•0 comments

VirtRigaud – Manage and Migrate VMs Across VSphere, Proxmox and KVM

https://github.com/projectbeskar/virtrigaud
2•wrkode•34m ago•0 comments

I do not feel like a programmer anymore

https://blog.kulman.sk/i-do-not-feel-like-a-programmer-anymore/
7•ingve•39m ago•1 comments

Vera C. Rubin Observatory Begins Capturing the Greatest Cosmic Movie Ever Made

https://rubinobservatory.org/news/action-rubin-lsst-begins
3•robin_reala•41m ago•0 comments

Godot will no longer accept AI-authored code contributions

https://www.pcgamer.com/gaming-industry/open-source-game-engine-godot-will-no-longer-accept-ai-au...
17•pjmlp•43m ago•3 comments

How the 'Boss scam' is tricking Indian executives

https://theprint.in/india/a-whatsapp-message-from-your-ceo-rs-1-5-crore-gone-how-the-boss-scam-is...
2•rustoo•43m ago•0 comments

Email from Reddit for age verification on a deleted account

2•SurprisedTiger•45m ago•0 comments

It's not me, it's the compiler

https://parsa.wtf/cast/
3•SVI•45m ago•0 comments

Show HN: RouteVN – An application for making Visual Novels without any coding

https://routevn.com/
2•han4wluc•47m ago•0 comments

Supreme Court says constitution protects people's location data

https://www.eff.org/deeplinks/2026/06/victory-supreme-court-says-constitution-protects-peoples-lo...
5•fzeindl•48m ago•0 comments