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

Agents' Last Exam: AI Agent Benchmark for Real-World Professional Workflows

https://agents-last-exam.org
1•gurjeet•1m ago•0 comments

The Elements of User Experience

https://designexplained.substack.com/p/the-elements-of-user-experience
1•kaizenb•2m ago•0 comments

How Steve Hilton's Wife, Rachel Whetstone, Conquered California

https://sfstandard.com/2026/07/06/rachel-whetstone-steve-hilton-wife-california-governor/
1•petethomas•2m ago•0 comments

"Blade" type guitar pickups don't pick up horizontal vibration (2015)

https://alexkenis.wordpress.com/2015/10/22/guitar-pickup-theory-1-blade-vs-pole-pieces/
1•kazinator•3m ago•0 comments

Show HN: Finterm.ai Finance CLI for Claude Code and Codex

1•cheeseblubber•3m ago•0 comments

Oh My Pi

https://github.com/can1357/oh-my-pi
1•_superposition_•6m ago•0 comments

MCP for Royalty-Free Music and Sound Effects

https://github.com/tunetank/tunetank-mcp
1•tunetank•7m ago•0 comments

Truecaller clashes with India's telecom regulator over anti-spam rules

https://techcrunch.com/2026/07/08/truecaller-clashes-with-indias-telecom-regulator-over-anti-spam...
1•Brajeshwar•9m ago•0 comments

Help Web Attackers Self Report

https://nochan.net/b/Internet-Crap/20260524-Help-Attackers-Self-Report/
1•Bender•10m ago•0 comments

The Decline of Sumptuousness in Cinema

https://yakimenko.substack.com/p/on-the-decline-of-sumptuousness-in
1•idleplant•11m ago•0 comments

Who Operates Operators?

https://mohamedkadri.substack.com/p/who-operates-the-operators
1•theanonymousone•11m ago•0 comments

Dev productivity metrics suck. Ops reviews are key for AI-accelerated eng orgs

https://www.cortex.io/drive
7•gsdatta•12m ago•1 comments

GLM 5.2 is nearly as accurate as a human book keeper

https://toot-books.pages.dev/blog/glm-5-2-vat-benchmark
2•adamkurkiewicz•13m ago•0 comments

Rage-Inducing Problems in Tech

https://www.theringer.com/2026/05/28/tech/pope-leo-xiv-ai-encyclical-tech-industry-problems
1•Tomte•13m ago•0 comments

Many economists believe that AI will lead to more inflation. Why?

https://www.marketplace.org/story/2026/06/22/why-ai-may-lead-to-more-inflation
2•mapping365•13m ago•0 comments

Who has been caught out by this anti-pattern from Google?

1•Monotoko•14m ago•0 comments

Fed's Williams says AI is now his main inflation concern

https://fortune.com/2026/07/09/federal-reserve-john-williams-says-ai-is-now-his-main-inflation-co...
2•mapping365•14m ago•0 comments

A no-brainer for protecting your brain

https://www.economist.com/leaders/2026/07/09/a-no-brainer-for-protecting-your-brain
2•aloukissas•15m ago•1 comments

The government wants to scare Americans out of sharing the news

https://freedom.press/issues/the-government-wants-to-scare-americans-out-of-sharing-the-news/
2•littlexsparkee•15m ago•0 comments

How to Start a Ruby Meetup

https://guides.rubyevents.org/meetups/
1•mooreds•16m ago•0 comments

Build or buy an agent developer workspace?

https://www.monaco.com/blog/agent-developer-workspaces
1•nutellalover•17m ago•0 comments

Karmic Predicament

https://www.guidavid.com/writing/karmic-predicament
1•gdss•17m ago•0 comments

Anthropic appoints former Fed Chair Ben Bernanke to its independent trust

https://www.cnbc.com/2026/07/09/anthropic-fed-chair-bernanke-independent-trust.html
1•cramer4next•18m ago•0 comments

CEO reveals how he used AI 2 build 1 person company þats $1.3B in debt- Þe Onion [video]

https://www.youtube.com/shorts/YERfTT4McsU
1•notthemessiah•18m ago•0 comments

Show HN: Codex Explorer, a local session manager for Codex CLI

https://github.com/Tobiadefami/codex-explorer
2•tobiadefami•20m ago•0 comments

Head to Head: Muse Spark 1.1 vs. Anthropic: Claude Opus 4.8

https://runtimewire.com/article/head-to-head-muse-spark-1-1-vs-anthropic-claude-opus-4-8
1•ryanmerket•20m ago•0 comments

Nicotine pouches, tobacco's latest ploy

https://med.stanford.edu/news/insights/2026/06/nicotine-pouches-addiction-tobacco-industry-latest...
1•car•22m ago•0 comments

Too Old for Silicon Valley? Think Again. AI Is Changing the Math

https://www.kqed.org/news/12090173/too-old-for-silicon-valley-think-again-ai-is-changing-the-math
1•littlexsparkee•23m ago•0 comments

95% of the announced Nvidia Grace Blackwell GPU has yet to be deployed

https://bsky.app/profile/jessefelder.com/post/3mq7sfics7k2l
1•doener•24m ago•0 comments

Why heatwaves hit women harder

https://www.bbc.com/news/articles/c4gyp1knzzxo
1•bbg2401•26m ago•0 comments