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

Free Recoll for Windows

https://github.com/alarmz/recoll
1•ankitg12•4m ago•0 comments

Organized violence 1989–2025, and violent political protests

https://academic.oup.com/jpr/advance-article/doi/10.1093/jopres/xjag046/8703754
2•joveian•7m ago•0 comments

Why Excess Regulation?

https://www.overcomingbias.com/p/why-excess-regulation
1•paulpauper•11m ago•1 comments

PrepPush – Chrome extension turning HackerRank Accepted into GitHub study guide

https://chromewebstore.google.com/detail/preppush/lkbbmepdmkokiapildnhkimcgnofokdd
1•banikt•11m ago•0 comments

Three Labs with a Plan and a Memorandum

https://thezvi.substack.com/p/three-labs-with-a-plan-and-a-memorandum
1•paulpauper•11m ago•0 comments

America, 1898-1914, overview, part 3

https://arnoldkling.substack.com/p/america-1898-1914-overview-part-3
1•paulpauper•12m ago•0 comments

What We Learned Hiring 33 Engineers in Two Weeks

https://www.digitalocean.com/blog/ai-native-engineering-interview
2•RyeCombinator•12m ago•0 comments

When do you guys think Zig will release 1.0?

1•J_Monclare•16m ago•0 comments

The Wild West

https://www.lynalden.com/june-2026-newsletter/
1•jameslk•17m ago•0 comments

Show HN: Claude Code Context Analyzer

https://github.com/manavgup/context-analyzer
1•manavg76•17m ago•0 comments

Lessons We Learned Building a RAG Assistant Without a Separate Vector Database

https://blog.devgenius.io/lessons-we-learned-building-a-rag-assistant-without-a-separate-vector-d...
2•HermitX•20m ago•0 comments

Salesforce lays off employees in a new round of cuts

https://www.businessinsider.com/salesforce-cuts-jobs-agentforce-2026-6
3•toomuchtodo•21m ago•1 comments

Fundamental of Running Agentic Loops

https://www.beontheloop.com/deck
1•shekharupadhaya•32m ago•3 comments

Show HN: Draft an all-time XI and simulate a World Cup run

https://www.perfectworldcup.com
1•ASquare•36m ago•0 comments

Connecticut Approves Plug-In Solar

https://cleantechnica.com/2026/05/30/connecticut-approves-plug-in-solar-its-so-exciting/
2•toomuchtodo•38m ago•1 comments

Canadians told to "Exercise a high degree of caution in Germany"

https://travel.gc.ca/destinations/germany
2•theanonymousone•39m ago•0 comments

Offline streaming speech recognition on iOS with Nvidia Nemotron 3.5 and Core ML

https://github.com/lbj96347/nemotron-3.5-asr-ios
1•lbj96347•49m ago•0 comments

Microsoft's AI chief says superintelligence is near, but won't take your job

https://www.theverge.com/podcast/944138/microsoft-ai-ceo-mustafa-suleyman-superintelligence-agi-o...
1•gnabgib•50m ago•0 comments

Microsoft AI boss no longer believes that AI will replace human workers

https://www.neowin.net/news/microsoft-ai-boss-no-longer-believes-that-ai-will-replace-human-workers/
1•bundie•52m ago•1 comments

Getting Started with OpenAI Models on Amazon Bedrock

https://developers.openai.com/cookbook/examples/partners/aws/openai_models_with_amazon_bedrock
1•gmays•57m ago•0 comments

Initial impressions of Claude Fable 5

https://simonwillison.net/2026/Jun/9/claude-fable-5/
2•mfiguiere•1h ago•1 comments

What Happens If We Break Time

https://www.youtube.com/watch?v=8T4tW67hpJY
2•Asheed•1h ago•0 comments

Fund the tools that keep the internet free

https://internetfreedom.torproject.org/
4•Cider9986•1h ago•0 comments

Grok Build

https://docs.x.ai/build/overview
2•binyu•1h ago•1 comments

Vibe coding my way to a healthy family: Introducing Gamow Labs

https://www.ddmckinnon.com/2026/06/09/vibe-coding-my-way-to-a-healthy-family-introducing-gamow-labs/
3•dmckinno•1h ago•2 comments

Show HN: This Week in Obsidian – Obsidian Newsletter Published Every Tuesday

https://thisweekinobsidian.substack.com/p/this-week-in-obsidian-25
2•boundless88•1h ago•0 comments

Who Owns the Loop?

https://cardeo.substack.com/p/who-owns-the-loop
2•cardeo•1h ago•1 comments

The Evolution of 'More Like This'

https://manticoresearch.com/blog/the-evolution-of-more-like-this/
4•snikolaev•1h ago•0 comments

The Glitch That Broke Link's Cel Shading [video]

https://www.youtube.com/watch?v=By7qcgaqGI4
3•aw1621107•1h ago•0 comments

Show HN: Master – Rails-style full-stack productivity for Node.js

https://bookbag.ai/blog/i-built-master-because-i-missed-rails
2•Rbatista•1h ago•0 comments