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

Another run at 'More ETFs than stocks in US', and new ones are more expensive

https://plvch.github.io/indexes_cost/
2•plvch•2m ago•0 comments

Show HN: A command-line story machine inspired by Roald Dahl's 1953 short story

https://github.com/skorotkiewicz/grammatizator
1•modinfo•2m ago•0 comments

SlimTide Review: Is Slim Tide Safe for Weight Loss?

https://finance.yahoo.com/sectors/healthcare/articles/slimtide-capsules-updated-warning-2026-1921...
1•haumnary•3m ago•0 comments

Neovim Plugin for Blazingjj

https://opencommit.eu/sejo/blazingjj.nvim
2•sejo•12m ago•1 comments

Valve will stop selling Steam gift cards at retailers over scam concerns

https://www.pcgamer.com/gaming-industry/valve-will-stop-selling-steam-gift-cards-at-retailers-ove...
3•josephcsible•24m ago•0 comments

Just me feeling that Mythos/Fabel just 1% there?

1•punnerud•24m ago•0 comments

Validation, Docs, tests, and database schemas from one source of truth

https://github.com/justhamade/triadjs
1•justhamade•27m ago•1 comments

Humans ask, computers propose, humans decide

https://jakemccrary.com/blog/2020/11/14/speeding-up-magit/
2•signa11•29m ago•0 comments

"Trust Us" Is Not a Control Surface: Anthropic and the Case for Open Weights

https://trust-us.vercel.app
1•tonydavis•30m ago•0 comments

Smartphones Broke British Politics

https://www.politico.eu/article/keir-starmer-uk-prime-minister-resignation-brexit-whatsapp-westmi...
2•giuliomagnifico•31m ago•0 comments

Canada introduces legislation to ban social media for children under 16

https://www.reuters.com/legal/litigation/canada-introduces-legislation-ban-social-media-children-...
3•thm•37m ago•0 comments

Allegro

https://liballeg.org/
1•tosh•40m ago•0 comments

Ask HN: What internal tool did you build that became a product?

2•nehpets•41m ago•1 comments

CopenPay returns and Copenhagen now rewards tourists who arrive by train

https://www.denmarklifestyledaily.com/article/812071964-copenpay-returns-3-times-bigger-copenhage...
1•slu•44m ago•0 comments

The dispute over what caused Air India flight 171 to crash

https://www.bbc.com/news/articles/cwyk9exxp2qo
2•1659447091•45m ago•0 comments

OpenAI mulls slashing prices as it competes with Anthropic for users

https://www.cnbc.com/2026/06/11/openai-mulls-slashing-prices-ahead-of-competition-from-anthropic-...
31•agentifysh•46m ago•22 comments

Show HN: I built a Red Flag Warning zone-check tool for the East Bay in 48h

https://redflag-check.info
2•vedant28t•46m ago•0 comments

Show HN: Vaportrail – flight recorder for Claude Code, Codex, and OpenCode

https://github.com/B33BMO/vaportrail
2•b33bmo•47m ago•1 comments

Tesla robotaxis stall as Musk's self-driving hype hits real-world traffic

https://www.latimes.com/business/story/2026-06-10/tesla-robotaxis-stall-as-musks-self-driving-hyp...
3•1vuio0pswjnm7•48m ago•0 comments

YouTube terms of service allow AI music training, Google says

https://www.billboard.com/pro/google-youtube-terms-of-service-ai-music-training-lawsuit/
1•sdoering•49m ago•1 comments

Feds move to formally allow sports "trading" on prediction markets

https://www.axios.com/2026/06/10/cftc-prediction-markets-sports-event-contract-rules
1•1vuio0pswjnm7•55m ago•0 comments

Nearly Everyone, Everywhere, Veers Left When Walking

https://www.nytimes.com/2026/06/10/science/humans-walking-veer-left-counterclockwise.html
4•bryanrasmussen•56m ago•2 comments

Agentic Frameworks

https://astledsa.substack.com/p/agentic-frameworks
1•astledsa•58m ago•0 comments

Adafruit files suit against Flux.ai over legal threats [pdf]

https://storage.courtlistener.com/recap/gov.uscourts.cand.471648/gov.uscourts.cand.471648.1.0.pdf
4•russdill•1h ago•2 comments

TokenPulse – Live token and rate limit tracker for Claude and ChatGPT

https://chromewebstore.google.com/detail/tokenpulse-—-chatgpt-clau/oimclhdbljodjkankcnalklchfce...
1•Anoop69_•1h ago•0 comments

TikTok

https://tiktok-guahdfjhshrk.com
1•DARKNNESSANKC•1h ago•0 comments

Grit by GitButler: A from-scratch reimplementation of Git in idiomatic Rust

https://github.com/gitbutlerapp/grit
2•maxloh•1h ago•0 comments

It blocked us at 'hello ' Anthropic Fable 5 refusing innocuous prompts

https://www.theregister.com/ai-and-ml/2026/06/10/anthropic-claude-fable-5-refuses-innocuous-promp...
10•abliterationai•1h ago•1 comments

I built a tool that reads code and lists features with file:line refs

https://www.verifiablyai.com/projects/requests
1•arvvind•1h ago•0 comments

Join-Calculus

https://en.wikipedia.org/wiki/Join-calculus
1•tosh•1h ago•0 comments