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

Backlink exchange that escrows credits and prevents A↔B swaps

https://www.authoriflow.com
1•blak3k•1m ago•0 comments

Optimizing Things in the USSR (2016)

https://chris-said.io/2016/05/11/optimizing-things-in-the-ussr/
1•downbad_•2m ago•0 comments

Show HN: Chainstack Self-Hosted, hosting your own blockchain nodes made simple

https://docs.chainstack.com/docs/self-hosted/introduction
1•loshaaaa•5m ago•0 comments

Ask HN: Are You a Workaholic?

2•julienreszka•5m ago•0 comments

Scaling Akvorado BMP RIB with Sharding

https://vincent.bernat.ch/en/blog/2026-akvorado-rib-sharding
1•jruohonen•7m ago•0 comments

"Boing " in 64 Bytes

https://www.pouet.net/prod.php?which=106480
1•HellMood•8m ago•1 comments

Show HN: An AI video prompt cookbook for image-to-video workflows

https://github.com/yasuomang/ai-video-prompt-cookbook
1•Ash_yasuomang•14m ago•0 comments

100 Greatest Bird Names of All Time

https://birdhistory.substack.com/p/the-100-greatest-bird-names-of-all
2•bookofjoe•17m ago•0 comments

Show HN: AdvertBench, ranking the ability of LLMs to create image ads

https://advertbench.com
1•joegibbs•17m ago•0 comments

How LLMs Distort Our Written Language

https://sites.google.com/view/llmwritingdistortion/home
1•jruohonen•17m ago•0 comments

Show HN: An agentic control pane for iPhone

https://onepilotapp.com
2•elearia•19m ago•0 comments

Show HN: Local LLM Hardware Calculator

https://vettedconsumer.com/can-i-run-it/
1•ermantrout•20m ago•0 comments

Show HN: GraphCompose – Declarative Java engine for structured business PDFs

https://github.com/DemchaAV/GraphCompose
2•demchaav•25m ago•0 comments

The Mathematics of the Chinese Calendar [pdf]

https://gwern.net/doc/science/physics/astronomy/2010-aslaksen.pdf
3•mysticaltech-•27m ago•0 comments

Foreign-Born Entrepreneurs Drive America's Unicorn Boom

https://news.crunchbase.com/venture/foreign-born-entrepreneurs-drive-americas-unicorn-boom-strebu...
2•USTECH_WORKER•29m ago•1 comments

Beyond All Reason (Free Total Annihilation Inspired RTS)

https://www.beyondallreason.info
3•mosiuerbarso•30m ago•1 comments

Shall We? – A pre-engineering sanity check for AI-era feature bloat

https://github.com/Tacsiazuma/shall-we
3•tacsiazuma•30m ago•0 comments

Tell HN: Happy Father's Day

3•atestu•34m ago•0 comments

AI Warfare Is at the Point of No Return

https://www.wsj.com/world/ai-warfare-ukraine-russia-anthropic-29945df9
1•bookofjoe•35m ago•1 comments

Retrocomputing with Clash – Haskell for FPGA Hardware Design

https://unsafeperform.io/retroclash/
3•AlexeyBrin•37m ago•0 comments

Madrid Metro uses its trains to deliver packages during non-operating hours [video]

https://www.youtube.com/watch?v=xyuxZCxHWzA
2•cromka•40m ago•1 comments

If anyone wants user feedback directly from your product website, check this out

https://amendor.site/
1•osaeld•42m ago•0 comments

Computer Programming for Everybody

https://www.python.org/doc/essays/cp4e/
2•edent•43m ago•0 comments

A Wild Register Appears: Hunting the 30-Year-Old World of Xeen MT-32 Crash

http://finalpatch.github.io/xeen/
2•stevekemp•43m ago•0 comments

I aim to break the record for the fastest mile

https://www.telegraph.co.uk/athletics/2026/06/09/josh-kerr-why-im-trying-break-record-fastest-mil...
2•wjb3•44m ago•0 comments

Cagebase - Chromium fork that spoofs fingerprints from a JSON profile

1•boredhacker3•45m ago•1 comments

I Created a Minimalist Universal Language for AI

https://github.com/caihongfairys/QMP-Dynamic-Anchors
2•Queen_Xiya•45m ago•0 comments

The open-source Agent Communication Infrastructure

https://github.com/novuhq/novu
2•scopsy•46m ago•0 comments

The Vagabundler Project

https://vagabundler.com/about-vagabundler/
1•jruohonen•48m ago•0 comments

Firecracker-like microVMs for Proxmox VE

https://github.com/rcarmo/pve-microvm
2•networked•50m ago•0 comments