frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•11mo 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•11mo 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•11mo 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).

Pete Hegseth quotes a fake Bible verse from Pulp Fiction during Pentagon sermon

https://twitter.com/clashreport/status/2044720988869292038
1•lr0•11s ago•0 comments

Robots Don't Work

https://www.squarehammerlabs.com/blog/robots-dont-work
1•gsteph22•2m ago•0 comments

Generate coherent personas from pop culture universes

https://www.npmjs.com/package/loredata
1•theorchid•4m ago•0 comments

Atomic Operations in Go

https://iampavel.dev/blog/atomic-operations-go
1•birdculture•8m ago•0 comments

The Case for AI "Cooperatives"

https://www.nunodonato.com/the-case-for-ai-cooperatives/
1•nunodonato•8m ago•0 comments

Free airport ride exchange platform

https://airportswap.com/
1•PaulHoule•9m ago•0 comments

A Better R Programming Experience Thanks to Tree-sitter

https://ropensci.org/blog/2026/04/02/tree-sitter-overview/
4•sebg•10m ago•0 comments

AI's Next Frontier: People Skills

https://www.theatlantic.com/technology/2026/04/chatbot-ai-race-emotional-intelligence/686830/
1•paulpauper•10m ago•0 comments

I built a game: convince an AI bouncer you're also an AI in 3 messages

https://www.clankerpass.com/
2•alex-onecard•11m ago•0 comments

History Is Running Backwards

https://www.theatlantic.com/magazine/2026/05/reactionary-traditionalism-worldview/686597/
1•paulpauper•11m ago•0 comments

WordPress needs to refactor, not redecorate

https://joost.blog/wordpress-refactor-not-redecorate/
1•gmays•12m ago•0 comments

The Iterated Surgeon's Dilemma

https://substack.com/@scorry/p-194448803
1•paulpauper•14m ago•0 comments

New AI Paradigm: Communitized RL

https://audn.substack.com/p/from-personalized-to-communitized
1•ozgurozkan999•14m ago•2 comments

FrontierSWE: An ultra-long horizon coding benchmark

https://www.frontierswe.com/
1•justusmattern•18m ago•0 comments

Open-source AI runtime security

https://www.tirreno.com/bat/2026-04-16
1•reconnecting•20m ago•0 comments

Banks' soaring exposure to trading firms creating inherent fragility, warns S&P

https://www.ft.com/content/942b091b-add3-4ffd-911a-6a9d9738f2ea
3•petethomas•22m ago•0 comments

Jane Street signs $6B AI cloud deal with CoreWeave, invests $1B

https://thenextweb.com/news/jane-street-coreweave-6-billion-cloud-1-billion-equity-ai
2•gmays•23m ago•0 comments

KeePassChi – Codeberg.org

https://codeberg.org/keepasschi
2•sharjeelsayed•25m ago•0 comments

Elon Musk buys a fifth of his own Cybertrucks

https://www.msn.com/en-us/money/companies/elon-musk-buys-a-fifth-of-his-own-cybertrucks/ar-AA212Sci
14•petethomas•25m ago•2 comments

We're Hooked on Satellites. It Could Blow Up in Our Faces

https://www.cnet.com/science/space/features/satellite-overcrowding-space-junk-low-earth-orbit-sta...
2•SilverElfin•26m ago•0 comments

Filling DOCX forms: GPT-5.1 broke it, every Claude model handled it

https://varstatt.com/jurij/p/filling-forms-no-tool-can-template
2•jurijtokarski•27m ago•0 comments

Lutnick's old firm pumps $10M into super PAC led by Tether executive

https://www.citationneeded.news/commerce-secretary-howard-lutnicks-old-firm-pumps-10-million-into...
4•petethomas•27m ago•1 comments

US, EU move toward landmark biometric data sharing deal

https://www.biometricupdate.com/202603/us-eu-move-toward-landmark-biometric-data-sharing-deal
4•peq42•28m ago•1 comments

A privacy-first QR code generator (100% client-side, PNG and SVG export)

https://atomnyx.com/tools/qr-code-generator
1•RuBekOn•28m ago•0 comments

TCode: An AI Coding Agent Leverages Neovim and Tmux

https://www.binwang.me/2026-04-12-TCode-An-AI-Coding-Agent-Leverages-Neovim-and-Tmux.html
1•wb14123•29m ago•0 comments

Reed Hastings to Step Down as Netflix Chair

https://www.nytimes.com/2026/04/16/business/media/reed-hastings-netflix-chair.html
1•psychanarch•29m ago•0 comments

Frontier Coding Agents Built a Video Diffusion Pipeline on Max

https://www.modular.com/blog/how-frontier-coding-agents-built-a-video-diffusion-pipeline-on-max
1•visheshdembla•29m ago•0 comments

Scientists Just Created Super-Strong Steel That Never Rusts

https://www.popularmechanics.com/science/green-tech/a70977124/3d-printed-steel/
2•bookofjoe•31m ago•1 comments

The Beginning of Scarcity in AI

https://tomtunguz.com/ai-compute-crisis-2026/
3•gmays•34m ago•0 comments

Mechanical Sympathy

https://vickiboykis.com/2026/04/13/mechanical-sympathy/
1•sebg•35m ago•0 comments