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

I can bet you've never seen an app like this before

https://play.google.com/store/apps/details?id=com.indie6403.mooninpixels&hl=en_US
1•archit_indie•1m ago•1 comments

South Korea chip workers' bonuses puts central bank on inflation alert

https://www.cnbc.com/2026/06/20/south-korea-tech-samsung-sk-hynix-bonus-bank-of-korea.html
1•kristianp•1m ago•0 comments

Slop: Comment traduire ce mot en françAIs?

https://dictionnaire.lerobert.com/dis-moi-robert/raconte-moi-robert/dessous-des-mots/slop-comment...
1•jjgreen•3m ago•0 comments

Researcher turns wi-fi smart lightbulb into a Banned Book Library

https://www.tomshardware.com/maker-stem/researcher-turns-wi-fi-smart-lightbulb-into-a-banned-book...
1•JeanMarcS•3m ago•0 comments

Europe's heat pumps replace Middle East gas imports twice over

https://www.euronews.com/2026/06/22/europes-heat-pumps-replace-middle-east-gas-imports-twice-over...
1•rustoo•3m ago•0 comments

Value for Money Is All You Need

1•BEKOUTI•4m ago•0 comments

Founders OS – give your AI client your real business context, self-hosted

https://github.com/OurThinkTank/founders-os
1•ourthinktank•7m ago•0 comments

How not to forget what matters

https://www.henrikkarlsson.xyz/p/hypomnemata
1•jger15•7m ago•0 comments

What is prole drift and what to do about it

https://unprole.christianboyle.com/theory
1•lain98•9m ago•0 comments

How to Think About AI Before It's Too Late

https://www.theatlantic.com/podcasts/2026/06/how-to-think-about-ai-before-its-too-late/687644/
1•zb•11m ago•0 comments

FTSE 100 slips after PM Starmer says will resign

https://www.reuters.com/world/uk/london-shares-slip-after-pm-starmer-says-will-resign-2026-06-22/
1•wilsonfiifi•12m ago•0 comments

Ask HN: Any AI native Anki alternatives?

1•shadag•16m ago•0 comments

Callback – Less Scroll. More Soul

https://commodore.net/
1•thorin•16m ago•0 comments

Vibe Management

https://blog.jenkster.com/2026/06/vibe-management/
1•krisajenkins•17m ago•0 comments

I Decoupled Attention from Weights [video]

https://www.youtube.com/watch?v=1jGR4zqpyKA
1•aspirin•19m ago•0 comments

How a Microsecond-Level Low-Latency Engine Works

https://medium.com/@DolphinDB_Inc/c-speed-without-c-pain-inside-a-microsecond-level-low-latency-e...
2•CrazyTomato•19m ago•0 comments

In Defense of the Marginal Baby

https://caseyhandmer.wordpress.com/2026/06/22/in-defense-of-the-marginal-baby/
1•jger15•20m ago•0 comments

Vibe-coding niche Mac apps

https://cornfieldlabs.github.io/posts/vibecoding-niche-mac-apps/
2•cornfieldlabs•22m ago•0 comments

LetterBucket – A newsletter platform for owning your audience

https://letterbucket.com/
2•SergioPulido•25m ago•0 comments

Generative AI Music Attribution Rethinks Royalties

https://spectrum.ieee.org/ai-music-attribution
2•rbanffy•27m ago•0 comments

Show HN: Saar Agentic Orchestration Platform

https://github.com/Poi5eN/Nexus
2•Poi5eN•30m ago•1 comments

OCaml 5.5.0 Released

https://discuss.ocaml.org/t/ocaml-5-5-0-released/18265
3•birdculture•33m ago•0 comments

Hilarious German Compound Nouns you won't want to miss

https://www.rayburntours.com/blog/2016/10/03/25-hilarious-german-compound-nouns-wont-want-miss/
3•Tomte•37m ago•2 comments

Reality has a surprising amount of detail (2017)

https://johnsalvatier.org/blog/2017/reality-has-a-surprising-amount-of-detail
4•tosh•39m ago•0 comments

Show HN: Onbalance – privacy-first cashflow planning app got a multiuser update

https://onbalance.app/
2•doctorsolberg•45m ago•0 comments

GitHub Copilot improves productivity 40%

https://arxiv.org/abs/2606.00438
1•copy-pashte•48m ago•0 comments

Data centers become the face of AI backlash

https://www.axios.com/2026/06/22/ai-data-center-backlash-poll
2•ilreb•52m ago•0 comments

Productivity: Bookmarkr Chrome plugin with Visual and organized grid

https://chromewebstore.google.com/detail/bookmarkr-—-visual-bookma/lianafemkbankodapdaokiefoffi...
1•mnomansd•52m ago•0 comments

Bitcoin is stuck near $64,000 as ETF outflows reach a sixth week

https://www.techsentiments.com/article/2026/06/22/live-markets-bitcoin-is-stuck-near-64000-as-etf...
1•rajsuper123•56m ago•0 comments

Black Box Probing: A Security Analysis of Xiaomi's MJA1 Secure Chip

https://blog.quarkslab.com/black-box-probing-a-security-analysis-of-xiaomis-mja1-secure-chip.html
2•ahlCVA•58m ago•0 comments