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

Show HN: ContextLens- Highlight any text, get context-relevant meaning instantly

https://chromewebstore.google.com/detail/contextlens/jdiojebiogbpkigohjijfnmccfniiago
1•qtcapybara•17s ago•0 comments

Between-Device Sharing Still Sucks

https://hackaday.com/2026/05/20/between-device-sharing-still-sucks/
1•dTal•28s ago•0 comments

Why do Indian trucks say "Horn OK Please"?

https://www.postoast.com/horn-ok-please-behind-trucks-meaning/
1•thunderbong•50s ago•0 comments

Show HN: Privacy Focused Voice Journal

1•rahilb•2m ago•0 comments

Kickstarting "The Reverse Centaur's Guide to Life After AI"

https://pluralistic.net/2026/05/14/who-it-does-it-for/
1•hn_acker•3m ago•0 comments

The Transit Trilemma

https://springbett.substack.com/p/the-transit-trilemma
1•baud147258•4m ago•0 comments

Free, Easy, Dead: The Difficult Birth and Predictable Death of IRS Direct File

https://defector.com/free-easy-dead-the-difficult-birth-and-predictable-death-of-irs-direct-file
2•mattbowen•6m ago•0 comments

Victory: Tennessee man jailed 37 days for Trump meme wins $835,000 settlement

https://www.fire.org/news/victory-tennessee-man-jailed-37-days-trump-meme-wins-835000-settlement-...
2•ceejayoz•6m ago•0 comments

Ontario university sues YouTube prankster for viral videos filmed on campus

https://nationalpost.com/news/canada/ontario-university-going-after-youtube-prankster-for-viral-v...
2•sbdaman•8m ago•0 comments

Show HN: Free AI headshots from one selfie, no signup

https://freeheadshot.org
1•alshanty•11m ago•0 comments

Show HN: Synthra – I got tired of gluing config sources together in Go

https://github.com/gopherly/synthra
1•atkrad•11m ago•0 comments

Huawei zero-day attack behind last years crash of Luxembourgs telecoms network

https://therecord.media/huawei-zero-day-behind-last-year-luxembourg-telecom-outage
2•DavideNL•12m ago•0 comments

Show HN: DSCode – A VS Code-compatible editor built as a kit of Rust crates

https://github.com/dipankar/dscode
1•ticktockten•14m ago•0 comments

Russians Fear Ukraine "Slaughterbot" Drones Are Head-Hunting Them

https://www.forbes.com/sites/davidhambling/2026/05/19/slaughterbots-now-ukraines-head-hunting-dro...
3•dist-epoch•15m ago•1 comments

Scientists reveal how seven days of fasting transforms the human body

https://www.sciencedaily.com/releases/2026/05/260517030404.htm
2•PaulHoule•15m ago•0 comments

Yearslong fight over users' right to tweak smart TV software heads to trial

https://arstechnica.com/gadgets/2026/05/inside-the-fight-to-force-vizio-to-share-linux-based-sour...
3•sohkamyung•16m ago•0 comments

PromptVC, version control for prompts in production

https://www.promptvc.io/blog/introducing-promptvc
1•justicea83•16m ago•0 comments

Active Graph: event-sourced reactive graph runtime for long-running agents

https://twitter.com/yoheinakajima/status/2057099245430222926
1•yoheinakajima•17m ago•0 comments

Ask HN: Suggest Google Antigravity Alternative

2•Pallavimdb•17m ago•0 comments

Swap tables, flash-friendly swap, swap_ops, and more

https://lwn.net/SubscriberLink/1072657/394b87abd7cc215e/
1•mkesper•20m ago•0 comments

SemOpenAlex: Scholarly RDF Knowledge Graph

https://semopenalex.org/resource/semopenalex:UniversalSearch
1•cernocky•21m ago•0 comments

Vulcan Brands – e-commerce store for rigging and cargo control hardware

https://vulcanbrands.com/
1•techyouknow•21m ago•0 comments

$15 Script. $0.41/Day System. Full Stack Going Open Source

https://alanscottencinas.medium.com/how-i-turned-one-15-python-file-into-a-0-41-day-5b43914a226b
2•encinas88•22m ago•0 comments

Flows vs. Tests: Per-Test Billing Broke QA

https://medium.com/@kkhaag/flows-vs-tests-per-test-billing-broke-qa-720fbfc3b899
1•k4224•22m ago•0 comments

Former congressman Barney Frank has died

https://www.nbcnews.com/news/us-news/former-rep-barney-frank-champion-wall-street-reform-lgbtq-tr...
6•lode•24m ago•0 comments

Google Universal Cart

https://twitter.com/Google/status/2056798395377832214
1•tzury•24m ago•0 comments

Reconciling Enterprise AI Revenue

https://philippdubach.com/posts/reconciling-enterprise-ai-revenue/
1•7777777phil•25m ago•0 comments

The Bipolar Lisp Programmer (2007)

https://www.marktarver.com/bipolar.html
1•caminanteblanco•26m ago•0 comments

A Machine to Confess To

https://alexlys.dev/blog/ai-confessional/
1•alexlysdev•26m ago•0 comments

TokenScale – AI API pricing in words you know (The Hobbit = $0.06)

https://tokenscale.dev
2•willbilton•27m ago•0 comments