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

ParallelClusterMaker – CLI toolkit to manage AWS ParallelCluster stacks

https://github.com/rmarable/ParallelClusterMaker
1•rmarable•3m ago•0 comments

Brain scans reveal widespread changes in patients following COVID-19 infection

https://www.psypost.org/brain-scans-reveal-widespread-structural-and-functional-changes-in-patien...
1•amichail•3m ago•0 comments

Who Should Pay for Source Code Availability?

https://kristoff.it/blog/source-code-availability/
1•kristoff_it•3m ago•0 comments

An Israeli professor lost a prestigious US job offer after speaking out on Gaza

https://www.theguardian.com/us-news/ng-interactive/2026/aug/06/professor-israel-gaza-university-o...
2•khaledh•4m ago•1 comments

Interview with Amit Patel, Creator of "Solar Realms Elite"

https://breakintochat.com/blog/2013/02/18/amit-patel-creator-of-solar-realms-elite/
1•bananaboy•5m ago•0 comments

Ask HN: Why can't we use both doors?

1•Dfol•6m ago•0 comments

John C. Lilly on solid state intelligence and the elimination of man (1978)

https://kibotronics.net/unlisted/lilly-machines/
1•Kiboneu•7m ago•0 comments

ScientistOne: Towards Human-Level Autonomous Research via Chain-of-Evidence

https://arxiv.org/abs/2605.26340
1•simonpure•11m ago•0 comments

Big Tech's Ten Most Interesting Patents This Week (8/9/2026)

https://patentlyze.com/big-tech-ten-most-interesting-patents-july-30-2026/
2•Dfol•12m ago•0 comments

Science One Framework: Verifiable Autonomous Research via Chain-of-Evidence

https://research.google/blog/science-one-framework-a-verifiable-autonomous-research-framework-via...
1•simonpure•13m ago•0 comments

Debugging Information for Inlined Functions

https://lwn.net/Articles/1083985/
1•pykello•17m ago•0 comments

Ask HN: My dev blog has 11k followers. I stopped writing it. What would you do?

1•zlatkov•20m ago•2 comments

Halftone QR Codes

https://cgv.cs.nthu.edu.tw/Projects/Recreational_Graphics/Halftone_QRCodes/
1•karagenit•20m ago•1 comments

The Slow Squeeze: Three Systems Under Strain, Moving at Different Speeds

https://bytepith.com/article/slow-squeeze-climate-demographics-and-state-power
2•khanhnguyen8386•21m ago•0 comments

Play is at the core of a meaningful life

https://www.ft.com/content/7b95cdab-7546-432f-b4a1-6509e7648ec5
2•benkoller•23m ago•0 comments

I run a 9-model LLM council to write a financial newsletter. What breaks

https://marketdaily.ai/blog/eng-llm-council-judge-en-202608
1•delvinchang•25m ago•0 comments

Attachment style quiz – find out your attachment

https://tally.so/r/0QP0lj
1•ElysiumAbove•26m ago•1 comments

Becoming Bridge Builders

1•Revdrbkeithhane•27m ago•0 comments

Offline Bootloader Unlock for Xiaomi 8Elite 8G3 8G2 8sGen4 8sGen3, MTK 9400/9500

https://xdaforums.com/t/guide-breakthrough-free-offline-bootloader-unlock-for-cn-xiaomi-redmi-8el...
2•Markoff•29m ago•0 comments

Show HN: Sift – Fast local file organizer CLI with 1-click transaction undo

https://github.com/taevel02/Sift
1•taevel02•31m ago•0 comments

Open-Source Licensing 101

https://alavi.me/blog/opensource-licensing-101/
1•yolkedgeek•31m ago•0 comments

Translating anything into a number using math

https://blog.naxn.shop/ever-thought-about-how-you-can-translate-anything-into-a-number-using-math
1•codecnomad•31m ago•0 comments

Emacs for NvChads

https://qlain.online/blog/emacs-for-nvchads.html
2•etoql•33m ago•0 comments

Show HN: Job Seeker – AI agent skills for job searching

https://github.com/galiprandi/job-seeker
1•galiprandi•34m ago•0 comments

Mea Culpa – Dark Hours

https://blog.terrygodier.com/2026/08/09/mea-culpa-dark-hours.html
27•satvikpendem•34m ago•11 comments

Murder Stone

https://en.wikipedia.org/wiki/Murder_stone
1•jimnotgym•37m ago•1 comments

Exercise is good for you. But what's the right amount?

https://iterator.news/p/exercise-is-good-for-you-but-whats-the-right-amount
2•bucket2015•38m ago•3 comments

Let's build a digital clock (Video, Ben Eater)

https://www.youtube.com/watch?v=3XDH-fZKnQk
1•JKCalhoun•43m ago•0 comments

A unique palaeolithic human ichnological record from Italy (Bàsura Cave)

https://elifesciences.org/articles/45204
1•Tomte•45m ago•0 comments

Amazon Builder's Library – An overlooked goldmine of System Design knowledge

https://sumitgouthaman.com/posts/amazon-builders-library/
1•equinumerous•45m ago•0 comments