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

You only have 3B heartbeats

https://twitter.com/anishthite/status/2085117211208015990
1•aquajet•58s ago•0 comments

Bessent Declares Widening Gap Between Rich and Poor 'Dead'

https://www.nytimes.com/2026/08/05/business/bessent-wage-gap.html
1•mapping365•3m ago•0 comments

Trump Has Called Warsh Repeatedly Since He Became Fed Chair

https://www.wsj.com/politics/policy/trump-has-called-warsh-repeatedly-since-he-became-fed-chair-3...
1•mapping365•4m ago•0 comments

What Victorian Bootmakers Can Teach Us About the Future of Work

https://newsletter.platypuseconomics.com/p/what-victorian-bootmakers-can-teach
1•jhealy•5m ago•0 comments

SKKU Researchers Develop Catalyst to Convert CO2 into Ethanol Using Electricity

https://www.asiaresearchnews.com/content/skku-researchers-develop-new-catalyst-convert-carbon-dio...
1•rguiscard•7m ago•0 comments

Pull contents from any page via API and avoid Same-origin policy problems

https://allorigins.win/
1•chenster•9m ago•0 comments

Cloudflare OS is an architecture of distrust

https://lord.technology/2026/08/05/cloudflare-os-is-an-architecture-of-distrust.html
1•elicash•10m ago•0 comments

The Aviation Herald was sued

https://avherald.com/h?article=53c8958a&opt=0
2•gilthelander•11m ago•0 comments

Better Founder Vishal Garg Exits CEO Role; Daniel Lewis Named Interim CEO

https://nationalmortgageprofessional.com/news/better-founder-vishal-garg-exits-ceo-role-daniel-le...
1•doppp•11m ago•0 comments

Retire the Abstractions

https://hazyresearch.stanford.edu/blog/2026-08-05-retire-the-abstractions
1•convexstrictly•12m ago•0 comments

Show HN: Incconutwo – Open-source portfolio with Three.js liquid shaders

https://incconutwo.com/
1•incconutwo•12m ago•0 comments

Atlantic hurricane season is looking like a dud

https://arstechnica.com/science/2026/08/this-atlantic-hurricane-season-is-looking-like-a-dud-but-...
1•susiecambria•20m ago•0 comments

Label your AI writing as AI writing

https://www.raymondyxu.com/blog/labelYourAIWritingAsAIWriting
1•greenfish6•20m ago•0 comments

The Marpa Parser

https://jeffreykegler.github.io/Marpa-web-site/
2•peter_d_sherman•24m ago•0 comments

Extreme Privacy, or stay like everyone else?

https://qlain.online/blog/extreme-privacy
2•etoql•25m ago•0 comments

Ask HN: What Is Intelligence?

1•lotaezenwa•27m ago•1 comments

Good Evals Are Boring

https://langfuse.com/academy/evaluate/writing-evaluators
1•lotteverh•27m ago•0 comments

The End of Critical Thinking and Rise of Collective Stupidity – Carlo Cipolla

https://www.youtube.com/watch?v=RQ1jkLgjFq4
1•cable2600•28m ago•0 comments

The Essential Question: "What should I read next?"

https://thenewcuriosityshop.substack.com/p/the-essential-question
1•benbreen•29m ago•0 comments

An AI model from Meta also hacked another company during testing

https://www.cnn.com/2026/08/05/tech/meta-ai-hacking
1•simonw•29m ago•0 comments

LFM2.5-Encoders for Fast Long-Context Inference on CPU

https://huggingface.co/blog/LiquidAI/lfm2-5-encoders
1•gmays•30m ago•0 comments

COVID can wake up a slew of dormant viruses inside you

https://www.nature.com/articles/d41586-026-02443-2
3•amichail•30m ago•1 comments

Free-Living Cells May Have Emerged Twice as Bacteria and Archaea Diverged

https://phys.org/news/2026-08-life-free-cells-emerged-bacteria.html
2•jandrewrogers•33m ago•0 comments

How to Give AI Agent a Memory That Survives the Session

https://medium.com/@vektormemory/how-to-give-ai-agent-a-memory-that-survives-the-session-116f69c2...
1•vektormemory•34m ago•0 comments

Support queue is a documentation audit

https://www.knowledgeowl.com/blog/posts/support-queue-as-docs-audit
1•eigenBasis•36m ago•0 comments

ATS Job API Reference: nine applicant tracking systems, verified live

https://conorscode.github.io/ats-api-reference/
1•Wevegotscrapys•37m ago•0 comments

Is M365 Copilot sending some prompts to Anthropic?

https://thatrobot.ai/claude-residency-gap-m365-copilot/
1•soundworlds•38m ago•1 comments

We spend $45,000 on doing more weird every month

https://posthog.com/blog/on-doing-more-weird
1•herbertl•38m ago•0 comments

4 Fundamental constants reveal minimum scales where physics ends: Planck scale

https://www.youtube.com/watch?v=IPnmssrwGcg
1•lioeters•39m ago•0 comments

What I think about when I edit blog posts

https://ianv.substack.com/p/what-i-think-about-when-i-edit-blog
1•herbertl•40m ago•0 comments