frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

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

Japan Needs More Oil and Gas. US Drillers Need Capital. Why Aren't They Meeting?

https://www.governance.fyi/p/japan-and-east-asia-investing-more
1•bigbobbeeper•2m ago•0 comments

Free models you can use with your OpenClaw (no credit card needed)

1•stosssik•2m ago•0 comments

Query and manage Marketplace databases from the dashboard

https://vercel.com/changelog/query-and-manage-marketplace-databases-from-the-dashboard
1•stosssik•3m ago•0 comments

The Biggest Oil Disruption in History Is Accelerating the Energy Transition

https://oilprice.com/Energy/Energy-General/The-Biggest-Oil-Disruption-in-History-Is-Accelerating-...
1•toomuchtodo•3m ago•0 comments

Claude Is Dead

https://www.javiertordable.com/claude-is-dead/
1•tordable•4m ago•1 comments

The builder who changed how we keep time

https://www.bbc.com/news/articles/cd9vxg95ze2o
1•megamike•4m ago•0 comments

Goo That Does Things

https://asimai.substack.com/p/the-sentient-soup-of-the-future
1•abhinavsns•8m ago•0 comments

Did Airbnb, Medium, Beats, and Flipboard Rip Off Their Logos? (2016)

https://thehustle.co/airbnb-medium-beats-flipboard-logo
1•bookofjoe•9m ago•0 comments

List of programing languages that compile to Go

https://github.com/ubavic/compiles-to-go
1•ubavic•11m ago•0 comments

Fox to Integrate Kalshi Forecasts Across Fox News Media and Fox One Platforms

https://news.kalshi.com/p/fox-kalshi-partnership-prediction-market-data-integration
2•ChrisArchitect•12m ago•1 comments

RSoC 2026: A new CPU scheduler for Redox OS

https://www.redox-os.org/news/rsoc-dwrr/
2•akyuu•16m ago•0 comments

How to Generate Text in One Step

https://one-step-lm.github.io/blog/index.html
2•E-Reverance•17m ago•0 comments

Amazon S3 Files

https://aws.amazon.com/s3/features/files/
1•tmp10423288442•17m ago•1 comments

Appwrite 1.9.0: Self-hosting with MongoDB as the underlying database

https://appwrite.io/blog/post/self-hosting-appwrite-with-mongodb
1•raybb•19m ago•0 comments

Towards Post-Quantum Cryptography in TLS (2019)

https://blog.cloudflare.com/towards-post-quantum-cryptography-in-tls/
2•jumploops•21m ago•0 comments

Show HN: Open-source GDPR router for LLMs detects PII, forces EU-only inference

https://github.com/mahadillahm4di-cyber/mh-gdpr-ai.eu
2•mahadillah-ai•22m ago•0 comments

From Hierarchy to Intelligence

https://sequoiacap.com/article/from-hierarchy-to-intelligence/
1•philip1209•22m ago•0 comments

The Most Effective Weapon on the Modern Battlefield Is Concrete (2016)

https://mwi.westpoint.edu/effective-weapon-modern-battlefield-concrete/
2•logikblok•23m ago•0 comments

Switzerland builds most powerful redox-flow battery

https://www.swissinfo.ch/eng/climate-solutions/switzerland-builds-worlds-most-powerful-redox-flow...
5•simonpure•24m ago•0 comments

Earth Has Fallen. The Amiga Dungeon Crawler Is Back

https://old.reddit.com/r/amiga/comments/1sf7so4/earth_has_fallen_the_amiga_dungeon_crawler_is_back/
3•doener•25m ago•0 comments

Tabsdata: Like a Database for Dataflows

https://docs.tabsdata.com/latest/guide/01_overview/main.html
1•immortan_dag•25m ago•0 comments

Mythos escapes a secure sandbox [in test]

https://twitter.com/a_karvonen/status/2041589039955112119
2•marojejian•26m ago•1 comments

Show HN: Mo – checks GitHub PRs against decisions approved in Slack

https://motionode.com/index
2•oscarcaldera•27m ago•0 comments

Llambada – make vibe-coded mini-apps and earn when paid users use them

https://www.llambada.com/
1•roody_wurlitzer•29m ago•0 comments

Apollo 11's journey to the moon, annotated [video]

https://www.youtube.com/watch?v=OCjhCL2iqlQ
1•lopespm•30m ago•0 comments

USD Purchasing Power in Real Time Since 2000

https://onedollar.today/
2•traviswingo•30m ago•0 comments

From Iran – an invitation to physicists to look at my paper about Alpha

https://www.researchgate.net/publication/396352740_Alpha_-_Emergent_The_Fine-Structure_Constant
4•pajuhaan•34m ago•1 comments

Scientists invented a fake disease. AI told people it was real

https://www.nature.com/articles/d41586-026-01100-y
3•EA-3167•34m ago•0 comments

What the heck is wrong with our AI overlords?

https://arstechnica.com/tech-policy/2026/04/what-the-heck-is-wrong-with-our-ai-overlords/
2•kyrofa•34m ago•0 comments

FundaAI: Building kids in Africa to engineers [video]

https://www.youtube.com/watch?v=XSUnIsMqUD8
1•emms21•36m ago•1 comments