frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

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

A multiplayer poll where you have 10 seconds to answer

https://polls.araoz.net/poll/pilot
1•maraoz•1m ago•0 comments

Did the Soviets Collude in the 1953 Candidates Tournament?

https://lichess.org/@/RuyLopez1000/blog/did-the-soviets-collude-in-the-1953-candidates-tournament...
2•fzliu•10m ago•0 comments

Docker Containers Are Leaking (and How to Plug the Hole)

https://blog.dera.page/posts/dockerwall/
1•Mubelotix•10m ago•0 comments

Engineering Recovery

https://systemsthinkingcollection.substack.com/p/the-three-legged-stool
1•InputName•16m ago•0 comments

Mark Zuckerberg Told 8k Employees Their Layoffs Are a Line Item in AI Bill

https://247wallst.com/investing/2026/05/08/mark-zuckerberg-just-told-8000-employees-their-layoffs...
1•spankibalt•21m ago•1 comments

60fps Video on a CGA? – The GlyphBlaster

https://martypc.blogspot.com/2026/05/60fps-video-on-cga-glyphblaster.html
1•tambourine_man•23m ago•0 comments

Xi's Forever Purge

https://www.foreignaffairs.com/china/xis-forever-purge
2•areoform•23m ago•1 comments

Physics experiment hints at the existence of 'anyon' particles

https://www.sciencedaily.com/releases/2026/05/260508003131.htm
1•johndunne•28m ago•0 comments

Catatumbo Lightning

https://en.wikipedia.org/wiki/Catatumbo_lightning
1•nomilk•29m ago•0 comments

Deskbrid – Linux desktop control over a Unix socket, for agents and scripts

https://github.com/coe0718/deskbrid
2•coe0718•32m ago•0 comments

Kendrick Lamar to an Italian Poet

https://www.youtube.com/watch?v=q5dqCeNEIFU
2•lawgimenez•33m ago•0 comments

24/7 AI-powered radio station. Generates music, writes hosted breaks,speaks them

https://github.com/keltokhy/writ-fm
2•pseudolus•37m ago•0 comments

New York Stock Exchange to open private members' club on Wall Street

https://www.ft.com/content/d8e49edb-feb9-4bfb-9f91-f10169c0961d
1•petethomas•37m ago•0 comments

Abbey Library of Saint Gall

https://en.wikipedia.org/wiki/Abbey_library_of_Saint_Gall
2•peter_d_sherman•40m ago•0 comments

Maryland Power Bills: $1.6B Data Center Subsidy

https://unusualwhales.com/news/maryland-1-6-billion-data-center-power-bill-subsidy
2•gmays•46m ago•0 comments

I built a private memory system for remembering people

https://apps.apple.com/us/app/intriq-remember-people/id6760826319
2•Phangweijun•49m ago•0 comments

FreeBSD Pkgbase Minor Upgrades

https://vermaden.wordpress.com/2026/05/10/freebsd-pkgbase-minor-upgrades/
1•vermaden•55m ago•0 comments

A Framework of Modular Structure – Made Visible Through Representations

https://github.com/A19dammer91/Linear-Diophantine-Representation-Systems-p-1-mod-q-
1•A19dammer91•55m ago•0 comments

Kryptor – Simple, modern, secure file encryption and signing tool

https://www.kryptor.co.uk
2•rickcarlino•1h ago•0 comments

Why Apple Is Launching a Touchscreen MacBook [video]

https://www.youtube.com/watch?v=8zGNeT8fU9Y
2•mgh2•1h ago•0 comments

VBM – a VTT that feels like Saturday night at the game table

https://vbm.games/
2•burtonmiller•1h ago•0 comments

Endo: JavaScript plugin framework with built-in supply chain attack resistance

https://github.com/endojs/endo
2•ignoramous•1h ago•0 comments

In CRHQ, agents don't just reply with text. They ship live HTML artifacts

https://andrej.crhq.ai/artifact/Us0QJs48JGh3dK3uoEDQLw
2•taubek•1h ago•0 comments

Swift bricks to be installed on all new buildings in Scotland

https://www.theguardian.com/environment/2026/jan/28/swift-bricks-to-be-installed-in-all-new-build...
6•bookofjoe•1h ago•1 comments

React-AI-stream – back end-agnostic SSE streaming hook for React

https://github.com/trimooo/react-ai-stream
1•devleoo•1h ago•0 comments

Reducing TTFT by CPUMaxxing Tokenization

https://www.crusoe.ai/resources/blog/reducing-ttft-by-cpumaxxing-tokenization
1•intrepidsoldier•1h ago•0 comments

Kit that converts film to digital

https://www.digitalcameraworld.com/cameras/film-cameras/the-trending-kit-that-converts-film-to-di...
2•Alupis•1h ago•0 comments

Implementation Details of Codex /Goal

https://gist.github.com/patleeman/b1b5768393f9bf2f60865b1defeeb819
1•dnw•1h ago•0 comments

Nocturne Is the Latest Music Player for Gnome to Hit v1.0

https://www.phoronix.com/news/Nocturne-1.0-GNOME-Music
1•Bender•1h ago•0 comments

Canvas Breach Disrupts Schools and Colleges Nationwide

https://krebsonsecurity.com/2026/05/canvas-breach-disrupts-schools-colleges-nationwide/
3•Bender•1h ago•1 comments