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

50K-token context reloads, replaced by a 2K local memory engine

https://github.com/CodeAbra/iai-personal-memory-engine
1•CodeAbra•1m ago•0 comments

The Grim and the Dark: Jon Heder's journey into the world of Grimdark art [video]

https://www.youtube.com/watch?v=SBJefwNkLqo
2•andystanton•10m ago•0 comments

Company Cleaning Up the Reflecting Pool Says It Has 'Nothing to Hide'

https://www.wsj.com/us-news/lincoln-memorial-reflecting-pool-california-greenwater-services-729be960
2•petethomas•21m ago•0 comments

AI Agent Triggers Nuclear Strike After Getting Outmaneuvered in Civilization VI

https://decrypt.co/371877/ai-agent-nuclear-strike-civilization-vi-benchmark
2•Khaine•22m ago•0 comments

Cigarettes

https://funnelfiasco.com/blog/2026/06/28/on-cigarettes/
3•aendruk•27m ago•0 comments

Side-Stepping the Secretary Problem

https://www.evalapply.org/posts/side-step-secretary-problem-hiring/index.html
4•Curiositry•34m ago•0 comments

The Usefulness of AI Agents

https://erikjohannes.no/posts/20260408-on-the-usefulness-of-ai-agents/index.html
2•Curiositry•38m ago•0 comments

/Dev/Notion

https://www.notion.com/product/dev
3•handfuloflight•39m ago•0 comments

AI glasses are aiding cheating in exams. Test-obsessed Asia is ground zero

https://www.cnn.com/2026/06/26/asia/ai-glasses-cheating-exams-intl-hnk
3•pseudolus•40m ago•0 comments

AI Workflows in Production Without Burning Tokens

https://unmeshed.io/blog/bringing-ai-workflow-into-production-without-burning-tokens
1•jusonchan81•44m ago•0 comments

Microsoft worker emails employees about company's support of Israel

https://www.thecanary.co/global/world-analysis/2026/06/26/microsoft-worker-emails/
5•lorecore•46m ago•0 comments

The Cheques Are for the Land Not the Intelligence

https://aidatumpoint.substack.com/p/the-cheques-are-for-the-land-not
2•MadCatBureau•47m ago•0 comments

Show HN: best.free

https://best.free/
2•nadermx•47m ago•0 comments

Crypto vs. community: 4k local US lenders join forces to fight 'stablecoins' law

https://www.theguardian.com/technology/2026/jun/28/crypto-v-community-local-lenders-fight-stablec...
3•pseudolus•48m ago•1 comments

New UK stealth fighter demonstrator takes shape

https://www.aerosociety.com/news/new-uk-stealth-fighter-demonstrator-takes-shape/
2•Gravityloss•48m ago•0 comments

You get to watch 1 season of 1 show for the rest of your life, what do you pick?

https://www.reddit.com/r/AskReddit/s/Sf9sqnAqRr
2•eeko_systems•49m ago•3 comments

QUIC, HTTP/3 and WebTransport Vulnerabilities and How PQCrypta Mitigates Them

https://pqcrypta.com/quic-hardening/
1•pqpdf•58m ago•0 comments

Wall Street regulator investigating prediction market giant Polymarket

https://www.politico.com/news/2026/06/26/cftc-investigation-prediction-market-polymarket-00978218
11•voxadam•1h ago•1 comments

Knowledge Distillation of Black-Box Large Language Models

https://arxiv.org/abs/2401.07013
14•babelfish•1h ago•8 comments

My coworker Iris isn't a person

https://vinibrasil.com/my-coworker-iris-isnt-a-person/
3•vnbrs•1h ago•0 comments

France records 1k additional deaths as extreme heat breaks European records

https://www.latimes.com/world-nation/story/2026-06-28/extreme-heat-breaks-more-european-records-1...
3•rolph•1h ago•2 comments

State of the Tau 2026: Why Pi Is Wrong

https://www.tauday.com/state-of-the-tau-current
1•rendx•1h ago•0 comments

Khaos C2: Building a Custom Command and Control from Scratch

https://medium.com/@28zaaky/khaos-c2-building-a-fully-custom-command-and-control-from-scratch-95c...
2•882542F3884314B•1h ago•0 comments

Ask HN: Local CJK/Latin entity extraction without shipping a model?

2•zphou•1h ago•0 comments

Show HN: Pitch Ponies – startup themed comic series

https://supramono.com/blog/never-trust-a-venture-capitalist-a-founders-comic-book-horror-story/
1•supramono•1h ago•0 comments

Writing your own static website generator

https://x3hy.github.io/data/pages/f32cbcd0-c594-4a16-b93b-bdcb2c9b2573.html
3•3hy•1h ago•0 comments

A QNX-inspired operating system with selectable kernels

https://qsoe.net
16•edvinbesic•1h ago•1 comments

Hire Me (Taylor) via API

https://taylor.town/looop-000
2•Curiositry•1h ago•0 comments

Amid stark opposition, data center developers think twice about Florida

https://www.politico.com/news/2026/06/28/florida-data-centers-developers-opposition-00978255
2•1vuio0pswjnm7•1h ago•0 comments

Xonaly – Canada's Independent Search Engine

https://xonaly.com/
24•backlit4034•1h ago•9 comments