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

Turn Any Screenshot into a Shareable Link

https://medium.com/@chris.ahrweiler/turn-any-screenshot-into-a-shareable-link-f7715957f491
1•docjojo•3m ago•0 comments

Ask HN: At what point does "clean architecture" become technical debt?

1•kiops•4m ago•0 comments

Training Dyna-2 at million-hour scale, repeatably

https://www.dyna.co/research/dyna-2-infrastructure
1•intrepidsoldier•5m ago•0 comments

Arrested for a Late Manuscript: Seicho Matsumoto's 'Tokyo Express'

https://www.millersbookreview.com/p/arrested-for-a-late-manuscript-seicho-matsumoto-tokyo-express
1•benbreen•6m ago•0 comments

3D Chesss

https://www.chesss.xyz
1•niksda•8m ago•0 comments

Anonymization isn't a property of data, it's a relationship

https://medium.com/@contador-alencar/on-anonymizing-data-without-hiding-behind-the-law-799c8238fad1
1•firmacon•9m ago•0 comments

Ask HN: If you dislike AI, why don't you prove it?

1•SuboptimalEng•13m ago•1 comments

Treating Dockerfiles as shell scripts (2020)

https://jakewharton.com/treating-dockerfiles-as-shell-scripts/
2•hard_times•14m ago•0 comments

Nao7 Project

https://maxtronics.com/en/nao7/
1•Bluestein•14m ago•0 comments

If I Could Only Do One Exercise, It Would Be Squats

https://julienreszka.com/blog/if-i-could-only-do-one-exercise-it-would-be-squats/
1•julienreszka•15m ago•0 comments

Show HN: Riyadh Tech Week – a year-round guide to Saudi Arabia's tech ecosystem

https://riyadhtechweek.com/
2•aidarousheikh•18m ago•0 comments

Anthropic IPO filing will show AI backlash as a risk factor, sources say

https://www.cnbc.com/2026/08/21/-anthropic-ipo-filing-will-show-ai-backlash-as-risk-sources-say.html
2•newsomix9xl•18m ago•0 comments

The Machinery of Servitude

https://the-machinery-of-servitude.netlify.app/
2•vibeaidden•19m ago•0 comments

Show HN: Structural code grep across public GitHub repositories

https://grep.codemod.com/
3•mohebifar•20m ago•0 comments

Fintex on X: "The Math of Why Bigger AI Keeps Getting Smarter (Scaling Laws)

https://twitter.com/_yusufknl/status/2090429393139097948
2•bilsbie•23m ago•0 comments

That's Rich: Crashing Monterey Car Week

https://www.insidehook.com/autos/thats-rich-crashing-monterey-car-week
2•RickJWagner•26m ago•1 comments

The Billion-Dollar Industry That's Keeping Your Beer Cold and Saving Lives

https://www.texasmonthly.com/culture/billion-dollar-packaged-ice-industry-reddy/
1•momentmaker•27m ago•0 comments

Greenwich moon time? The high-stakes race to set lunar clocks

https://www.ft.com/content/d09e9c05-60c8-4c8a-8230-a5476a049b88
2•cl42•29m ago•0 comments

AI and Chauffeur Knowledge

https://www.aaron-gray.com/ai-and-chauffeur-knowledge/
1•aarongray•29m ago•0 comments

Learning about "The Unix Time-Sharing System"

https://playtechnique.io/long/the-unix-time-sharing-system.html
1•gwynforthewyn•30m ago•1 comments

Treat your brain like a baby

https://gisbi.me/blog/treat-your-brain-like-a-baby
1•Gisbitus•33m ago•0 comments

Memories stick around even after half the synapses are gone

https://arstechnica.com/science/2026/08/memories-stick-around-even-after-half-the-synapses-are-gone/
2•sbulaev•34m ago•0 comments

The war on data centres is a bit fake

https://www.economist.com/business/2026/08/19/the-war-on-data-centres-is-a-bit-fake
2•edward•34m ago•0 comments

A Chrome extension to filter X (Twitter) posts by country or region

https://chromewebstore.google.com/detail/country-filter-for-x-twit/cocohplmilpblbkoikolbhakjipccioa
2•apoorvdarshan•35m ago•0 comments

ReiserFS

https://en.wikipedia.org/wiki/ReiserFS
1•tosh•36m ago•0 comments

Full Self-Driving Is the Best Thing about the New Tesla Model Y

https://www.wsj.com/lifestyle/cars/tesla-model-y-review-13d303c1
2•bookofjoe•36m ago•1 comments

Agency Costs of Free Cash Flow, Corporate Finance and Takeovers [pdf]

https://www.liuyanecon.com/wp-content/uploads/Jensen-1986.pdf
1•highfrequency•37m ago•0 comments

Thruact – agents name a job, not a vendor

https://thruact.com
1•itsparkstime•41m ago•0 comments

The Pyramid Community Relay

https://spatianostra.com/the-pyramid-community-relay/
1•Bluestein•42m ago•0 comments

Show HN: AI as Cognitive Gym Equipment

https://bookerapp.replit.app/book/ai-cognitive-gym/ai-as-cognitive-gym-equipment
1•ersinesen•43m ago•0 comments