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

IRGC Claims It Destroyed Amazon's Bahrain Data Center

https://houseofsaud.com/irgc-claims-destroyed-amazon-bahrain-data-center/
1•thisislife2•2m ago•0 comments

Show HN: Transept: AI translation workspace that puts humans first

https://transept.ai
2•sithamet•2m ago•0 comments

Prebuilt, parameterized, interactive HTML widgets for MCP Apps

https://github.com/Techthos/gadget
1•alex20465•4m ago•0 comments

The Codex App Lied to Me About /Clear

https://samwize.com/2026/07/24/codex-app-lied-to-me-about-clear/
1•ingve•5m ago•0 comments

I'm So Tired of "Is This AI?"

https://www.trend-mill.com/p/im-so-tired-of-is-this-ai
2•moomoy•10m ago•0 comments

Show HN: A static, client-side tarot calculator for Brazilian Portuguese

https://meuarcanopessoal.net/
3•visiohex•14m ago•0 comments

Show HN: Maplike – Rust traits for operations on containers (get, set, push...)

https://github.com/mikwielgus/maplike
2•mikolajw•15m ago•0 comments

BookWyrm is a social network for tracking and sharing your reading

https://github.com/bookwyrm-social/bookwyrm
2•protomolecool•17m ago•0 comments

Image Resizer

https://img-resizer.github.io/
2•javatuts•18m ago•0 comments

Shape Up: Stop Running in Circles and Ship Work that Matters [pdf]

https://basecamp.com/shapeup/shape-up.pdf
2•saikatsg•20m ago•0 comments

Brief Observations on Life

http://unfuck.i.ng/art/science/life/
2•singingfish•21m ago•1 comments

Flux 3 X Mimic: The Next Generation of Video-Action Models

https://bfl.ai/blog/flux-3-mimic
8•kensai•23m ago•0 comments

Towards a Theory of Bugs: The Ruliology of the Unexpected

https://writings.stephenwolfram.com/2026/07/towards-a-theory-of-bugs-the-ruliology-of-the-unexpec...
2•nsoonhui•24m ago•0 comments

Future euro banknote design proposals

https://www.ecb.europa.eu/euro/banknotes/future_banknotes/html/design-proposals.en.html
14•robin_reala•25m ago•2 comments

Buz – A fork of Bun using modern Zig, with sub-1s incremental builds

https://ziggit.dev/t/buz-a-drop-in-replacement-for-bun-using-modern-zig-with-sub-1s-incremental-b...
3•kristoff_it•28m ago•0 comments

Stories from Tomorrow. Ministry of Defense (2023)

https://www.gov.uk/government/publications/stories-from-the-future-exploring-new-technology-throu...
2•AFF87•29m ago•0 comments

Hetzner is working on LLM Inference

https://sliplane.io/blog/hetzner-inference
6•jonas_scholz•30m ago•0 comments

Stable Diffusion in the Browser with WebNN and ONNX Runtime

https://scribbler.live/2026/04/02/Stable-Diffusion-in-the-Browser-with-WebNN-ONNX.html
2•gopisuvanam•30m ago•0 comments

BYD Launches the Denza Z9 GT EV in Europe and the UK at over 3X the Price

https://electrek.co/2026/07/23/byd-launches-denza-z9-gt-ev-europe-the-uk-3x-price/
4•ksec•35m ago•0 comments

PDF Reader – PDF Viewer

https://play.google.com/store/apps/details?id=com.pdfreader.pdfviewer.editor.officereader&hl=en_US
2•satyampromotion•40m ago•1 comments

Trump says nearly 200 firms signed pledge to protect from costs of datacenters

https://www.theguardian.com/us-news/2026/jul/23/trump-datacenter-costs-big-tech
3•beardyw•41m ago•1 comments

The government of India wants bitchat taken down

https://twitter.com/jack/status/2080565084586135773
3•temphnaccount•42m ago•1 comments

Grok muscles into Excel with an AI add-in of its own

https://www.theregister.com/ai-and-ml/2026/07/22/grok-muscles-into-excel-with-an-ai-add-in-of-its...
2•beardyw•45m ago•0 comments

Apertus 1.5

https://apertus-ai.org/articles/2026-07-apertus-1-5/
2•denysvitali•45m ago•0 comments

Nothing works and everyone is euphoric

https://ptrchm.com/posts/nothing-works-and-everyone-is-euphoric/
10•pchm•46m ago•2 comments

The day Steve Jobs dissed me in a keynote (2010)

https://sive.rs/itunes
20•downbad_•47m ago•1 comments

Building pi in a World of Slop [video]

https://www.youtube.com/watch?v=RjfbvDXpFls
2•ciconia•51m ago•0 comments

RTK and Claude Code Token Savings: A Closer Look

https://blog.jetbrains.com/ai/2026/07/rtk-claude-code-token-savings/
4•OyoKooN•53m ago•0 comments

Google Cloud is killing it

https://www.theregister.com/paas-and-iaas/2026/07/22/google-cloud-is-killing-it/5276632
4•beardyw•54m ago•0 comments

Go 1.26 and Dead Goroutines: a walkthrough of the goroutineleak profile

https://medium.com/towardsdev/the-goroutines-that-refuse-to-die-and-how-go-1-26-finally-made-them...
3•cheikhdev•54m ago•0 comments