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

Hot Chips 2026: Fujitsu's Monaka CPU – By Chester Lam

https://chipsandcheese.com/p/hot-chips-2026-fujitsus-monaka-cpu
1•rbanffy•12s ago•0 comments

Bluefin – The Next Generation Linux Workstation

https://projectbluefin.io/
1•janandonly•1m ago•0 comments

Trump tried to curb clean energy. It's booming anyway

https://arstechnica.com/science/2026/08/trump-tried-to-curb-clean-energy-its-booming-anyway/
1•rbanffy•1m ago•0 comments

Moonshot in talks with Microsoft, Amazon, Google over K3 inference revenue share

https://www.reuters.com/business/retail-consumer/chinas-moonshot-talks-with-microsoft-amazon-goog...
1•garo-pro•2m ago•0 comments

The Math That Predicts Almost Anything: Markov Chains [video]

https://www.youtube.com/watch?v=KZeIEiBrT_w
2•binyu•2m ago•0 comments

Show HN: A daily word game where you cut a sentence to five of its words

https://sheets.works/long-story-short
1•lordbubbles•9m ago•0 comments

Kids Are Okay

https://anatomists.substack.com/p/the-kids-are-okay
1•tosh•9m ago•0 comments

Why I use this paid search engine (Uruky)

https://crazysteve.bearblog.dev/uruky-is-a-pretty-great-search-engine/
1•expedited123•10m ago•0 comments

The Shape of Go

https://luislsousa.com/blog/the-shape-of-go/
2•darccio•12m ago•0 comments

Pi: The Minimalist, Self-Modifying Coding Agent [video]

https://www.youtube.com/watch?v=RKHaecOi0CA
1•vismit2000•14m ago•0 comments

Atlantropa

https://en.wikipedia.org/wiki/Atlantropa
1•theanonymousone•15m ago•0 comments

Anatomy of a Scam Call: What 10k real scam calls reveal about phone scammers

https://arxiv.org/abs/2608.24127
1•sbulaev•15m ago•0 comments

Beyond Recall and the Illusion of Competence

https://var0.xyz/posts/beyond-recall-and-the-illusion-of-competence.html
3•tuxie_•15m ago•0 comments

Z.ai confirms Ox Alpha is a new GLM-series model and will release its weights

https://www.bloomberg.com/news/articles/2026-08-26/china-s-z-ai-made-ox-alpha-stealth-model-that-...
2•garo-pro•17m ago•1 comments

Nobody Wants Artisanal Code Anymore

https://gordonbeeming.com/blog/2026-04-29/nobody-wants-artisanal-code-anymore
1•Bluestein•18m ago•0 comments

Trump Sends Nuclear Agreement with Saudi Arabia to Congress

https://www.wsj.com/world/middle-east/trump-sends-nuclear-agreement-with-saudi-arabia-to-congress...
1•JumpCrisscross•19m ago•0 comments

Years Late, Billions over Budget: CA's High-Speed Rail Hasn't Laid a Track

https://www.wsj.com/us-news/years-late-billions-over-budget-californias-high-speed-rail-hasnt-lai...
1•JumpCrisscross•21m ago•0 comments

Show HN: Firmament is the Limit – a one-button iPhone flight game

https://apps.apple.com/us/app/firmament-is-the-limit/id6755933878
1•BanzaiTokyo•22m ago•1 comments

EBRAINS provides open science data, tools and services

https://ebrains.eu/data-tools-services
2•Bluestein•23m ago•0 comments

Dataset: AI agent security failures, 1000 incidents classified

https://huggingface.co/datasets/gemmozero/ai-agent-security-incidents
2•LegionAPI•25m ago•0 comments

Ask HN: What's your biggest regret in life?

1•chistev•26m ago•1 comments

AutoRouter – Enterprise AI gateway for every model

https://autorouter.top/
1•autorouter1•29m ago•0 comments

Arduino Ventuno Q

https://www.arduino.cc/product-ventuno-q/
1•mchan•30m ago•0 comments

Show HN: StoreMock, a free, in-browser tool to create app store screenshots

https://www.storemock.com
1•sxnb•31m ago•0 comments

Junie [JetBrains] Can Now Run on Your Mac

https://blog.jetbrains.com/junie/2026/08/junie-local-launch/
1•zkvl•31m ago•1 comments

Shingles vaccine linked to lower risk of heart attack and stroke, study finds

https://www.theguardian.com/science/2026/aug/26/shingles-vaccine-lower-risk-heart-attack-stroke-s...
1•pseudolus•32m ago•0 comments

China's Z.AI made Ox Alpha stealth model that rivals DeepSeek

https://www.theedgesingapore.com/news/artificial-intelligence/chinas-zai-made-ox-alpha-stealth-mo...
3•doppp•34m ago•1 comments

Is DeepSeek-V4-Flash Overtaking American AI Models?

https://mrkt30.com/deepseek-v4-flash-overtaking-american-ai-models/
1•newsaiyc•35m ago•0 comments

Nvidia's $200B 'balance sheet-as-a-service'

https://www.ft.com/content/9a6947bf-9d4e-4489-80b9-2178ea657a67
2•JumpCrisscross•36m ago•0 comments

Fourteen months micromanaging AI coding agents

https://allende.nz/notes/fourteen-months-micromanaging-ai-coding-agents/
1•robertoallende•39m ago•0 comments