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

Version Control System with Antigravity

https://antigravity.google/blog/vcs-and-terminal
1•andrewstetsenko•1m ago•0 comments

StyleX – styling system for ambitious interfaces

https://stylexjs.com
1•twalichiewicz•1m ago•0 comments

Plaud's new earphones come with an eSIM-enabled case for talking to AI agents

https://techcrunch.com/2026/08/27/plauds-new-earphones-come-with-an-esim-enabled-case-for-talking...
2•thm•5m ago•0 comments

Emacs 31: An unofficial guide to Markdown-ts-mode

https://rahuljuliato.com/posts/markdown-ts-mode-emacs-31
1•RahulMJ•7m ago•0 comments

Sunshine

https://www.guidavid.com/writing/sunshine
1•gdss•8m ago•0 comments

EU slips further behind China, US in race for critical minerals

https://www.ft.com/content/c6220205-ee40-4b71-95c0-d53399a17cd1
1•alephnerd•9m ago•0 comments

Mljar Studio: The Claude Code for Data Science

https://www.youtube.com/watch?v=rIn32b8P7Ns
1•pplonski86•11m ago•0 comments

Why LLMs keep failing their Big Five personality tests

https://hollisrobbinsanecdotal.substack.com/p/teaching-the-ocean-to-swim
1•HR01•12m ago•0 comments

Show HN: RealDiff – runtime behavior diffing for pull requests (six languages)

https://github.com/issacnitin/RealDiff
1•issacnitin•12m ago•0 comments

Cohere Parse: Enterprise document intelligence at scale

https://cohere.com/blog/parse
3•tulpa•13m ago•0 comments

Show HN: KnotQ – Calendar and Organization Planner

https://www.knotq.com/
2•enigmurl•13m ago•0 comments

The Breed Is Back Commodore Is Back Alien Breed 35th Anniversary Collection [video]

https://www.youtube.com/watch?v=8Ck3vhJ6S_E
2•doener•13m ago•0 comments

I didn't plan to let an AI manage my to-do list

https://heyjonny.dev/posts/ai-managing-my-to-do-list/
2•heyjonny•13m ago•0 comments

Piloting the first double-blind AI evaluations

https://deepmind.google/blog/piloting-the-worlds-first-double-blind-ai-evaluations/
2•xnx•15m ago•0 comments

Aphantasia Beginner's Guide

https://aphantasia.com/guide
4•ksec•15m ago•1 comments

A self-hostable MCP for all your connections, memory, skills, and secrets

https://www.npmjs.com/package/@lanes-sh/link
3•s-xyz•16m ago•0 comments

US Government Designates Host of Noblogs.org a "Global Terrorist"

https://crimethinc.com/2026/08/27/us-government-designates-host-of-noblogsorg-a-global-terrorist
6•robtherobber•17m ago•0 comments

Show HN: BirthdayVideoAI – AI birthday video maker for wishes, invitations

https://birthdayvideo.ai
2•BirthdayVideo•18m ago•0 comments

Building my first SaaS without a coding background

https://www.indiehackers.com/post/building-my-first-saas-without-a-coding-background-ba8468081a
2•zahvox•18m ago•0 comments

Hot Chips 2026: Fujitsu's Monaka CPU – By Chester Lam

https://chipsandcheese.com/p/hot-chips-2026-fujitsus-monaka-cpu
3•rbanffy•20m ago•0 comments

Hot Chips 2026: Intel's Crescent Island – By George Cozma

https://chipsandcheese.com/p/hot-chips-2026-intels-crescent-island
2•rbanffy•20m ago•0 comments

No moving average wins twice

https://turnmarks.com/filters
1•tapweights•22m ago•0 comments

MIT's Ad Hoc Committee on AI Use in Teaching, Learning, and Research Training

https://aiandeducation.mit.edu/report/
2•pbui•22m ago•0 comments

Shieldprompt – test your LLM against prompt injection – no dependencies

https://github.com/Jograph17/shieldprompt
2•Jograoh17•22m ago•0 comments

Confdiff – semantic diff for config files (JSON/YAML/TOML) that redacts secrets

https://github.com/esperanza-volkov/confdiff
1•esperanzavolkov•22m ago•0 comments

Another Webpage Screenshot and OG Image Generation API

1•foodpad•22m ago•0 comments

The difference orbit inclination makes

https://www.johndcook.com/blog/2026/08/22/inclination/
1•ibobev•23m ago•0 comments

Poisson Rate Limiting (2024)

https://louisabraham.github.io/articles/poisson-rate-limiting
1•Bluestein•23m ago•0 comments

Coming Soon

https://www.johndcook.com/blog/2026/08/22/coming-soon/
1•ibobev•23m ago•0 comments

How would you know whether an ancient culture had zero?

https://www.johndcook.com/blog/2026/08/21/ancient-number-system/
1•ibobev•24m ago•0 comments