frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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

Why T. Rex had tiny arms

https://nautil.us/we-finally-have-the-answer-for-t-rexs-tiny-arms-1280997
1•marojejian•1m ago•0 comments

Earliest Uses of Various Mathematical Symbols

https://mathshistory.st-andrews.ac.uk/Miller/mathsym/
2•layer8•6m ago•0 comments

Bun.Image

https://bun.com/docs/runtime/image
2•chakintosh•7m ago•0 comments

AI Governance 2026: I Almost Quit over This Shit (and Why You Might Too)

https://medium.com/open-ai/ai-governance-2026-i-almost-quit-over-this-shit-and-why-you-might-too-...
2•sukhpinder0804•12m ago•1 comments

Show HN: Fruitsy, a slot machine game

https://fruitsy.surge.sh
2•stagas•12m ago•0 comments

Jira Is Turing-Complete

https://seriot.ch/computation/jira.html
3•MrFinch•14m ago•0 comments

Codex is flagged as malware on macOS

https://github.com/openai/codex/issues/23195
2•vldszn•14m ago•2 comments

Wildlife is watching us, too – and changing their behavior in response

https://news.yale.edu/2026/05/21/wildlife-watching-us-too-and-changing-their-behavior-response
2•hhs•19m ago•1 comments

BFI Online Video Collection

https://replay.bfi.org.uk/collection/458
1•philo23•19m ago•1 comments

World Machines

https://worldmachines.org/resources
2•jerlendds•20m ago•0 comments

Curious cases of financial engineering in biotech

https://www.owlposting.com/p/curious-cases-of-financial-engineering
1•abhishaike•21m ago•0 comments

Birds can see into the UV spectrum, picking up signals that the human eye cannot

https://www.binghamton.edu/news/story/6207/beyond-black-research-explores-the-feather-color-of-am...
2•hhs•22m ago•0 comments

ParsOS NEXT, Learn how does a GUI works

https://github.com/amirali1390-bit/ParsOS-NEXT
1•amirali901•24m ago•1 comments

Hi-res microscopes give biologists petabytes of data

https://news.berkeley.edu/2026/05/22/hi-res-microscopes-give-biologists-petabytes-of-data-scienti...
2•hhs•24m ago•0 comments

Guinea worm disease nears worldwide elimination, with only 10 cases in 2025

https://www.cidrap.umn.edu/dracunculiasis/guinea-worm-disease-nears-worldwide-elimination-only-10...
2•randycupertino•35m ago•1 comments

Alberta will vote on whether to remain part of Canada. What now?

https://www.bbc.com/news/articles/c809jg1gj9yo
3•tartoran•35m ago•2 comments

Polsia raised $30M; source map: fake ARR, dead users, god-mode over your company

https://zero-arr.vercel.app
18•not-chatgpt•39m ago•7 comments

Don't Roll Your Own

https://susam.net/do-not-roll-your-own.html
10•adunk•40m ago•3 comments

Memdeklaro: Open-source self-sovereign identity

https://memdeklaro.org
3•anonymous123•41m ago•0 comments

Customizing an LLM for Enterprise Software Engineering

https://arxiv.org/abs/2605.16517
3•daureg•41m ago•0 comments

Byrne's Euclid

https://www.c82.net/euclid/
4•layer8•45m ago•1 comments

SpaceX files to go public, and the math requires a little faith

https://techcrunch.com/video/spacex-files-to-go-public-and-the-math-requires-a-little-faith/
3•Timofeibu•50m ago•0 comments

Dirty Frag, Copy Fail, Fragnesia: A Worrisome Linux Security Trend

https://www.theregister.com/security/2026/05/23/dirty-frag-copy-fail-fragnesia-the-start-of-a-wor...
4•Timofeibu•50m ago•0 comments

Inside an N64 Cartridge: How the Hardware Actually Works [video]

https://www.youtube.com/watch?v=4Yix4NzRv9s
3•skibz•51m ago•0 comments

The Crypto Coin was the tell – thoughts on GSD, and it's crypto rugpull

https://vexjoy.com/posts/the-crypto-coin-was-the-tell/
2•AndyNemmity•52m ago•0 comments

The Appreciation Constituency: Land, Credit and the Politics of Protected Assets

https://americanaffairsjournal.org/2026/05/the-appreciation-constituency-land-credit-and-the-poli...
2•robocat•52m ago•0 comments

The Polyglot Protocol – senior-engineer guardrails for AI coding agents

https://github.com/sabir-gbs/the-polyglot-protocol
2•sabirsemerkant•54m ago•0 comments

GLP-1s Linked to Lower Risk of Cancer Spread in Four Tumor Types

https://www.medpagetoday.com/meetingcoverage/asco/121397
3•randycupertino•54m ago•0 comments

CA declares state of emergency as fire crews race to contain toxic chemical leak

https://www.bbc.com/news/articles/c3w2l249j8go
40•borski•56m ago•13 comments

Shamelessly vibecoded rust NTFS driver

https://github.com/christhomas/rust-fs-ntfs
2•chrisalexthomas•58m ago•0 comments