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

View from the Top: Craig Federighi (2019) [video]

https://www.youtube.com/watch?v=43sjym5ZS68
1•Austin_Conlon•50s ago•0 comments

The World of Legacy IT Systems

https://spectrum.ieee.org/inside-hidden-world-legacy-it-systems
1•o_-_o•1m ago•0 comments

Lean Explained with TypeScript

https://gruhn.me/blog/2026-08-29/
1•fagnerbrack•3m ago•0 comments

Ahsan Hadi: PostgreSQL 19 Is Here: Worth the Wait

https://www.pgedge.com/blog/postgresql-19-is-here-worth-the-wait
1•omegaSigma95•7m ago•0 comments

Muru – AI-assisted Rust server for Python apps by mod_WSGI's creator

https://simonwillison.net/2026/Nov/21/muru/
1•joshcsimmons•7m ago•0 comments

Judge Won't Let 'DMCA-Ignored' Host Use Cox Ruling to Escape $42M Judgment

https://torrentfreak.com/judge-wont-let-dmca-ignored-host-use-cox-ruling-to-escape-42m-judgment/
1•gslin•9m ago•0 comments

Show HN: I asked a simple RegEx question and DeepSeek had a breakdown

https://chat.deepseek.com/a/chat/s/d6d82831-9b07-44fb-ae5b-6d3163e25092
1•abbassix•19m ago•0 comments

Double Agent finds chess position where all 63 moves check, beating 1968 record

https://www.doubleai.com/research/maxwell-chess-record-63-checks
1•NeuralOracle•24m ago•0 comments

After 49 Years, Voyager 1 Is One Light-Day from Earth

https://www.nytimes.com/2026/11/18/science/nasa-voyager-1-earth-light-day.html
1•tosh•24m ago•1 comments

AI Slop as a Service: Why Microsoft Won But the Soviets Lost

https://www.flyingpenguin.com/ai-slop-as-a-service-why-microsoft-won-but-the-soviets-lost/
1•Brajeshwar•25m ago•0 comments

Berlin Simulator Game

https://kairollmann.de/berlin-survivor/
1•kadrian12•26m ago•0 comments

GloriART Internet Radio now with cross-device Cloud Sync

https://gloriart.net/radio/
1•EmiIIius•29m ago•0 comments

DNS Stamps Specification

https://dnscrypt.info/stamps-specifications/
1•NeuralOracle•30m ago•0 comments

Nigel Richards: The Scrabble Champ Making History (2022)

https://wordfinder.yourdictionary.com/blog/meet-nigel-richards-the-scrabble-champ-making-history/
1•thunderbong•30m ago•0 comments

TeamsCache – Read Local Microsoft Teams Messages via CLI or MCP

https://github.com/stn1slv/teamscache
1•stn1slv•34m ago•0 comments

A Field Guide to Elephpants

https://afieldguidetoelephpants.net/
1•theanonymousone•37m ago•0 comments

A paste-y journey – finding a pastebin candidate to use

https://savyasacheejha.com/posts/a-paste-y-journey/
1•genghizkhan•40m ago•0 comments

Arduino App Lab

https://docs.arduino.cc/software/app-lab/
1•teleforce•42m ago•0 comments

Anti-Photoshop: A Mega-Combine Without a Technical Specification

https://medium.com/@smoking2man/anti-photoshop-a-mega-combine-without-a-technical-specification-f...
1•Aldus551•45m ago•0 comments

Harsher on Male? Evaluating LLMs on Gender-Asymmetric Moral Framing in Conflicts

https://arxiv.org/abs/2606.14068
1•rzk•45m ago•0 comments

Rejoining EU 'on the table' as UK makes deals on trade and young people

https://www.theguardian.com/politics/2026/nov/21/rejoining-eu-uk-trade-youth-deals-ed-miliband
3•vrganj•46m ago•0 comments

Sphere

https://en.wikipedia.org/wiki/Sphere_(venue)
2•tosh•49m ago•0 comments

ChatGPT shrunk down to run on a Super Nintendo

https://www.theregister.com/offbeat/2026/11/21/chatgpt-shrunk-down-to-run-on-a-super-nintendo/531...
1•nephihaha•51m ago•0 comments

Roast My UI

https://heltweg.org/posts/roast-my-ui/
1•rhazn•52m ago•0 comments

TI Embedded AI

https://www.ti.com/en-us/technologies/edge-ai
1•teleforce•54m ago•1 comments

Lean Should Be Ashamed

1•LTaoist•56m ago•0 comments

Show HN: Tartelette – an RP2040 emulator and breakout simulator

https://pferreir.github.io/tartelette/
1•_pferreir_•59m ago•0 comments

Kvrocks

https://www.percona.com/blog/inside-kvrocks/
4•bashhq_r•1h ago•0 comments

87% of the Anthropic power will come from gas and 11% from coal in 2028

https://betterdatacenterproject.com/2026/11/16/how-ai-is-powered-a-breakdown-of-byop-and-grid-power/
71•happosai•1h ago•43 comments

Is AI plagiarizing human research?

https://twitter.com/Robert_E_Grant_/status/2124338413662847228
2•doener•1h ago•0 comments