frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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

Why does the arrow (->) operator in C exist?

https://stackoverflow.com/questions/13366083/why-does-the-arrow-operator-in-c-exist
1•gnabgib•1m ago•0 comments

Trump admin didn't want Ebola-exposed Americans, sent them to Berlin, Prague

https://arstechnica.com/health/2026/05/trump-admin-didnt-want-ebola-exposed-americans-sent-them-t...
1•donutshop•4m ago•0 comments

Housekeeping Wages to Top $110K Year in New York City by Early 2030s

https://loyaltylobby.com/2026/05/20/housekeeping-wages-to-top-110k-year-in-new-york-city-by-early...
1•lxm•7m ago•0 comments

Amazon E-Bikes Take Root in Manhattan and Brooklyn

https://www.nytimes.com/2026/05/19/business/amazon-cargo-bikes-delivery.html
1•lxm•8m ago•0 comments

Google's open source distributed agent runtime

https://github.com/google/ax
1•rnella01•11m ago•0 comments

Birth Rate Debate: 40% of Girls Will Never Be Mothers [video]

https://www.youtube.com/watch?v=8eCM3NTBeb4
2•poiuyt098•11m ago•1 comments

Why does the arrow (->) operator in C exist?

https://lobste.rs/s/garq37/why_does_arrow_operator_c_exist
1•maxloh•14m ago•1 comments

Why Fashion Needs a World Model

https://twitter.com/ArkidMitra/status/2057130009203298693
1•Arkid•15m ago•1 comments

Web5-Mesh (IAON)

https://github.com/mamanga1/Web5-Mesh/tree/main
1•mamanga•19m ago•1 comments

Show HN: SafeRun – Replay debugging and inline prevention for AI agents 3

1•Tidianez•20m ago•0 comments

25 years ago Sega figured out the internet with Phantasy Star Online

https://www.avclub.com/sega-phantasy-star-online-gaming
1•debo_•23m ago•0 comments

Show HN: Agent Chat Bridge – give AI IDE agents an async callback

https://github.com/sathvikc/agent-chat-bridge
1•sathvikchinnu•24m ago•0 comments

Xcodes: Command-line Xcode version manager

https://github.com/XcodesOrg/xcodes
1•Lwrless•27m ago•0 comments

Show HN: SnapAPI – Screenshot, metadata extraction, and PDF generation API

https://snap.michaelcli.com
1•msmolkin•28m ago•0 comments

Timmy the Whale Got Stranded Off the German Coast. Then Things Got Weird

https://www.nytimes.com/2026/05/20/world/europe/timmy-whale-dead-denmark-rescue.html
1•duxup•29m ago•1 comments

Figma Design Agent

https://www.figma.com/blog/the-figma-agent-is-here/
3•satvikpendem•30m ago•0 comments

The Google AI Pro plan just got a quiet downgrade

https://www.androidcentral.com/apps-software/ai/google-ai-pro-plan-just-got-a-quiet-downgrade
2•geox•32m ago•0 comments

Trump Executive Order Expands Bank Secrecy Act

https://www.therage.co/trump-executive-order-expands-bank-secrecy-act/
3•Cider9986•34m ago•2 comments

MoonRay, DreamWorks Animation's Open Source Production Renderer

https://www.aswf.io/news/moonray-dreamworks-animations-open-source-production-renderer-joins-the-...
2•qainsights•38m ago•1 comments

Ignis: Run Obsidian as a self-hosted web app

https://github.com/Nystik-gh/ignis
1•thunderbong•39m ago•0 comments

Apple's new iPhone comes with Israeli chips

https://nonogra.ph/apples-new-iphone-comes-with-israeli-chips-05-21-2026
11•han1•45m ago•1 comments

To study how chips work, MIT researchers built their own operating system

https://www.csail.mit.edu/news/study-how-chips-really-work-mit-researchers-built-their-own-operat...
3•littlexsparkee•50m ago•0 comments

I'm Filing for Justice Samuel Alito's Disbarment

https://cmarmitage.substack.com/p/samuel-alito-has-exposed-himself
19•ze0ng•53m ago•5 comments

Ultima Underworld Remake Released

https://kweepa.itch.io/unity-underground
1•vancroft•54m ago•0 comments

Androids Are All Dying, Except Google Pixel [video]

https://www.youtube.com/watch?v=Ph-TMMku1xk
2•mgh2•57m ago•1 comments

AWS ExtendDB, open-source DynamoDB API with pluggable backends

https://aws.amazon.com/blogs/database/introducing-extenddb-an-open-source-dynamodb-compatible-ada...
1•jsw•59m ago•1 comments

A Booming Shadow Market of Sketchy A.I. Investments

https://www.newyorker.com/culture/infinite-scroll/a-booming-shadow-market-of-sketchy-ai-investments
2•petethomas•59m ago•0 comments

Google is dethroning OpenAI as the king of consumer AI

https://www.economist.com/business/2026/05/20/google-is-dethroning-openai-as-the-king-of-consumer-ai
3•petethomas•1h ago•0 comments

I made a browser alone and barely got any users

https://kagerou.glass/
3•kageroumado•1h ago•3 comments

OpenAI to confidentially file for IPO as soon as Friday

https://www.cnbc.com/2026/05/20/openai-ipo-filing.html
16•doppp•1h ago•0 comments