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

After Automation: Cofounders Will Be the Unfair Advantage

https://akspad.substack.com/p/after-automation-cofounders-will
1•akshayp29•2m ago•0 comments

A Ripped-Out Poem, or How I Voted in Russia's Parliamentary "Election"

https://psychotechnology.substack.com/p/a-ripped-out-poem-or-how-i-voted
2•eatitraw•5m ago•1 comments

PalmOS Lemmings

https://palmos-lemmings.dk.workers.dev/
2•measurablefunc•6m ago•0 comments

VYBE – Save clipboard YouTube links as MP4 or MP3 with global shortcuts

https://github.com/mickfive05/VYBE
2•michaellupo•7m ago•0 comments

Obsession with AI May Be Starving the Research Fields It Needs to Survive

https://www.unite.ai/obsession-with-ai-may-be-starving-the-research-fields-it-needs-to-survive/
2•50kIters•8m ago•0 comments

Boeing 737 MAX wins FAA certification, clearing way for delivery of 1555 planes

https://www.foxbusiness.com/markets/boeings-largest737-max-jet-wins-faa-certification-clearing-wa...
2•mikhael•9m ago•0 comments

LiteLLM 1.107.0 wheels on PyPI are compromised

https://twitter.com/LiteLLM/status/2112945728565993864
4•peterjliu•10m ago•0 comments

eMudhra Certificates Are Compromised

https://blog.cloudflare.com/emudhra-certificate-compromise/
3•nicksergeant•12m ago•1 comments

Embedding EYG in Erlang

https://eyg.run/guides/embedding-eyg-in-erlang-programs
1•crowdhailer•13m ago•0 comments

New Kid on the Block

https://praex.ai/
1•praexai•13m ago•0 comments

For All K9s Lovers

https://github.com/rt-kill/k9rs
1•rt-kill•14m ago•1 comments

Show HN: Professionally maintained Tree-sitter compatible WASM grammars

https://powderworks.dev/
1•knuckleheads•15m ago•0 comments

Show HN: The Steam Frame's wireless adapter isn't what you think

https://github.com/Sharktheone/steamframe-dongle
1•sharktheone•18m ago•0 comments

Toyota Releases Video of Wheelchair-Alternative Mobility Concepts in Action

3•Mobius01•20m ago•1 comments

What browser task do you still do by copy-paste every week?

https://awflow.io/
1•dannickstark•22m ago•2 comments

SpaceX and Tesla Explore Merger

https://www.nytimes.com/2026/10/21/business/elon-musk-spacex-tesla-merger.html
3•forthwall•22m ago•0 comments

Show HN: Repository of the Day - Flisk – run a full local service stack ASAP

https://github.com/flisk-sh/flisk
1•alexdykyi•25m ago•2 comments

Automattic begins layoffs following board upheaval and executive departures

https://techcrunch.com/2026/10/21/automattic-begins-layoffs-following-board-upheaval-and-executiv...
3•ValentineC•27m ago•0 comments

AWS rates PHP RCE as Important so Amazon Linux 2023 patch may take 20 days

https://github.com/amazonlinux/amazon-linux-2023/issues/1148
10•hayd•28m ago•1 comments

Design with an Elephant. Review with a Goldfish

https://egm.dev/
1•mfrw•29m ago•0 comments

UK government accepts 27 new "antisemitism" recommendations

https://twitter.com/PolitlcsUK/status/2112923461664260180
1•newspaper1•30m ago•0 comments

Show HN: I made anagrams slightly challenging

https://www.quizingo.app/anagrams
1•coder97•32m ago•0 comments

CleanFrame: A quieter home screen for Samsung The Frame

https://github.com/nthnclrk/CleanFrame
2•ingve•32m ago•0 comments

Android testers wanted: help us unlock Vardum on Google Play

https://tryvardum.app/
1•veil-im•33m ago•1 comments

Bugra Akdemir on the XERJ Corpus Hub

https://hub.xerj.org/contributors/BugraAkdemir
1•bugraakdemir37•35m ago•0 comments

She Was the DEA's Premier Crypto Detective

https://www.wired.com/story/the-deas-premier-crypto-detective-clues-led-straight-to-her-own-family/
1•Anon84•37m ago•0 comments

Model winter sunlight and shadows on any Oregon property using Lidar

https://www.oregonelevationtools.com
1•dango2506•40m ago•1 comments

Is Wikipedia the 'Last Best Place on the Internet'?

https://www.nytimes.com/2026/10/21/books/review/the-last-best-place-on-the-internet-richard-cooke...
2•cainxinth•40m ago•1 comments

Auracast – Your Own Radio Station Wherever You Are

https://www.bluetooth.com/auracast/
1•bookofjoe•41m ago•0 comments

Show HN: A shared 3D Zoo in the browser where everyone sees the same animals

https://zooki.world
3•kagen•42m ago•1 comments