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

AI and the Fall of Writing

1•Flundstrom2•3m ago•0 comments

Taliban Declares War on Smartphones

https://www.npr.org/2026/07/10/g-s1-132396/smartphones-taliban-afghanistan-ban
1•paulpauper•4m ago•0 comments

FCC Approves Test of Space Mirror to Light Night Sky Despite Outcry

https://www.nytimes.com/2026/07/10/climate/fcc-space-mirror.html
1•paulpauper•4m ago•0 comments

From A.I. To the Deep State, Michel Foucault Foresaw It All

https://www.nytimes.com/2026/07/10/books/review/michel-foucault-ai-tech-power.html
1•paulpauper•5m ago•0 comments

Ask HN: Recommended technographic API?

1•Poomba•6m ago•0 comments

Can We Understand How Large Language Models Reason?

https://cacm.acm.org/news/can-we-understand-how-large-language-models-reason/
2•adunk•7m ago•0 comments

MaFrida v0.3.0 Is Out

https://github.com/theShinigami/MaFrida
1•shiroChef•9m ago•0 comments

Dead Process Mate – a menu-bar app to kill leftover Node/dev processes

https://github.com/BartosK97/dead-process-mate
1•bartosk97•9m ago•0 comments

Claude Code get 50% more weekly limit

https://support.claude.com/en/articles/15910845-claude-code-may-july-2026-weekly-limits-promotion
4•alvis•10m ago•0 comments

Cosmic is quietly doing things GNOME and KDE still make you fight for

https://www.xda-developers.com/cosmic-hit-version-1-2-quietly-doing-things-gnome-kde-still-make-y...
3•naves•13m ago•0 comments

Show HN: Scramble Quest

https://scramblequest.app/
1•furyofantares•13m ago•0 comments

Teardown: A Generic 7-Port USB 3.0 Hub That Wasn't

https://goughlui.com/2026/07/09/teardown-a-generic-7-port-usb-3-0-hub-that-wasnt/
1•speckx•13m ago•0 comments

I Put My Son in a Swamp

https://thepotato.tech/posts/i-put-my-son-in-a-swamp/
1•nickstinemates•19m ago•0 comments

The WiFi Certificate That Didn't Exist an Hour Ago

https://thepotato.tech/posts/the-wifi-cert-that-didnt-exist-an-hour-ago/
1•nickstinemates•19m ago•0 comments

The Most Famous AI Writing Tic Is Also the Most Mysterious

https://www.theatlantic.com/technology/2026/07/ai-chatbot-writing-tic-negative-parallelism/687892/
1•tekdude•22m ago•0 comments

Apple's M6, M7 and M8 Chips Show How AI Is Reshaping the Company

https://www.bloomberg.com/news/newsletters/2026-07-12/apple-s-chip-plans-m6-m7-pro-m7-max-m7-ultr...
1•newusertoday•22m ago•0 comments

Against Usefulness

https://www.motivenotes.ai/p/against-usefulness
6•supo•24m ago•0 comments

Soulless – List of AI Artists Hiding on Spotify

https://soullessmusic.com/
1•ChrisArchitect•24m ago•0 comments

Show HN: Block dangerous Git and shell commands from being executed by agents

https://github.com/Dicklesworthstone/destructive_command_guard
1•adithyaharish•25m ago•0 comments

Dictation and Meeting App Sends to Apple Notes – Free and Local Models

https://voice.baselinemakes.com/
1•stevenhubertron•25m ago•1 comments

W11 Copilot tells you what's slowing down your PC, while using 1GB RAM itself

https://www.windowslatest.com/2026/07/12/windows-11-copilot-ai-can-now-tell-you-whats-slowing-dow...
2•speckx•25m ago•0 comments

Programming thought experiment: stuck in a room with a PC without an OS

https://old.reddit.com/r/programming/comments/9x15g/comment/c0ewj2c/
1•Tomte•29m ago•0 comments

AI-Powered Multi Tenant Platform

https://svoxx.com/int/en
1•kilincarslan•33m ago•0 comments

Rustnet: Per-process network monitoring with deep packet inspectio

https://github.com/domcyrus/rustnet
1•thunderbong•34m ago•0 comments

Claude Fable 5 access extended through July 19

https://xcancel.com/claudeai/status/2076351399999557669#m
5•Topfi•35m ago•1 comments

Show HN: Free AI travel destination search across Asia

https://asianexpats.com
1•developeron29•37m ago•0 comments

Restarting Germany's Reactors: Viability and Outlook [pdf]

https://www.radiantenergygroup.com/_files/ugd/ae75b7_bc5db590cf5a4ac6a4a0d6812a58ada6.pdf
1•throw0101d•39m ago•2 comments

The Four "Ions", or How to Provision CIAM Users (2023)

https://ciamweekly.substack.com/p/the-four-ions-or-how-to-provision
1•mooreds•39m ago•0 comments

Local-first image annotation–try it in the browser, no signup, nothing uploaded

https://thevision.works/demo
2•Wiseye•42m ago•0 comments

Show HN: SayItDev LLM and Speech capabilities with 0 dependencies and no models

https://github.com/innovatorved/sayitdev
3•innovatorved•42m ago•0 comments