frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•7mo 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•7mo 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•7mo 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).

EU Council introduces a €3 customs duty on every parcel. Starting July 1, 2026

https://twitter.com/EUCouncil/status/1999509838083010621
2•mickelsen•4m ago•0 comments

Nex gaming console – year's hottest toy?

https://www.wsj.com/business/entrepreneurship/nex-playground-toy-game-console-holiday-shopping-af...
1•gsanghera•6m ago•1 comments

Childhood instability accelerates women's sexual strategies, study suggests

https://medicalxpress.com/news/2025-12-childhood-instability-women-sexual-strategies.html
1•PaulHoule•7m ago•0 comments

The First Internal Evaluation of the Faust Baseline Version 2.5

https://www.intelligent-people.org/2025/12/11/the-first-internal-evaluation-of-the-faust-baseline...
1•micvicfaust9•8m ago•0 comments

AI is part of Linux's plumbing – whether developers like it or not

https://www.zdnet.com/article/ai-is-part-of-linux-plumbing-developers/
1•CrankyBear•8m ago•0 comments

Where CC Stands on Pay-to-Crawl

https://creativecommons.org/2025/12/12/where-cc-stands-on-pay-to-crawl/
1•xngbuilds•11m ago•0 comments

CISA orders federal agencies to patch GeoServer flaw

https://www.scworld.com/news/cisa-orders-federal-agencies-to-patch-geoserver-flaw
2•Bender•13m ago•0 comments

New AI X Youth empowerment focused Initiative in Alabama

https://bld.al/
1•peauts•14m ago•0 comments

315lbs Bench –| 225lbs Squat cofounder needed

https://gymboard.multisync.io
1•ahmedhussam1053•16m ago•0 comments

A Centralized Database of All Math (2024)

https://ista.ac.at/en/news/a-centralized-database-of-all-math/
1•gone35•18m ago•0 comments

Emacs Propaganda: I wrote a thing for Emacs, but don't call it a "plugin"

https://www.youtube.com/watch?v=jwH3B1vHqvQ
1•iLemming•19m ago•1 comments

Diablo Canyon moves a step closer to staying open

https://www.sanluisobispo.com/news/local/environment/article313620974.html
1•Bender•24m ago•0 comments

Wine 11.0-rc2 Released With 28 Known Bug Fixes

https://www.phoronix.com/news/Wine-11.0-rc2
1•Bender•25m ago•0 comments

We've cracked how to make random numbers

https://www.newscientist.com/article/2494268-weve-finally-cracked-how-to-make-truly-random-numbers/
2•Anon84•26m ago•0 comments

Thought Colleague Was a Traitor for Teaching Students to Use AI. Then We Talked

https://thewalrus.ca/teaching-students-to-use-ai/
1•pseudolus•26m ago•0 comments

How the Bell Labs Holmdel Complex Inspired 'Severance'

https://www.atlasobscura.com/articles/podcast-bell-labs-holmdel-complex
1•SerCe•26m ago•0 comments

Intel CEO Lip-Bu Tan was investor and adviser to firm sanctioned for China deals

https://www.oregonlive.com/silicon-forest/2025/12/intel-ceo-lip-bu-tan-was-investor-and-adviser-t...
4•osnium123•27m ago•0 comments

Review of Medical Cannabis Use Finds Little Evidence of Benefit

https://www.nytimes.com/2025/12/12/health/medical-cannabis-benefits.html
3•pseudolus•28m ago•2 comments

Divinity

https://divinity.com/
1•robenkleene•29m ago•0 comments

The surprising longevity lessons from the oldest animal

https://www.newscientist.com/article/2497719-the-surprising-longevity-lessons-from-the-worlds-old...
2•Anon84•30m ago•0 comments

a16z: In 2026, Venture Capital will eat Private Equity

https://twitter.com/tkexpress11/status/1998852154510217325
1•e2e4•37m ago•0 comments

Gemini's live speech to speech translation capabilities

https://www.youtube.com/watch?v=xdPIwgDriTg
2•anuda•41m ago•0 comments

India Is a Rising Power, but Breathing in Its Capital Is Hazardous

https://www.nytimes.com/2025/11/30/world/asia/india-delhi-pollution.html
4•bookofjoe•51m ago•1 comments

HyperCard on the Macintosh

https://stonetools.ghost.io/hypercard-mac/
4•TMWNN•55m ago•0 comments

Ask HN: Is this a sane way to expose distributed state in Rust?

1•asdfghjqwertyu•56m ago•0 comments

Show HN: I made an LLM confessional booth, be a priest and forgive LLMs mistakes

https://llmpriest.carsho.dev
1•carsoon•57m ago•0 comments

Temporal disobedience: Intersex timescapes, chronopolitics and intersex joy

https://journals.sagepub.com/doi/10.1177/14647001251389818
1•stinkbeetle•1h ago•1 comments

The Data Marketing Machine

https://storagemath.com/posts/vast-data-marketing-machine/
1•maxicohen•1h ago•0 comments

Everything Is Context: Agentic File System Abstraction for Context Engineering

https://arxiv.org/abs/2512.05470
3•handfuloflight•1h ago•0 comments

Mount Git repo to view commits and branches as files

https://github.com/matthiasgoergens/git-snap-fs
1•lhmiles•1h ago•1 comments