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

With Adapted Sailing, the Sea Is for Everyone

https://reasonstobecheerful.world/adapted-sailing-school/
1•bookofjoe•1m ago•0 comments

Sherrod Brown Tries a New Retort to Criticism on Transgender Issues

https://www.nytimes.com/2026/09/19/us/politics/sherrod-brown-transgender-ad.html
1•whack•1m ago•0 comments

No More Code Dumps

https://www.reddit.com/r/rust/comments/1wkmzun/no_more_code_dumps/
1•mellosouls•3m ago•0 comments

Lawsuit: Anthropic, OpenAI, SpaceXAI and Google made illegal slowdown agreement

https://www.pbs.org/newshour/nation/lawsuit-says-anthropic-openai-spacexai-and-google-made-illega...
1•rdmuser•3m ago•0 comments

Mathematical Billiards (2024)

https://structures.uni-heidelberg.de/blog/posts/2024_01_costa/index.php
1•vismit2000•4m ago•0 comments

Cognition and consciousness arise from analog computations, says new theory

https://www.technology.org/2026/09/19/cognition-and-consciousness-arise-from-analog-computations-...
1•hackandthink•5m ago•1 comments

A Brief History of Koinometry

https://benjaminschneider.ch/2026/09/19/koinometry.html
1•bschne•6m ago•0 comments

OpenPrinter Teaser Update [video]

https://www.youtube.com/watch?v=wSV5XT4sl2A
1•rhmn_mdov•8m ago•0 comments

Winamp will be reborn in 2027 to take on streaming

https://www.engadget.com/2259236/winamp-coming-back-2027-deezer-partnership-streaming-music/
1•NordStreamYacht•10m ago•2 comments

Yes They Want to Kill Us: The Worshippers of Machines versus Human Beings

https://www.meditationsinanemergency.com/the-worshippers-of-machines-versus-the-lovers-of-nature/
1•eustoria•11m ago•0 comments

Show HN: Easymacros – free calorie and macro tracker, no ads, no subscription

https://easymacros.fit
2•hussein987•11m ago•1 comments

Which Regular Shapes can you draw on any* Grid? [video]

https://www.youtube.com/watch?v=BJXvaEUZvW0
1•vismit2000•11m ago•0 comments

Teen Social Media Bans Miss the Point

https://thereader.mitpress.mit.edu/teen-social-media-bans-miss-the-point/
3•eustoria•14m ago•1 comments

Our context warehouse knows your data, the semantic layer tells it what to trust

https://posthog.com/blog/semantic-layer
1•eustoria•15m ago•0 comments

Sony Music, Universal Music Group Sue Suno over Label-Backed Model

https://variety.com/2026/music/news/sony-music-universal-music-sue-suno-label-backed-model-123686...
1•ilamont•17m ago•0 comments

PearOS

https://pearos.xyz/
6•macote•18m ago•6 comments

Crypto Blew Its Big Moment–and the Blame Game Has Begun

https://www.wsj.com/finance/currencies/crypto-blew-its-big-momentand-the-blame-game-has-begun-dff...
2•lsowen•18m ago•0 comments

Show HN: Keep your social media active without posting every day

https://post.buzz/
1•out0fbounds•22m ago•0 comments

Humble Proxy Detection

https://proxy.kyc.red/
1•jwally•24m ago•1 comments

Polygonal Outer Billiard Discontinuity Sets

https://lael.dev/talks/imso
1•andsoitis•24m ago•0 comments

Do birds have accents? the regional differences in birdsong

https://theconversation.com/do-birds-have-accents-the-fascinating-regional-differences-in-birdson...
3•bryanrasmussen•27m ago•0 comments

Show HN: lgtm? – Jev-powered checks that make agents test

https://github.com/stardeckai/lgtm
1•jennmueng•29m ago•0 comments

Beyond jj: config & tools ecosystem

https://andre.arko.net/2026/09/16/beyond-jj-config-and-tools-ecosystem/
1•torutofu•34m ago•0 comments

Qwen-Image-2.1: Compact, efficient, and unified image creation

https://qwen.ai/blog?id=qwen-image-2.1
18•jmillikin•37m ago•2 comments

BragJack attacks hijack AI browser agents through malicious extensions

https://www.bleepingcomputer.com/news/security/bragjack-attacks-hijack-ai-browser-agents-through-...
1•sbulaev•39m ago•0 comments

Show HN: Lathe – app, Postgres and auth on your own machine, from $15/mo

https://lathe.live/
2•evgenileonti•41m ago•0 comments

Show HN: ColliePWA, a self-hosted mobile terminal for coding agents, with alerts

https://colliepwa.dev/
2•asar•42m ago•0 comments

Dr. Lael Edwards-Costa's Interactive Billiards Demo

https://lael.dev/billiards
1•vismit2000•43m ago•0 comments

The Bishop Ring Habitat

https://en.wikipedia.org/wiki/Bishop_ring_(habitat)
2•dtj1123•44m ago•0 comments

Show HN: Presence.el Online status and simple messaging for Emacs

https://git.andros.dev/andros/presence.el
1•andros•46m ago•0 comments