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

An Interactive Map of AI

https://artifipedia.com/map
1•ceprompts•1m ago•0 comments

Crystal ML Library: Autograd, Tensors, Neural Networks, Optimizers

https://github.com/skuznetsov/cogni-ml
1•zX41ZdbW•3m ago•0 comments

My Throw Decides My Aim

https://thegustafson.com/blog/my-throw-decides-my-aim
1•usernotfoundrn•4m ago•0 comments

If you want to create a button from scratch, you must first create the universe

https://madcampos.dev/blog/2026/07/accessibility-from-scratch/
1•treve•6m ago•0 comments

AI slop movies are the new direct-to-video cash grabs

https://www.theverge.com/entertainment/965616/ash-koosha-odysseus-the-fall-foundtain-zero-tilly-n...
2•ent101•7m ago•0 comments

French parliament approves landmark assisted-dying bill

https://www.reuters.com/legal/litigation/french-parliament-votes-landmark-assisted-dying-bill-202...
3•JumpCrisscross•8m ago•0 comments

Codegraff: 40× leaner file tools for your coding agent

https://codegraff.com
2•doppp•16m ago•0 comments

Making 768 servers look like 1

https://planetscale.com/blog/making-768-servers-look-like-1
2•hisamafahri•18m ago•0 comments

Easy acceleration with distributed array on interactive AI supercomputer [video]

https://www.youtube.com/watch?v=rqmJk9aIJ6I
2•teleforce•21m ago•0 comments

Null Handling in SQLite

https://www.sqlite.org/nulls.html
2•rzk•21m ago•1 comments

Making the internet fun again: Stumble Upon v2

https://whip-feed.agam-92b.workers.dev/
2•samagra14•21m ago•0 comments

The Zen of Parallel Programming: The Big I and the Global Sum URL

https://smolnero.com/posts/the-zen-of-parallel-programming-the-big-i-and-the-global-sum
2•edgar_ortega•21m ago•0 comments

Glowing Pickle Demonstration

https://en.wikipedia.org/wiki/Glowing_pickle_demonstration
2•gregsadetsky•25m ago•0 comments

Show HN: Git-remote-iroh – Ephemeral P2P Git remote

https://github.com/magik6k/git-remote-iroh
2•devttyeu•26m ago•0 comments

Identifying JDK value class candidates

https://mail.openjdk.org/archives/list/core-libs-dev@openjdk.org/thread/Y72NRXM7KYBX43OKYBQMVKOZD...
2•Tomte•30m ago•0 comments

Guerrilla London Bus Ads Mock Kylie Jenner's Meta Glasses Campaign

https://hyperallergic.com/guerrilla-london-bus-ads-mock-kylie-jenners-meta-glasses-campaign/
9•decimalenough•31m ago•0 comments

Familiar – Local AI Workspace with Chat, Notes, Wiki, and Automations

https://github.com/sixvolts/familiar
2•six_volts•31m ago•0 comments

Inside Anthropic's state-by-state plan to ratchet up AI rules

https://www.politico.com/news/2026/07/15/inside-anthropics-state-by-state-plan-to-ratchet-up-ai-r...
3•bluepeter•34m ago•0 comments

RuntimeWire – Startup intelligence for the AI economy

https://runtimewire.com/
2•enjoyyourlife•38m ago•0 comments

A Manifesto for Preserving Content on the Web (2019)

https://jeffhuang.com/designed_to_last/
2•downbad_•40m ago•0 comments

Might doomscrolling cause our commitment muscles to atrophy?

https://chrisyeh.com/2026/07/commitment-is-declining-and-why-you-should-resist.html
3•chrisyeh•40m ago•1 comments

1,300 Beautiful Wildlife Illustrations from the 19th Century Now Restored

https://www.openculture.com/2026/07/explore-1300-beautiful-wildlife-illustrations-from-the-19th-c...
2•gslin•42m ago•0 comments

OpenAI and Guardian Media Group launch content partnership

https://openai.com/index/openai-and-guardian-media-group-launch-content-partnership/
2•wertyk•43m ago•0 comments

Linux kernel won't be anti-AI – Linus Torvalds

https://lore.kernel.org/all/CAHk-%3Dwi4zC%2BZe8e%2Bp3tMv8TtG_80KzsZ1syL9anBtmEh5Z40vg@mail.gmail....
6•haritha1313•43m ago•2 comments

I Collect Blog Statistics, Respectfully

https://onlinegoddess.net/2026/07/how-i-collect-blog-statistics-respectfully/
3•cyb0rg0•46m ago•1 comments

Roman Empire GDP per Capita Map Shows That Romans Poorer Than Countries Today

https://brilliantmaps.com/roman-empire-gdp/
2•mathattack•48m ago•0 comments

Sony-Owned Crunchyroll Is Now Kneecapping Physical Anime Sales

https://www.gamespot.com/articles/sony-owned-crunchyroll-is-now-kneecapping-physical-anime-sales/
2•jmsflknr•51m ago•0 comments

GitHub Copilot: your AI pair programmer (2021)

https://github.blog/news-insights/product-news/introducing-github-copilot-ai-pair-programmer/
2•kmlsec•51m ago•0 comments

Can AI build a jet engine? JARVIS Challenge tests AI copilots

https://news.mit.edu/2026/can-ai-build-jet-engine-jarvis-challenge-tests-ai-copilots-in-tough-tec...
3•ilamont•56m ago•0 comments

Open Source, Free Tier Capable Whispr Using Cloudflare AI

https://github.com/PrestigePvP/Voicebox
2•TreDub•57m ago•0 comments