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

What If It's Not the Phones?

https://www.theatlantic.com/technology/2026/07/phones-haidt-play-gray/687846/
1•voisin•9m ago•0 comments

RISCBoy is an open-source portable games console, designed from scratch

https://github.com/Wren6991/RISCBoy
2•mariuz•11m ago•0 comments

Rhode Island is regulating grocery checkout lines now

https://reason.com/2026/07/09/rhode-island-is-regulating-grocery-checkout-lines-now/
1•gmays•14m ago•0 comments

Never Built: Lockheed CL-1201

https://foundandexplained.com/2021/05/01/never-built-cl-1201/
1•yubblegum•14m ago•0 comments

Rubber ducking is a mirror that says nothing

https://pilgrima.ge/p/the-mirror-that-says-nothing
1•momentmaker•15m ago•0 comments

AI found a secret computer bug hidden for 15 years.

https://www.untempled.com/guilhermen/art/ai-found-a-secret-computer-bug-hidden-for-15-years-plus-...
1•glmnes•16m ago•0 comments

Gates Heir's Shopping App Claimed Sales It Didn't Drive

https://www.bloomberg.com/news/articles/2026-07-09/gates-heir-s-shopping-app-took-credit-for-sale...
2•imichael•22m ago•0 comments

Why 'com_maxfps 250x' uncaps Quake Live's frame rate

https://marco-nett.de/blog/why-com_maxfps-250x-uncaps-quake-lives-frame-rate/
1•hoechst•23m ago•0 comments

Two LLMs play live chess and rewrite their own brains after each game

https://aitradingcompetition.com/chess.html
1•chumzygood•25m ago•0 comments

Evilcharts

https://evilcharts.com/docs/sankey-chart/static
2•handfuloflight•25m ago•0 comments

Dez minutinhos set envolvente [video]

https://www.youtube.com/watch?v=mBFDmV0W_i4
1•gdss•28m ago•0 comments

Why we stopped using an automated SRE agent

https://blog.neatcontext.com/operations/2026/07/12/why-we-stopped-using-an-automated-sre-agent/
1•tanglearncode•29m ago•2 comments

Remembering Disney Legend Don Iwerks

https://thewaltdisneycompany.com/news/remembering-disney-legend-don-iwerks/
1•toomuchtodo•29m ago•1 comments

Cleanplanet

https://www.cleanplanet.co.jp/technology/
1•theendisney•33m ago•0 comments

Postgres Makes Transactions Atomic

https://brandur.org/postgres-atomicity
1•gurjeet•39m ago•0 comments

Bootstrapping a Post-Quantum Shadow Ledger via Op_return [pdf]

https://github.com/Blackcoin-Dev/Blackcoin/blob/main/doc/whitepaper-quantum-quasar.pdf
1•QQ_Blackcoin•39m ago•0 comments

530A Trump Accounts Guide

https://www.chase.com/personal/investments/learning-and-insights/article/trump-accounts-for-kids-...
2•firasd•40m ago•0 comments

Secret Claude tracker surprises users after Anthropic's anti-surveillance stance

https://www.theregister.com/ai-and-ml/2026/07/01/anthropic-is-removing-its-covert-code-for-catchi...
2•gnabgib•42m ago•0 comments

Screen Time extensions are Intermittent Reinforcement

https://agentzlerich.blogspot.com/2026/07/do-not-use-screen-time-extensions.html
1•RhysU•43m ago•0 comments

Agentic Memory Transparency

https://medium.com/@vektormemory/memory-transparency-why-vektor-slipstream-now-shows-you-exactly-...
1•vektormemory•46m ago•1 comments

Waymo called the cops on teen riders, raising privacy concerns

https://www.npr.org/2026/07/10/nx-s1-5886113/waymo-police-privacy-driverless-autonomous-vehicles
1•sxp•52m ago•2 comments

The Art of Asking Questions

https://asteriskmag.com/issues/04/the-art-of-asking-questions
1•andsoitis•55m ago•0 comments

Selling Abstraction

https://asteriskmag.com/issues/14/selling-abstraction
1•andsoitis•56m ago•0 comments

GPT 5.6 chart analysis tool

http://derac.org/gpt56charts/
1•derac•1h ago•1 comments

Persistent memory for Claude Code that survives context compaction

https://mentedb.com
1•mentedb•1h ago•0 comments

Show HN: BoundFlow – an open-source control plane for AI agents

https://github.com/boundflow/boundflow
1•alama24•1h ago•0 comments

Show HN: The Quiet Map – Earth's quietest place, measured by seismometers

https://thequietmap.org/
1•theceka•1h ago•0 comments

Where did my segfault go?

https://rmpr.xyz/Where-did-my-segfault-go/
2•RMPR•1h ago•0 comments

Blocking Distracting News Links

https://retout.co.uk/2026/07/10/blocking-distracting-news-links/
1•edward•1h ago•0 comments

Here's Why Some Humans Can Hear Super Low-Frequency Sounds

https://nautil.us/heres-why-some-humans-can-hear-super-low-frequency-sounds-1282626
2•Brajeshwar•1h ago•0 comments