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

SwiftUI Is a Disaster

https://ben1777.substack.com/p/swiftui-is-a-disaster
1•bentocorp•2m ago•0 comments

Harvey's Legal Agent Benchmark

https://www.harvey.ai/blog/introducing-harveys-legal-agent-benchmark
1•gmays•4m ago•0 comments

The Ten Commands of the Nine Divines

https://en.uesp.net/wiki/Lore:Ten_Commands:_Nine_Divines
1•alhazrod•6m ago•0 comments

ICE may be at World Cup matches in U.S.

https://www.nbcnews.com/sports/soccer/ice-may-world-cup-matches-us-rcna344797
2•mgh2•6m ago•0 comments

Meta launches WhatsApp 'incognito' mode to address privacy concerns for AI chats

https://apnews.com/article/whatsapp-meta-ai-chatbot-privacy-9a5f7565c969cbf04cf150dfc318cfae
3•devonnull•7m ago•0 comments

Google reports first known real-world AI-crafted zero-day exploit

https://cloud.google.com/blog/topics/threat-intelligence/ai-vulnerability-exploitation-initial-ac...
1•JoheyDev888•7m ago•0 comments

US citizen convicted of running secret Chinese 'police station' in NYC

https://www.bbc.com/news/articles/cy72yy7z1dyo
2•tartoran•11m ago•0 comments

59,000-year-old tooth offers a glimpse into how Neanderthals handled dentistry

https://www.cnn.com/2026/05/13/science/neanderthal-dentistry-stone-drill
1•breve•11m ago•0 comments

Oppositional Federalism: A Taxonomy of State Constitutional Postures Under

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6416178
1•hkhn•12m ago•0 comments

Alberta judge throws out petition seeking for the province separation

https://www.bbc.com/news/articles/clypn8py4zwo
4•tartoran•13m ago•0 comments

New in Claude Code: ‎`/goal` for autonomous dev loops

https://code.claude.com/docs/en/goal
1•Lwrless•13m ago•0 comments

BYD eyes Stellantis EU plant takeover as EV demand spikes

https://electrek.co/2026/05/13/byd-eyes-stellantis-eu-plant-ev-sales-surge-others-too/
3•breve•15m ago•0 comments

Live Design of ABS (2007)

https://web.archive.org/web/20071011040948/http://www.albinoblacksheep.com/livedesign/
1•arm32•16m ago•0 comments

Cerebras prices IPO at $185 per share to raise $5.55B

https://www.reuters.com/legal/government/cerebras-prices-ipo-185-per-share-raise-555-billion-sour...
3•laixintao•19m ago•0 comments

BYD surpasses Tesla as world’s top energy storage deployer

https://electrek.co/2026/05/13/byd-surpasses-tesla-energy-storage-bess-benchmark-2025/
2•breve•21m ago•0 comments

Federalism for Anti-Fascists

https://medium.com/@carmitage/federalism-for-anti-fascists-e83fb20c6fc2
3•hkhn•23m ago•0 comments

Perl versus Java – The Moving Finger (2025)

https://rant.li/ashwin/perl-versus-java
2•pkaeding•24m ago•0 comments

How Bribery Became Legal

https://medium.com/@carmitage/how-bribery-became-legal-b28dbdf0a41c
2•hkhn•26m ago•1 comments

Show HN: Nibble

https://github.com/glouw/nibble
1•glouwbug•26m ago•0 comments

Feedback Welcome – Feline Finder – explainable AI matching for adoptable cats

https://www.felinefinder.info/
1•gregoryew•26m ago•0 comments

Sound Mode: Can TypeScript Type Checking Be Stricter?

https://tsz.dev/sound-mode/
4•mohsen1•28m ago•0 comments

Cisco Workforce Reductions

https://blogs.cisco.com/news/our-path-forward
4•ahmedomran8•34m ago•0 comments

The inventor hoping to fix your washing machine to stop microplastics

https://www.theguardian.com/environment/2026/may/13/you-have-to-be-where-the-pollution-is-the-inv...
3•thunderbong•44m ago•0 comments

China moves to regulate digital humans - Reuters

https://www.reuters.com/world/china/china-moves-regulate-digital-humans-bans-addictive-services-c...
2•Baljhin•45m ago•2 comments

Dungeons & Desktops: Building a Roguelike with GitHub Copilot CLI

https://github.blog/ai-and-ml/github-copilot/dungeons-desktops-building-a-procedurally-generated-...
1•lee337•48m ago•0 comments

Dungeons & Desktops: 10 open source roguelikes that never die

https://github.blog/open-source/gaming/dungeons-desktops-10-roguelikes-that-never-die-because-the...
2•lee337•50m ago•0 comments

Dmitry.gr: Projects

https://dmitry.gr/
1•gurjeet•53m ago•0 comments

delta time

https://www.deltatime.life/
2•mxfh•57m ago•0 comments

Vibe, A single-header lock-free networking library for Linux

https://github.com/xtellect/vibe
2•enduku•59m ago•0 comments

Avoiding and reducing microplastic false positives from dry glove contact

https://pubs.rsc.org/en/content/articlelanding/2026/ay/d5ay01801c
2•efavdb•1h ago•0 comments