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

Surface RTX Spark Dev Box is available for preorder for $5,999

https://www.theverge.com/tech/1006915/microsoft-surface-rtx-spark-dev-box-preorder
1•layer8•2m ago•0 comments

Building Docker images with proot-distro build

https://deepwiki.com/termux/proot-distro/2.5-build-and-push-commands
1•zoobab•3m ago•0 comments

Artificial Negligence

https://hedgehogreview.com/issues/the-fading-promise-of-higher-education/articles/artificial-negl...
1•jruohonen•4m ago•0 comments

Amazon's New 'About You' Page Lists Everything It Knows About You

https://lifehacker.com/tech/use-the-new-about-you-page-to-find-out-how-much-amazon-knows-about-you
2•Markoff•11m ago•1 comments

Disruption to the network of Russian internet and cloud giant Yandex

https://twitter.com/netblocks/status/2108002325143118018
2•defly•11m ago•0 comments

Longshots Losing 98% of Time Dominate Kalshi, Polymarket Trading

https://www.bloomberg.com/news/features/2026-10-07/longshots-losing-98-of-time-dominate-kalshi-po...
1•helsinkiandrew•12m ago•1 comments

Dat-ecosystem: high level applications built on top of P2P protocols

https://dat-ecosystem.org/
2•janandonly•15m ago•0 comments

TinyJoin: A fast browser RDBMS built in Rust

https://tinyjoin.org/
1•jamesgpearce•15m ago•0 comments

I built a file converter that never sees your files

https://toany.io/
1•quangthien27•15m ago•0 comments

People Holding Up the Internet

https://sheets.works/data-viz/holding-up-the-internet
7•simjue•17m ago•0 comments

Wax Motors – A Full Understanding of Operation and Construction [video]

https://www.youtube.com/watch?v=sApyrDEXGAI
1•kamaraju•18m ago•0 comments

Hashbase: Hosting for the Peer-to-Peer Web

https://hashbase.io/
1•janandonly•20m ago•0 comments

The review bottleneck: when AI writes faster than humans can check

https://loopsfinity.com/blog-ai-code-review-bottleneck
1•shymaple•23m ago•0 comments

Sesterce plans a €10B AI campus in Jämsä

https://www.sesterce.com/newsroom/sesterce-plans-ai-campus-kaipola-jamsa-finland
1•Hamuko•24m ago•0 comments

Fluffles-OS

https://github.com/DevelopIQ-ai/fluffles-os
1•handfuloflight•27m ago•0 comments

SpaceX seeks $40B financing to buy Nvidia chips

https://www.cnbc.com/2026/10/07/spacex-nvidia-chips-apollo-financing.html
2•thw_9a83c•28m ago•0 comments

HSBC plans job cuts across UK wealth business in AI push

https://www.ft.com/content/dd553fc2-532c-4afc-a773-47cd7f786260
2•tu7001•28m ago•0 comments

Classic PC demoscene productions running natively in the browser

https://treylorswift.github.io/demoscene-recomp/web/
2•adunk•29m ago•0 comments

AI Crawler Index

https://mojodojo.io/ai-crawler-index
6•zenincognito•32m ago•1 comments

From Mega-Combine to Orchestrator

https://medium.com/@smoking2man/from-mega-combine-to-orchestrator-the-crisis-of-the-universal-too...
1•Aldus551•35m ago•0 comments

Hubs Foundation

https://hubsfoundation.org
1•Towaway69•36m ago•1 comments

Ask HN: Are we losing control of AI?

1•KinetiNode•38m ago•0 comments

Viewport Lab – Open-source responsive tester with sync scroll(no telemetry)

https://github.com/HeartDev0/viewport-lab
1•HeartDEV•44m ago•0 comments

How to Make a Song with AI: A Step-by-Step Guide

https://sunov6ai.com/blog/how-to-make-a-song
1•Moon_Y•46m ago•0 comments

Will AI kill us all

https://virev.ai/blog/will-ai-kill-us-all
3•krenerd•49m ago•1 comments

A Rant about APIs

https://dev.clintonblackburn.com/2026/10/08/a-rant-about-apis.html
3•clintonb•51m ago•0 comments

The Startup That Wants to Build 'Microrobots' with A.I

https://www.nytimes.com/2026/10/07/science/atomic-machines-ai-micro-robots.html
2•timoshishi•56m ago•0 comments

Let's Encrypt: 64-Day Certificate Lifetimes Coming Feb 2027

https://letsencrypt.org/2026/10/07/64-day-certs.html
2•allddd•57m ago•0 comments

Researcher Gets $300 from OpenAI for Major AI Security Flaw

https://x.com/i/trending/2107776361859293195
4•soltanov•57m ago•0 comments

The animals to feature on England's banknotes

https://www.bbc.co.uk/news/articles/cwe8ld517ry3o
2•2dvisio•59m ago•0 comments