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

A Great Rebalancing Is Coming

https://www.foreignaffairs.com/united-states/great-rebalancing-coming
1•toomuchtodo•42s ago•0 comments

I built a headless browser for AI agents in Rust. no Chromium, no V8

https://www.reddit.com/r/codex/comments/1w0trw7/i_built_a_headless_browser_for_ai_agents_entirely/
1•syumei•1m ago•0 comments

Claude Status – Degraded Performance for Claude Opus 5 and Claude Haiku 4.5

https://status.claude.com/incidents/hkcw95k7r0f4
1•kyisaiah47•2m ago•0 comments

Quanta.Ai.Code.Editor

https://github.com/ContegoCode/Quanta-Code-Editor
1•Quantaai•18m ago•3 comments

Show HN: NodeAkt – Zero-dependency distributed actor framework for TypeScript

https://tochemey.github.io/nodeakt/
2•Tochemey•25m ago•0 comments

Long March 6C rocket stage fragments in orbit, creating cloud of debris

https://spacenews.com/long-march-6c-rocket-stage-fragments-in-orbit-creating-cloud-of-debris/
3•bookmtn•26m ago•0 comments

Does the Sumerian King List Align with Paleoclimate Events?

https://www.vectorian.be/articles/2026-06-07/sumerian-king-list-paleoclimate-alignment-explorer/
7•dev_l1x_be•27m ago•1 comments

I spent years running prod-like homelabs. Here's what I learned about securing

https://www.amazon.ca/Homelab-Security-Blueprint-Building-Production-Grade-ebook/dp/B0GX2WLP51
1•sargetun•30m ago•0 comments

Does Computer Science Need Computers?

https://www.quantamagazine.org/does-computer-science-need-computers-20260828/
2•pykello•32m ago•0 comments

PPWR lands another blow to an precarious tabletop industry

https://www.rascal.news/ppwr-lands-another-blow-to-an-already-precarious-tabletop-industry/
2•healsdata•32m ago•0 comments

9th Circuit sides with states in Kalshi gambling fight

https://azmirror.com/2026/08/28/9th-circuit-sides-with-states-in-kalshi-gambling-fight-potentiall...
2•hungryhobbit•41m ago•1 comments

Anthropic Just Beat The Pentagon in Court

https://www.ibtimes.com/anthropic-just-beat-pentagon-court-judge-said-national-security-was-used-...
10•01-_-•42m ago•0 comments

Young adults under 21 traded $5B on Kalshi this year

https://www.cnn.com/2026/08/28/business/young-adults-trading-kalshi
4•01-_-•44m ago•2 comments

Steps Towards an Ecology of the Internet

https://anil.recoil.org/slides/2025-internet-ecology.html
1•luispa•44m ago•1 comments

X reveals foreign adversary behind fake accounts disseminating anti-data center

https://www.foxbusiness.com/fox-news-tech/x-reveals-foreign-adversary-behind-fake-accounts-dissem...
3•newsomix9xl•44m ago•2 comments

Roundup of September 2026 Bootstrapper Events

https://bootstrappersbreakfast.com/2026/08/27/roundup-of-september-2026-bootstrapper-events/
1•skmurphy•46m ago•1 comments

I accidentally turned LLM memory into program analysis

https://pwning.systems/posts/llm-memory-program-analysis/
2•matt_d•46m ago•1 comments

Zero-Cost 'Tagless Final' in Rust with GADT-Style Enums

https://inferara.com/blog/rust-tagless-final-gadt/
1•birdculture•47m ago•0 comments

PostgreSQL system catalog changes across versions

https://richyen.com/pg-catalog-almanac/
1•qianli_cs•52m ago•0 comments

LuaDB – A pure Lua RDBMS engine with B+Trees, WAL, and Postgres wire proto

https://github.com/jncastilho/luadb
1•COLD_WAR•54m ago•0 comments

Show HN: Substack and X and Reddit and Crypto = POW

https://www.proofofwriting.com/
1•caincurrency•54m ago•0 comments

The invisible labour behind 'intelligent' machines

https://theloop.ecpr.eu/the-invisible-labour-behind-intelligent-machines/
1•cdrnsf•56m ago•0 comments

Prop trading firms – the alternative and the reality

https://forexmechanics.com/choosing-broker/prop-trading/
1•wazka•57m ago•1 comments

Shortlinks

https://cailinpitt.com/blog/2026/8/28/shortlinks
1•classictraffic•57m ago•0 comments

Bigscreen Beyond 2 – the smallest VR headset

https://bigscreenvr.com/
1•bpierre•57m ago•0 comments

Now Hiring: Senior Open Source Maintainer

https://nesbitt.io/2026/08/28/now-hiring-senior-open-source-maintainer.html
1•metrofun•58m ago•0 comments

Cassius Marcellus Coolidge Gallery

https://www.dogsplayingpoker.org/gallery/coolidge/
2•billwirn•1h ago•0 comments

Xylitol linked to strokes and heart attacks

https://www.theguardian.com/society/2026/aug/28/sweetener-xylitol-used-in-chewing-gum-and-jam-lin...
4•yonibot•1h ago•1 comments

The Pure Python Breakthrough: How Blazeio Shatters the Compiled Language Dogma

https://medium.com/@bf_69202/the-pure-python-breakthrough-how-blazeio-shatters-the-compiled-langu...
1•anonyxbiz•1h ago•0 comments

Zig – Pointer Stability for ArrayLists

https://ziglang.org/devlog/2026/#2026-08-27
2•Retro_Dev•1h ago•0 comments