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

Everyone's Been Drawing Pterosaur Wings Wrong

https://nautil.us/everyones-been-drawing-pterosaur-wings-wrong-1282235
1•Brajeshwar•2m ago•0 comments

Object-oriented OS with many features of popular niche Linux distributions

https://github.com/Jonathan-R-Anderson/anonymOS/
2•rockbeatspaper•2m ago•1 comments

Show HN: Hikaru Labs – Bulk image and file processing, 100% in-browser

https://hikarulabs.xyz
2•CFBL•2m ago•1 comments

Calling everything AI-generated is lazy

https://00f.net/2026/06/25/stop-calling-everything-ai-generated/
1•Tomte•2m ago•0 comments

A Herculaneum scroll has been read for the first time

https://scrollprize.org/firstscroll
1•verditelabs•2m ago•1 comments

Billionaire's Warning: I'm Selling. The Crash Is Here [video]

https://www.youtube.com/watch?v=32u5T6lO8qk
1•hsnewman•5m ago•0 comments

Claude Code Hints at Fable Return

https://twitter.com/synthwavedd/status/2069813760622043483
2•thedebuglife•5m ago•2 comments

The Trump White House Is over Anthropic CEO Dario Amodei

https://www.wired.com/story/the-trump-white-house-is-over-anthropics-dario-amodei/
1•thedebuglife•6m ago•0 comments

What if some of history's earliest kings were queens?

https://www.nationalgeographic.com/history/article/history-earliest-kings-ur-sumeria
1•bookofjoe•6m ago•0 comments

Route Through Dead Zones. 302x Faster Than Google

https://www.elara-cortex.com/
1•jkuria•6m ago•0 comments

My New Life with the Palantir Chore Coat

https://www.theatlantic.com/technology/2026/06/palantir-chore-coat/687686/
1•jonah•7m ago•0 comments

Anthropic accuses Alibaba of largest distillation attack to date

https://www.cnbc.com/2026/06/24/anthropic-alibaba-distillation-campaign.html
1•paulddraper•7m ago•0 comments

Ask HN: Do you thank your agents when they did a good job?

1•ex-aws-dude•7m ago•0 comments

We're rebuilding financial services with AI

https://arcawealth.ai
1•smalt•11m ago•0 comments

US Supreme Court scales back Roundup cancer lawsuits

https://www.reuters.com/world/us-supreme-court-scales-back-roundup-cancer-lawsuits-2026-06-25/
4•Tomte•14m ago•0 comments

Complete text of carbonised Herculaneum scroll unlocked for first time

https://www.reuters.com/science/complete-text-carbonised-herculaneum-scroll-unlocked-first-time-2...
1•tylerchr•15m ago•0 comments

As banks close accounts, experts point to immigration crackdown

https://www.americanbanker.com/news/as-banks-close-accounts-experts-point-to-immigration-crackdown
6•petethomas•17m ago•1 comments

IBM Debuts First Sub-1 Nanometer Chip Technology

https://newsroom.ibm.com/2026-06-25-ibm-debuts-worlds-first-sub-1-nanometer-chip-technology
3•porridgeraisin•17m ago•0 comments

UK sales of electric vehicles just overtook petrol cars for the first time

https://www.carbonbrief.org/analysis-uk-sales-of-electric-vehicles-just-overtook-petrol-cars-for-...
3•j4mie•17m ago•0 comments

NationStates Turns Twenty (2022)

https://maxbarry.com/2022/11/12/news.html
1•altilunium•19m ago•0 comments

The U.S. last beat screwworm in 1966

https://www.texastribune.org/2026/06/25/texas-screwworm-history-eradication/
3•mzs•19m ago•0 comments

GTA 6 prices by country, $58 in South Korea to $107 in Israel

https://www.shanethegamer.com/esports-news/gta-6-prices-by-country/
2•misbloss•19m ago•0 comments

Gunship: Origins Devlog #1 – Flying the Latest Build [video]

https://www.youtube.com/watch?v=0fWPkThNmzg
1•skibz•20m ago•0 comments

How to Design Arrows

https://pangrampangram.com/blogs/journal/arrows
1•speckx•20m ago•0 comments

Show HN: Clutch – decentralized ride-sharing on-chain (open source)

https://clutchprotocol.io/
1•mehran_mazhar•21m ago•0 comments

Tracking and analyzing 340 AI leaders/blogs to find out what matters

https://brightray.ai/
1•lundbe•21m ago•1 comments

There's One Clear Reason Americans Are Gloomy About A.I

https://www.nytimes.com/2026/06/25/opinion/ai-americans-pessimism.html
1•xbryanx•21m ago•0 comments

Show HN: iOS Apps on Linux

https://github.com/Lore-Hex/QuillUI
1•ljlolel•21m ago•0 comments

Halvar's Guide to Entrepreneurship

https://thomasdullien.github.io/guides/entrepreneurship/
1•nekitamo•22m ago•0 comments

Capabilities.txt

https://www.capabilitiestxt.org/
2•pschmied•24m ago•0 comments