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

RFC 1149: Standard for the transmission of IP datagrams on avian carriers

https://www.rfc-editor.org/info/rfc1149/
1•JumpCrisscross•2m ago•0 comments

Show HN: Sortaballs – alternative modes for classic sort ball puzzle

https://sortaballs.vercel.app
1•self_refactor•4m ago•0 comments

The future in old computer magazines (1984–2004)

https://tomorrowasusual.substack.com/p/blast-from-the-past-the-future-in
2•tudell•4m ago•1 comments

Show HN: Mistake Trainer – Spaced repetition from your own Lichess games

https://mistake-trainer.pages.dev/
1•pandigital•4m ago•0 comments

Security doesn't (always) have to be so fucking annoying

https://joshua.hu/security-useless-changes-theatre
1•subset•6m ago•0 comments

Hackers raised freezer temperature at Estonian supermarket chain to +50°C

https://news.err.ee/1610183296/hackers-raised-freezer-temperature-at-estonian-supermarket-chain-t...
4•vintagedave•9m ago•0 comments

Aletheia, a Fake News Detector

https://hellenicdev.substack.com/p/hellenicdev-newsletter-009
3•hsoc•9m ago•0 comments

Querying HackerTube, HackerBooks and Wikihack Directly with DuckDB/Hugging Face

https://www.ssp.sh/brain/querying-hackernews-with-duckdb-directly/
1•zazuke•11m ago•0 comments

Are you sure it was North Korea?

https://nk-ultra.com
1•splintersio•11m ago•1 comments

Minimax-Converter Toolbox

https://minimax-converter.com/
1•justvlaaaad•15m ago•1 comments

Redlib discussion: Reddit has decided to force everyone to log in

https://github.com/redlib-org/redlib/issues/609
3•probably_wrong•16m ago•0 comments

Prompt Engineering Is Dead. What Separates a Toy from a Product

https://towardsdev.com/prompt-engineering-is-dead-system-prompt-architecture-is-what-separates-a-...
1•cheikhdev•17m ago•0 comments

Show HN: Knock – stop Claude Code burning tokens exploring big codebases

https://github.com/HasanGilani/knock
1•HasanGilani•18m ago•0 comments

Cyberattack on Fridges in Ireland

https://www.irishtimes.com/technology/data-security/2026/11/02/supervalu-removes-frozen-and-chill...
1•johnflan•18m ago•0 comments

Context Anxiety: How AI Agents Panic About Their Perceived Context Windows

https://inkeep.com/blog/context-anxiety
1•ankitg12•19m ago•0 comments

Ten Surprises in Google Workspace's Sharing Model

https://deployed-ai.io/blog/google-workspace-sharing-surprises/
1•danielklnstein•24m ago•0 comments

TinyContext Guide – How to Add Long-Term Memory to an AI Agent (Step by Step)

https://tinysuite.dev/blog/how-to-add-memory-to-ai-agent/
1•MarcBuilds01•27m ago•0 comments

Show HN: Individual podcast episodes as recommended by HN

https://sunmer.github.io/podcast-radio/
2•podnami•33m ago•1 comments

Replacing the Stadia cloud with a server on my LAN

https://jkfran.com/stadia-controller-revival-stadiacast/
2•jkfran•33m ago•0 comments

ReBirth RB-338 Reimplementation

https://github.com/pingw33n/openrb-338
2•larodi•36m ago•2 comments

Show HN: Take a break, play some puzzles

https://gridmino.com/
2•marko-projects•38m ago•2 comments

France's Weird Per-Gigabyte Data Tax Could Cost VLC over €1M a Year

https://itsfoss.com/news/vlc-outrage-at-french-internet-tax/
4•giuliomagnifico•39m ago•3 comments

Ask HN: Do you think AI has now disrupted math more than it did programming?

3•theanonymousone•39m ago•1 comments

The Commanding Heights music video in the style of 'The Streets'

https://twitter.com/recborg/status/2117184941989511285
1•mkrecny•40m ago•1 comments

Hacker Pager: an ESP32 and SX1262 LoRa wireless development platform

https://www.hackerpager.net/
1•bananascholar•41m ago•0 comments

Seventy Years of Allen Ginsberg's 'Howl'

https://thedispatch.com/article/allen-ginsberg-howl-counterculture/
1•tkgally•42m ago•0 comments

Sam Altman on Local AI

https://www.pcmag.com/news/sam-altman-suggests-running-ai-locally-is-a-waste-of-memory
3•bozdemir•42m ago•4 comments

AI Knittaker

https://www.visiticeland.com/aiknittakers/
1•falcor84•43m ago•0 comments

The Year Math Changed Forever

https://www.newyorker.com/magazine/2026/11/09/the-year-math-changed-forever
1•theanonymousone•45m ago•0 comments

Choices that shape how you experience life, health, purpose and creative power

https://randomfuckingknowledge.substack.com/p/the-four-choices-that-change-how
1•TheCreativePrin•47m ago•0 comments