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

Inadequate Equilibria

https://equilibriabook.com/inadequacy-and-modesty/
1•Bluestein•25s ago•0 comments

Why every AI model tells Japanese voters to vote for the Communist Party

https://twitter.com/MTSlive/status/2085842125464457722
1•tosh•37s ago•0 comments

Amazon Built a Data Center in a California Town Without Anyone Noticing

https://www.wsj.com/us-news/how-amazon-built-a-data-center-in-a-california-town-without-anyone-no...
1•speckx•2m ago•0 comments

2008 vs. 2026: The Same Dominoes Are Falling [video]

https://www.youtube.com/watch?v=Zgbzdk-eqJ0
1•xbmcuser•2m ago•0 comments

Prompt Privacy from LLMs

https://snwagh.com/blog/2026/stained-glass-transform/
2•napping_penguin•2m ago•1 comments

Developer ported Word for Windows 1.1a from 1990 to run natively on Windows 11

https://www.neowin.net/news/developer-ported-word-for-windows-11a-from-1990-to-run-natively-on-wi...
1•01-_-•3m ago•0 comments

An AI-powered iOS app for real-time fencing analysis (tracking/skeletons)

https://apps.apple.com/us/app/fencingvision-ai-coach/id6794765462
2•vortex5566•4m ago•0 comments

AI alignment is a red herring

https://interconnected.org/home/2026/08/08/alignment
2•peteforde•4m ago•0 comments

Show HN: TchoAI – Transform your documents into editable slide decks

https://tcho.ai/en
2•dyfang•9m ago•0 comments

Claude but It's Good at Misinformation

https://fauxthropic.com/
2•doomeacc•9m ago•0 comments

Offline AI Search Engine

https://www.wazzup.im
2•wazzup_im•11m ago•0 comments

Poll: Does the browser think you speak Chinese, but you do not?

2•Bender•12m ago•0 comments

What Happened: OpenAI and HuggingFace

https://thezvi.substack.com/p/what-happened-openai-and-huggingface
2•yurivish•14m ago•0 comments

Replai – smarter online form tooling

https://go-replai.com
2•eduardoVel•16m ago•1 comments

How AI Layoffs Can Trigger an Economic Spiral

https://bytepith.com/article/how-ai-layoffs-trigger-economic-spiral
2•khanhnguyen8386•16m ago•0 comments

Claude TV

https://vibetv.shop/
2•yitchelle•17m ago•0 comments

A tool to quickly step through and audit LLM-generated Python codebases

https://github.com/arnoldpredator/pyreplay
2•arnoldpredator•18m ago•1 comments

The chew toy that ate my small business

https://unherd.com/2026/08/the-chew-toy-that-ate-my-small-business/
3•speerer•20m ago•0 comments

HTML Day 2026

https://2026.html.energy/
3•hendersonreed•20m ago•0 comments

DARPA Lift Challenge – Aug 8 – Main Broadcast [livestream] [video]

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

Reducing Graphics API Complexity: A Clean Slate Design for Modern GPUs [video]

https://www.youtube.com/watch?v=aQv9pUl9PBM
2•mellinoe•23m ago•0 comments

The Price Tag

https://thehickmanletter.substack.com/p/the-price-tag
1•mooreds•25m ago•0 comments

US "Freedom Tech Excellence Program" Uses Palantir to Oppose Surveillance

https://www.state.gov/current-partnerships-global-partnerships-unit/
3•gumby•25m ago•0 comments

Show HN: captain-miao – herding coding agents in your terminal (kitty/zellij)

https://github.com/hyperlogue/captain-miao
1•rickye26•26m ago•0 comments

Video Has 0 Comments

https://www.youtube.com/watch?v=r6uSlQTEcZM
1•viralparmarme•26m ago•0 comments

Show HN: Geotop – Real-time terminal network monitor with map visualization

https://github.com/ozkanpakdil/geotop
1•ozkanpakdil•28m ago•1 comments

My Personal Software Journey: Self-Hosting Agent-Built Apps on a Mac Mini

https://metedata.substack.com/p/016-my-personal-software-journey
1•young_mete•29m ago•0 comments

Wireblast a 100 Gbps packet generator in Go using AF_XDP

https://toonk.io/index.html
2•bgpdude•30m ago•0 comments

OpenAI Astra: A Paradigm Shift from Answers to Assignments

https://medium.com/predict/openai-astra-a-paradigm-shift-from-answers-to-assignments-bdce13f10037
1•timventura•32m ago•0 comments

Fastmail offers EU data region

https://www.fastmail.com/blog/fastmail-offers-eu-data-region/
3•groomlake•32m ago•0 comments