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

VNote: A pleasant note-taking platform in native C++

https://github.com/vnotex/vnote
1•htfy96•1m ago•0 comments

What happens when you run a CUDA kernel?

https://fergusfinn.com/blog/what-happens-when-you-run-a-gpu-kernel/
1•mezark•1m ago•0 comments

UGC Agent – Run AI agents that find UGC creators

https://ugcagent.app/
1•vicpitic•2m ago•0 comments

Tidal AI Policy

https://tidal.com/ai-policy
3•hn8726•3m ago•0 comments

Trump and Lutnick families cash in on corrupt mining deal

https://twitter.com/mikelevin/status/2071290309799989427
3•bix6•3m ago•0 comments

Firefox extension that detects WordPress Plugins

https://addons.mozilla.org/en-US/firefox/addon/wpoptic/
1•WPoptic•4m ago•0 comments

Incus 7.2 has been released – News – Linux Containers Forum

https://discuss.linuxcontainers.org/t/incus-7-2-has-been-released/26879
1•speckx•5m ago•0 comments

Comcast Moves to Split in 2

https://apnews.com/article/comcast-nbcuniversal-sky-5dc27c2e6fe45eb78eae4336e025b4e2
1•MiscIdeaMaker99•5m ago•0 comments

The Wyoming Town in Uproar over Plans for a Data-Center "Man Camp"

https://www.wsj.com/video/series/on-the-news/the-wyoming-town-in-uproar-over-plans-for-a-data-cen...
1•1vuio0pswjnm7•5m ago•0 comments

PostgreSQL-Compatible Databases for AI at Scale

https://www.cockroachlabs.com/blog/postgresql-compatible-databases-ai-scale/
2•ilreb•5m ago•0 comments

Show HN: Wattcast, weather at your moving position along a cycling route

https://wattcast.app/
2•alienswede•7m ago•0 comments

JSON Handbook

https://jstools-space.gitbook.io/json-handbook
2•javatuts•9m ago•0 comments

NixOS 26.05 Released

https://nixos.org/blog/announcements/2026/nixos-2605/
1•lostmsu•10m ago•0 comments

Punnacle (rapid-fire pun game)

https://www.punnacle.com
1•anais9•11m ago•1 comments

Christopher Alexander and the Inadequacy of Genius (2020)

https://www.mdpi.com/2413-8851/4/2/17
1•doright•11m ago•0 comments

Simply supported beam–Castigliano's method

https://leancrew.com/all-this/2026/06/simply-supported-beam-castiglianos-method/
1•surprisetalk•11m ago•0 comments

Reading the Internals of PostgreSQL: Database Cluster, Databases, and Tables

https://www.buraksen.dev/articles/internals-of-postgresql-db-cluster-and-tables
2•buraksen•12m ago•0 comments

Ozymandias on Rails. The Pedestal Inscription

https://baweaver.com/writing/2026/06/28/ozymandias-on-rails-the-pedestal-inscription/
1•thunderbong•12m ago•0 comments

A right-wing media chain tried to replace 47 newspapers with AI. They all died

https://werd.io/a-right-wing-media-chain-tried-to-replace-47-newspapers-with-ai-they-all-died/
4•benwerd•14m ago•0 comments

Musk says SpaceX is putting top Starship and Starlink engineers to work on Grok

https://www.businessinsider.com/grok-4-5-starship-starlink-engineers-elon-musk-ai-cursor-2026-6
2•dansquizsoft•14m ago•0 comments

A pan that won't let me rush dinner

https://blog.jimgrey.net/2026/06/25/on-frying-and-sauteeing-with-ease/
2•speckx•14m ago•0 comments

The End of Boom/Bust Cycles for the Memory Market

https://www.nextplatform.com/store/2026/06/26/the-end-of-boom/bust-cycles-for-the-memory-market/5...
3•rbanffy•15m ago•0 comments

DankMaterialShell

https://github.com/AvengeMedia/DankMaterialShell
3•LorenDB•15m ago•0 comments

Garbage for Humans

https://unstory.eu/zye/
4•sorcix•19m ago•1 comments

Proview – Spectate any pro LoL player's live game or replay in-client

https://proview.es
3•SammyKEK•20m ago•0 comments

AMD Linux Patches Introduce New "Low Power" CPU Core Type

https://www.phoronix.com/news/AMD-Low-Power-CPU-Core-Linux
4•LorenDB•21m ago•0 comments

Are Humanoid Robots Ready to Be Deployed?

https://www.newyorker.com/magazine/2026/07/06/are-humanoid-robots-ready-to-be-deployed
3•littlexsparkee•22m ago•0 comments

AI: The Falsity of Comparison

https://syntheticauth.ai/posts/ai-the-falsity-of-comparison
3•zerolayers•22m ago•0 comments

How to Write an Effective Software Design Document

https://refactoringenglish.com/excerpts/write-an-effective-design-doc/
3•mtlynch•23m ago•1 comments

'Kind of miracle solution': How Paris is harnessing the Seine to replace air-con

https://www.theguardian.com/environment/2026/jun/26/underground-revolution-seine-cooling-network-...
3•montalbano•24m ago•1 comments