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

Phaistos Disc

https://en.wikipedia.org/wiki/Phaistos_Disc
1•hypertexthero•3m ago•0 comments

Git rebase -I is not that scary

https://cachebag.sh/journal/interactive-rebasing/
1•vinhnx•4m ago•0 comments

Everything Is a File

https://en.wikipedia.org/wiki/Everything_is_a_file
1•iacguy•5m ago•0 comments

Systems and Delays

https://martin.janiczek.cz/2026/07/24/systems-and-delays.html
1•vinhnx•5m ago•0 comments

Inflect-Micro-v2: complete voice in 9.36M parameters

https://huggingface.co/owensong/Inflect-Micro-v2
1•nateb2022•6m ago•0 comments

Zig by Example

https://zigbyexample.neocities.org/
1•vinhnx•6m ago•0 comments

Open-Weight Déjà Vu

https://peteridah.substack.com/p/open-weight-deja-vu
1•peteridah•8m ago•0 comments

SEC acquiring AI agents to monitor phone locations, social media, credit headers

https://jackpoulson.substack.com/p/securities-and-exchange-commission
1•iamnothere•10m ago•0 comments

PGSync adds semantic search without data leaving your infrastructure

https://pgsync.com/pro/
1•toluaina•11m ago•0 comments

George Hotz talk at AMD Advancing AI 2026 [video]

https://www.youtube.com/watch?v=QyrQeeDZUG4
2•chrsw•22m ago•0 comments

GNU Hurd gets 9pfs, OpenNTPD, dynamic /dev/ entries, and more

https://www.osnews.com/story/145603/the-hurd-gets-9pfs-openntpd-dynamic-dev-entries-and-more/
14•iamnothere•23m ago•2 comments

Personal AI Assistant, Anywhere

https://www.heysolin.com/
1•GreenKeewi•25m ago•0 comments

The real mathematics is the one that we dream – David Bessis

https://davidbessis.substack.com/p/the-real-mathematics-is-the-one-that
2•lioeters•32m ago•0 comments

Silicon Valley Splits over Closing the Borders to Chinese A.I

https://www.nytimes.com/2026/07/25/technology/open-source-silicon-valley-china.html
5•dkobia•33m ago•1 comments

Nepo – the largest database of nepotism and nepo babies

https://www.nepodb.com/
3•poppypetalmask•40m ago•1 comments

Triton: DirectX 11 driver for QEMU

https://blog.getutm.app/2026/introducing-triton-directx-11-driver-for-qemu/
1•generichuman•40m ago•0 comments

Show HN: Houhou – Resilience Policies Package for TypeScript Async Functions

https://hou2.vercel.app/
1•smokeeaasd•42m ago•0 comments

Stinkpot: SQLite-Backed Shell History

https://tangled.org/oppi.li/stinkpot
2•birdculture•46m ago•0 comments

Claude Usage Public Leaderboard

https://www.claudeusage.com/leaderboard
1•bazarkua•48m ago•0 comments

How the World Cup impacted global health?

https://ouraring.com/blog/2026-world-cup-data-story/
1•jenthoven•48m ago•0 comments

Books can't piss me off

3•emerongi•51m ago•2 comments

Should you use AI for a task? Here's a simple way to decide

https://www.theguardian.com/commentisfree/2026/jul/24/should-you-use-ai
2•flopsamjetsam•55m ago•2 comments

Brazil denies visas to U.S. officials who aimed to impugn electoral system

https://www.washingtonpost.com/world/2026/07/24/us-sending-envoys-question-brazilian-electoral-sy...
4•matheusmoreira•1h ago•2 comments

Dht-spy – BitTorrent DHT telemetry

https://dhtspy.net/
2•ogurechny•1h ago•1 comments

Show HN: Desktui – a remote desktop client for your terminal

https://github.com/mishushakov/desktui
4•ushakov•1h ago•0 comments

DeepSeek pause fundraise after comments on compute gap to US leaked (transcript) [pdf]

https://github.com/demo-zexuan/liang-wenfeng-investor-meeting-2026-7-22/blob/master/%E6%A2%81%E6%...
19•oliculipolicula•1h ago•5 comments

Htmx 4: The Game

https://swag.htmx.org/products/htmx-4-the-game
3•geophph•1h ago•0 comments

Show HN: Routeveil – Shared-element and page transitions engine for React Router

https://www.routeveil.dev/lab/shared-elements
2•milkeviich•1h ago•0 comments

The Assumption of Maria (near future sci-fi)

https://www.lightspeedmagazine.com/fiction/the-assumption-of-maria/
5•swernli•1h ago•0 comments

The Dundee Time Capsule

https://www.greatwardundee.com/the-home-front/the-dundee-time-capsule/
1•xg15•1h ago•0 comments