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

Google Is Paving a New Information Superhighway

https://warnercrocker.com/2026/05/23/google-is-paving-a-new-information-superhighway/
1•cdrnsf•56s ago•0 comments

Monthly News – May 2026

https://blog.linuxmint.com/?p=5025
1•paulnpace•1m ago•0 comments

Why are Flathub downloads so slow sometimes?

https://barthalion.blog/flathub-internals-cdn-and-deltas/
1•speckx•1m ago•0 comments

Soupault: A static website management tool

https://soupault.net/
1•Tomte•1m ago•0 comments

Google is pitching an AI agent ecosystem to consumers who may not buy it

https://techcrunch.com/2026/05/21/google-is-pitching-an-ai-agent-ecosystem-to-consumers-who-may-n...
1•cdrnsf•3m ago•0 comments

HTML-XML-Utils

https://www.w3.org/Tools/HTML-XML-utils/README
1•Tomte•7m ago•0 comments

An automated A.I. WWE news channel on YouTube tries to pronounce "WWE"

https://twitter.com/LarryBundyJr/status/2058140468219707566
1•YeGoblynQueenne•8m ago•0 comments

Claude Code MIT Dashboard

https://github.com/BEKO2210/My_Dash
1•Beko2210•11m ago•1 comments

Google's AI Search Is So Broken It Can 'Disregard' What You're Looking For

https://www.theverge.com/tech/936176/google-ai-overviews-search-disregard
1•Brajeshwar•13m ago•0 comments

Picovoice Discointinues Free Tier

https://console.picovoice.ai/
1•vghaisas•13m ago•2 comments

LogiWebConnect – Working on Linux

https://github.com/shneeba/logiwebconnect-mirror
1•properbrew•14m ago•1 comments

Reverse engineering circuitry in a Spacelab computer from 1980

https://www.righto.com/2026/05/reverse-engineering-spacelab-computer.html
3•elpocko•15m ago•0 comments

Data centers could be good for your hometown

https://www.vox.com/politics/488754/data-centers-ban-electric-bill-water
2•dabinat•18m ago•1 comments

'A Total Nightmare': Voices from a Moscow Hit by Ukrainian Drones

https://www.nytimes.com/2026/05/23/world/europe/moscow-drone-attacks-ukraine.html
4•JumpCrisscross•18m ago•1 comments

What Lamarck's Giraffe Got Right

https://nautil.us/what-lamarcks-giraffe-got-right-1280790
1•bookofjoe•19m ago•0 comments

Polish Nobel literature laureate admits to using AI

https://notesfrompoland.com/2026/05/21/polish-nobel-literature-laureate-tokarczuk-sparks-controve...
2•amarant•20m ago•1 comments

Ask HN: Does anyone what a "RiotCache.dat" file was doing in my EFI partition?

2•kromerless•21m ago•1 comments

The AI Slot Machine Is Draining My Creativity

https://daviesgeek.com/The-AI-Slot-Machine-is-Draining-My-Creativity
1•daviesgeek•23m ago•0 comments

Jack Parsons

https://en.wikipedia.org/wiki/Jack_Parsons
2•helterskelter•23m ago•0 comments

Evaluating Spec CPU2026

https://chipsandcheese.com/p/evaluating-spec-cpu2026
1•zdw•27m ago•0 comments

Surface laptop ships with 8GB RAM for $1299 despite pushing 16GB for Copilot PCs

https://www.windowslatest.com/2026/05/21/microsoft-pushed-16gb-ram-as-must-have-for-windows-11-fo...
4•MoltenMonster•29m ago•0 comments

Mace targets Squad Dem with constitutional ban on foreign-born lawmakers

https://www.foxnews.com/politics/mace-targets-squad-dem-proposed-constitutional-ban-foreign-born-...
1•SilverElfin•30m ago•0 comments

Security nightmare vibe-coder berates security conscious low budget OSS devs

https://twitter.com/steipete/status/2058101804202602949
2•rjzzleep•32m ago•0 comments

Show HN: Invoker, an IDE for orchestrating massively parallel agents

https://invoker.build
1•brhsagain•34m ago•0 comments

Show HN: I built a RAG and knowledge graph agent that runs locally

4•gabriel_oauth•34m ago•1 comments

The Skeuomorphism Nobody Talks About [video]

https://www.youtube.com/watch?v=3Q-G9x315-g
1•zdw•37m ago•0 comments

Italy Cancels Boeing Pegasus Order, Shifting to Airbus A330 MRTT

https://www.euronews.com/my-europe/2026/05/21/italy-moves-to-airbus-a330-tankers-in-major-nato-al...
7•embedding-shape•37m ago•0 comments

Pulumi Do: Direct Resource Operations for Any Cloud

https://www.pulumi.com/blog/pulumi-do-direct-resource-operations/
1•cnunciato•39m ago•0 comments

Putin Can No Longer Hide His Catastrophe

https://www.theatlantic.com/ideas/2026/05/putin-lost-control-russia/687269/
6•JumpCrisscross•41m ago•1 comments

The end of the internet's golden age

https://www.axios.com/2026/05/23/google-search-internet-social-media
2•1vuio0pswjnm7•41m ago•1 comments