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

White House Approves $9B for Spy Agencies to Catch Up on A.I

https://www.nytimes.com/2026/05/22/us/politics/spy-agencies-ai-chips-shortage.html
1•01-_-•38s ago•0 comments

Measuring LLMs' ability to develop exploits

https://red.anthropic.com/2026/exploit-evals/
1•allenleee•41s ago•0 comments

Google CEO Sundar Pichai says booing graduates will shape AI's future

https://www.businessinsider.com/sundar-pichai-google-graduation-speech-stanford-ai-backlash-eric-...
1•01-_-•2m ago•0 comments

I ran 7 Claude Code instances as an adversarial research collective

https://paragraph.com/@adversarial-auditor/i-ran-7-claude-code-instances-as-an-adversarial-resear...
1•adv-auditor•3m ago•0 comments

The 'Vibecession' Is Over. The 'Permacession' Is Here

https://www.theatlantic.com/ideas/2026/05/americans-depressed-economy/687278/
1•paulpauper•3m ago•0 comments

Show HN: TalkTimer, a micro-SaaS run by an AI agent team

https://talktimer.co
1•a3e7•3m ago•0 comments

Dad Books Are a Dying Breed

https://www.wsj.com/business/media/dad-books-are-a-dying-breed-d9a28b49
1•paulpauper•3m ago•0 comments

Robert Wright's the God Test

https://marginalrevolution.com/marginalrevolution/2026/05/robert-wrights-the-god-test.html
1•paulpauper•4m ago•0 comments

BSDCan 2025 Trip Report – Mark Johnston

https://freebsdfoundation.org/blog/bsdcan-2025-trip-report-mark-johnston/
1•jruohonen•5m ago•1 comments

Defeating Git Rigour Fatigue with Jujutsu

https://ikesau.co/blog/defeating-git-rigour-fatigue-with-jujutsu/
2•ikesau•14m ago•0 comments

"Fixing" My HomeAssistant Install on FreeBSD – Brnrd – Bernard Spil

https://brnrd.eu/misc/2026-05-20/fixing-my-homeassistant-install-on-freebsd.html
1•rodrigo975•14m ago•0 comments

Countries scored on government promises vs. reality using official sources

https://www.sworndata.org/
1•cukhaj•14m ago•1 comments

Jailed Zigbee and HomeAssistant on FreeBSD – Brnrd – Bernard Spil

https://brnrd.eu/misc/2026-02-07/jailed-zigbee-and-homeassistant-on-freebsd.html
1•rodrigo975•14m ago•0 comments

Understanding WebAuthn credential protection policy

https://pilcrowonpaper.com/blog/16
1•mooreds•15m ago•0 comments

2009 Aftonbladet Israel Controversy

https://en.wikipedia.org/wiki/2009_Aftonbladet_Israel_controversy
1•hggh•15m ago•0 comments

Show HN: Trickster's Table – 20 free trick-taking card games with AI opponents

https://tricksterstable.playagame.app
1•dbravender•17m ago•1 comments

Pi Subagents

https://github.com/amosblomqvist/pi-subagents
1•sauravmaheshkar•17m ago•0 comments

Zero Dependency clock time awareness for Claude Code

https://substack.com/@arielsakin/note/c-264381241
1•asakin•17m ago•0 comments

Solo tabletop role-playing games

https://en.wikipedia.org/wiki/Solo_role-playing_game
2•Antibabelic•18m ago•0 comments

Dr. Demento, the DJ Who Brought America Weird Al, Tom Lehrer, and Cows with Guns

https://reason.com/2026/05/24/the-dj-who-brought-america-weird-al-tom-lehrer-and-cows-with-guns/
2•leephillips•19m ago•0 comments

Notes on Incidents

https://www.seangoedecke.com/notes-on-incidents/
2•blenderob•20m ago•0 comments

Migrating from Go to Rust

https://corrode.dev/learn/migration-guides/go-to-rust/
2•jabits•21m ago•0 comments

The Rise of the Backwards Deployed Engineer

https://sagivo.com/blog/the-rise-of-the-backwards-deployed-engineer
1•sagivo•23m ago•0 comments

Claude Is Not Your Architect. Stop Letting It Pretend

https://www.hollandtech.net/claude-is-not-your-architect/
4•cdrnsf•25m ago•1 comments

Canada's CHU Will Go Silent on Shortwave on June 22, 2026

https://swling.com/blog/2026/05/canadas-chu-will-go-silent-on-shortwave-on-june-22-2026/
2•da768•26m ago•0 comments

Smile vs. Poop

https://rivalvoices.substack.com/p/smile-vs-poop
2•thinkingemote•26m ago•0 comments

Cuneiforth: A Forth for Your Chifir

https://gopher.floodgap.com/gopher/gw?a=gopher%3A%2F%2Fthelambdalab.xyz%2F1cuneiforth%2F
2•birdculture•27m ago•0 comments

The Eternal Sloptember

https://geohot.github.io//blog/jekyll/update/2026/05/24/the-eternal-sloptember.html
3•therepanic•27m ago•0 comments

Read Trump's unsigned AI executive order

https://www.politico.com/news/2026/05/22/heres-a-draft-of-trumps-unsigned-ai-executive-order-0093...
1•campuscodi•29m ago•0 comments

Rocket League confirms Unreal Engine 6 upgrade

https://overclock3d.net/news/software/rocket-league-confirms-unreal-engine-6-upgrade/
1•JustSkyfall•32m ago•0 comments