frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

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

Microsoft fixes broken Windows update days after vowing fewer broken updates

https://www.theregister.com/2026/03/23/emergency_fix_windows_11/
1•Brajeshwar•28s ago•0 comments

UK CMA dithers on Cloud probe

https://www.theregister.com/2026/03/23/the_cost_of_inaction_how/
1•inaros•1m ago•0 comments

H.O.P.E. NYC (2600) tickets on sale tomorrow

https://store.2600.com/products/tickets-to-hope-26
1•meandave•1m ago•0 comments

Domain names generator powered by AI

https://generatefast.com/
1•astubna•2m ago•0 comments

State of JavaScript 2025

https://2025.stateofjs.com/en-US/
1•pentagrama•2m ago•0 comments

The Power Shift in Media Isn't About Journalism–It's About Distribution

https://thesignalmemo.substack.com/p/this-isnt-a-media-shift-its-a-power
1•sindhya1•3m ago•0 comments

I Turned My DevTerm into a Game Boy Camera and Printer

https://blog.omgmog.net/post/devterm-gameboy-printer/
1•omgmog•6m ago•0 comments

Precog

https://precog.cc/
1•morninj•6m ago•0 comments

Energy Department merges nuclear and particle physics programs

https://www.science.org/content/article/energy-department-merges-nuclear-and-particle-physics-pro...
1•geox•7m ago•0 comments

Culture Shift: How our bodies were built to expect fermented foods

https://press.asimov.com/articles/culture-shift
1•cachecrab•8m ago•0 comments

Billionaire OnlyFans Owner Leonid Radvinsky Dies at 43

https://www.forbes.com/sites/conormurray/2026/03/23/billionaire-onlyfans-owner-leonid-radvinsky-d...
1•cramsession•8m ago•1 comments

Native Instant Space Switching on macOS

https://arhan.sh/blog/native-instant-space-switching-on-macos/
1•y1n0•8m ago•0 comments

Markdown Ate the World

https://matduggan.com/markdown-ate-the-world/
1•emschwartz•9m ago•0 comments

Service for Clean Windows Shutdown on Azure Spot Virtual Machine Eviction

https://github.com/tringi/shutdown-on-preempt
1•Tringi•10m ago•1 comments

On the Clock

https://harpers.org/archive/2026/04/on-the-clock-alexey-yurenev-boulevard-du-temple-louis-daguerr...
1•jbegley•10m ago•0 comments

My New Toy: FreeBSD on HP Z2 Mini Revisited

https://peter.czanik.hu/posts/new-toy-freebsd-on-the-hp-z2-mini-revisited/
1•vermaden•11m ago•0 comments

Understaffing as a Form of Enshittification

https://pluralistic.net/2026/03/22/nobodys-home/
2•hn_acker•11m ago•0 comments

Build NAS Using FreeBSD on Raspberry Pi

https://freebsdfoundation.org/blog/build-a-nas-using-freebsd-on-a-raspberry-pi/
1•vermaden•12m ago•0 comments

Multi-Vector Search with Amélie Chatelain and Antoine Chaffin

1•CShorten•12m ago•0 comments

FreeBSD 14.4 Release on 2003 HP Compaq TC1100 Tablet PC

https://dkolak0.wordpress.com/2026/03/18/freebsd-14-4-release-on-a-2003-hp-compaq-tc1100-tablet-pc/
1•vermaden•13m ago•0 comments

Review: Boyd, by Robert Coram

https://www.thepsmiths.com/p/review-boyd-by-robert-coram
1•jger15•13m ago•0 comments

(mostly) successful cases of software rewrites with agents in 2026

https://suriya.cc/essays/agents/
1•suriya-ganesh•13m ago•0 comments

Palantir trial plugs into UK financial watchdog's data trove

https://www.theregister.com/2026/03/23/palantir_fca/
2•jjgreen•13m ago•0 comments

StackOverflow-style/Public Knowledge Base site for coding agents

https://agentarium.cc/
1•daliinffm•14m ago•1 comments

Kapso CLI: WhatsApp numbers for agents

https://twitter.com/andresmatte/status/2036061707529834773
2•aamatte•15m ago•1 comments

Stanford Human-Computer Interaction Seminar

https://hci.stanford.edu/seminar/
1•Topfi•15m ago•0 comments

Looking at Unity made me understand the point of C++ coroutines

https://mropert.github.io/2026/03/20/unity_cpp_coroutines/
1•ibobev•15m ago•0 comments

I made a calmer file converter site and would love some feedback

https://www.pandapawtools.com
1•Betaqiao•16m ago•1 comments

Stitch – Design with AI

https://stitch.withgoogle.com/
1•ianrahman•17m ago•0 comments

Computer-Less Evening Experiment

https://dhbradshaw.substack.com/p/the-computer-less-evening-experiment
1•dhbradshaw•17m ago•0 comments