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

Lix

https://lix.systems/
1•Tomte•1m ago•0 comments

Frontier models need only one text to unmask its human or AI author

https://twitter.com/atreydesai/status/2123473074230292737
1•silentnovas•2m ago•1 comments

Show HN: Lintsure – Free local code check with rules from OWASP, EU AI Act

https://github.com/lintsure/lintsure
1•DrMax•2m ago•0 comments

Inside The Codex Sandbox

https://openai.com/index/inside-the-codex-sandbox/
1•gmays•4m ago•0 comments

Design for Understandability

https://jschuster.org/blog/2026/11/19/design-for-understandability/
1•tmsln•4m ago•0 comments

Curve448-Goldilocks

https://en.wikipedia.org/wiki/Curve448
1•uticus•4m ago•0 comments

Should governments slow frontier AI? Jacob Coxon and Robin Hanson debate [video]

https://www.youtube.com/watch?v=lwfewYL7X0o
2•sandslash•5m ago•0 comments

Show HN: Eigin Pays Contributors for Specs

https://contribute.eigin.ai/
1•danielrothmann•6m ago•0 comments

US battery storage has reached 200 GWh milestone

https://electrek.co/2026/11/18/us-battery-storage-just-topped-200-gwh-heres-where-it-is/
1•toomuchtodo•6m ago•1 comments

Hop to the Cheapest Fuel

https://fuel-rabbit.uk/
1•taran_narat•6m ago•0 comments

Accenture launches plan to cut 950 Meta-linked jobs in Portugal

https://www.reuters.com/business/world-at-work/accenture-launches-plan-cut-950-meta-linked-jobs-p...
1•frank_clover•7m ago•0 comments

ZKStamp Proof-100

https://github.com/ZKStamp/Proof100
1•ZKStampProof-10•8m ago•0 comments

Nebius Datacenter Tracker

https://nebius-tracker.vercel.app/datacenter_timeline
1•scapecast•9m ago•0 comments

Hister Is Now Nogon

https://nogon.eu/posts/hister-is-now-nogon
1•ecliptik•9m ago•0 comments

Claude-code's outputs feel longer than usual

1•ms_menardi•10m ago•0 comments

Building an Autonomous Inference System

https://twitter.com/simon_mo_/status/2123133742063706343
1•jinqueeny•10m ago•0 comments

Roman Times – a Roman strategy game, playable in Latin

https://romantimes.eu/
3•cuckovic•10m ago•1 comments

No Bailout for the AI Bubble, Anthropic IPO Protesters Say

https://www.techpolicy.press/no-bailout-for-the-ai-bubble-anthropic-ipo-protesters-say/
3•cdrnsf•11m ago•0 comments

A 3D map of 274 infrastructure megaprojects in the US and Canada

https://miragemetrics.com/infrastructure-map
1•mehdiyac•12m ago•0 comments

SynthEvents: A Year of Events in One Download

https://www.eventfoundation.io/resources/blog/synthevents-a-year-of-events-in-one-download
1•goloroden•12m ago•0 comments

Thirty-Six Percent More Pull Requests, Fifty-Six Percent Longer to Merge

https://gautamparab.com/writing/fifty-six-percent-longer-to-merge/
2•jwilliams•13m ago•0 comments

Apple Executive in Charge of iPhone's Camera App Reportedly Retires

https://www.macrumors.com/2026/11/19/iphone-camera-app-vp-retires/
1•tosh•13m ago•0 comments

It's a bit eerie, don't you think?

https://terfi.fyi/blog/eerie-feeling
1•taran_narat•13m ago•0 comments

Free Jensen Huang

https://freejensenhuang.com
2•NackerHughes•14m ago•1 comments

David Ellison Thinks CBS Can Earn Trust Back [video]

https://www.youtube.com/watch?v=2Jqn1GxyZbc
1•ronfriedhaber•14m ago•0 comments

FCC votes to ban Chinese telecoms from direct access to US phone numbers

https://www.reuters.com/world/fcc-votes-ban-chinese-telecoms-direct-access-us-phone-numbers-2026-...
2•everybodyknows•14m ago•0 comments

Maldon sea salt flakes are made using imported German rock salt

https://observer.co.uk/news/national/article/revealed-how-maldon-sea-flakes-are-made-using-import...
1•sowbug•14m ago•0 comments

Anthropic breaks $2T valuation in market debut

https://www.reuters.com/live/anthropic-ipo-live-claude-maker-goes-public-nasdaq-after-record-shar...
4•NeuraCryption•14m ago•1 comments

Supporting FOSS projects to transition to memory safe tech

https://tweedegolf.nl/en/blog/243/supporting-foss-projects-to-transition-to-memory-safe-tech/
1•wofo•15m ago•0 comments

We asked 29 people building US data centers when AI capacity will arrive

https://www.latolabs.io/studies/ear-to-the-ground/
1•tnch•16m ago•0 comments