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

Show HN: I made a product – turn your text into social media carousel posts

https://www.carouslide.in
1•piruthvi•31s ago•0 comments

The Shared Clipboard Inside the Sandbox: Cross-Account Data Leakage in ChatGPT

https://research.checkpoint.com/2026/the-shared-clipboard-inside-the-sandbox-cross-account-data-l...
1•HelloUsername•32s ago•0 comments

Native weather data platform built leading numerical weather prediction models

https://aethra.dev/pricing
1•weatherfun•38s ago•0 comments

Show HN: Nevertwenty a novel approach to chord synthesis

https://www.nevertwenty.com/
1•brandoniscool•46s ago•0 comments

Possible final edition of Blade announced; company explores sale

https://www.toledoblade.com/local/city/2026/09/08/possible-final-edition-of-blade-announced-compa...
1•jaredwiener•55s ago•0 comments

Muse, your personal AI agent from Meta

https://twitter.com/muse/status/2097399178376671666
1•ot•1m ago•0 comments

Ironies of Automation (1983) [pdf]

https://ckrybus.com/static/papers/Bainbridge_1983_Automatica.pdf
2•ebcode•4m ago•0 comments

The complex corporate web behind a $3.2B AI data center

https://arstechnica.com/features/2026/09/the-ai-data-center-boom-is-causing-new-accountability-pr...
2•Betelbuddy•6m ago•0 comments

Rivian's Gambit for Full Autonomy

https://spectrum.ieee.org/rivian-self-driving
1•1970-01-01•6m ago•0 comments

Pretraining progress is mostly coming from data

https://www.dwarkesh.com/p/pretraining-progress-is-mostly-data
1•crescit_eundo•6m ago•0 comments

China targets fourfold boost in AI computing capacity by 2030 in major tech push

https://www.scmp.com/tech/policy/article/3366733/china-targets-fourfold-boost-ai-computing-capaci...
1•newusertoday•6m ago•0 comments

Musk review – epic study of the world's richest and most banal man

https://www.theguardian.com/film/2026/sep/08/musk-review-epic-study-worlds-richest-most-banal-man...
2•thatmf•6m ago•0 comments

Netanyahu Received an Explicit Warning Days Before Oct. 7

https://www.haaretz.com/israel-news/israel-security/2026-09-08/ty-article-magazine/.highlight/net...
3•Betelbuddy•7m ago•0 comments

Fractal basins trap latent reasoning

https://arxiv.org/abs/2609.04963
1•cocoflunchy•8m ago•0 comments

Artificial Deadlines (Part 2): Retrograding Ariely and Wertenbroch (2002)

https://datacolada.org/139
2•rahimnathwani•11m ago•0 comments

Function Arguments Are Not Function Colors

https://jerf.org/iri/post/2026/func_args_are_not_colors/
2•ingve•11m ago•0 comments

A globe of what every country is discovering musically, updated daily

https://rotation.today/map
1•djsicat•12m ago•0 comments

UK announces sanctions on West Bank settlements

https://www.bbc.com/news/articles/c4g7zen0vveo
3•laimewhisps•14m ago•1 comments

Muse, your personal AI agent.

https://auth.muse.ai/aymh/?origin=https%3A%2F%2Fmuse.ai
5•10xDev•15m ago•0 comments

Porsche Unleashed

https://www.filfre.net/2026/09/porsche-unleashed/
3•ibobev•15m ago•0 comments

Is it safe to give an AI Agent access to your production database?

https://www.tigerdata.com/blog/ai-agent-production-database-access
2•andrewstetsenko•17m ago•1 comments

Make APIs that fail gracefully rather that fallback silently

https://mropert.github.io/2026/09/02/implicit_vs_explicit_api/
2•ibobev•17m ago•0 comments

Cutting JSON Parsing CPU Cost in Go

https://skoredin.pro/blog/golang/json-parsing-performance-go
2•ibobev•18m ago•0 comments

A 40-year-old iOS kernel bug discovered on the DEFCON 34 main stage

https://twitter.com/jachashx/status/2097353320167846206
2•yuvalino•18m ago•0 comments

Micron: A pure C++ (re)implementation of Libc

https://github.com/rfgplk/micron.cpp
1•rfgplk•20m ago•1 comments

LG accused of 'egregious invasion of privacy' over TV data collection

https://www.theregister.com/security/2026/09/08/lg-accused-of-egregious-invasion-of-privacy-over-...
2•Bender•21m ago•0 comments

Real photos of young girls were in nudify-app ads on Facebook, Instagram

https://arstechnica.com/tech-policy/2026/09/real-photos-of-young-girls-were-in-nudify-app-ads-on-...
4•Bender•21m ago•0 comments

Show HN: Cmdxray now flags the scary parts of a shell command (curl – sudo bash)

https://aurelio-nakamura.github.io/cmdxray/?cmd=curl%20-fsSL%20https%3A//get.example.com/install....
1•aurelionakamura•21m ago•0 comments

Design the Next iPhone

https://neal.fun/design-the-next-iphone/
1•duck•21m ago•0 comments

MCP: A Guide in Plain English

https://www.polytomic.com/blog-posts/mcp-a-guide-in-plain-english
1•gms•22m ago•0 comments