frontpage.
newsnewestaskshowjobs

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

French bank Credit Mutuel Arkea counting losses from cyberattack

https://www.reuters.com/technology/french-bank-credit-mutuel-arkea-hit-by-cyberattack-2026-11-04/
1•gvieri•42s ago•0 comments

AI poisoning: are we using AI, or is AI using us?

https://blog.sparkcan.com/posts/ai-poisoning/
1•bstefanovic•58s ago•0 comments

Edward Hopper's Iconic Painting, "Nighthawks

https://lithub.com/the-story-behind-edward-hoppers-iconic-painting-nighthawks/
1•prismatic•2m ago•0 comments

Fedora 45 is finally finished and fit

https://www.theregister.com/os-platforms/2026/11/04/fedora-45-is-finally-finished-and-fit/5307631
1•rbanffy•3m ago•0 comments

Pcbang.io

https://pcbang.io/
1•zergrush•4m ago•0 comments

Markdown viewer that supports images and latex folmulas

https://github.com/vincenzoaurelio/Platessa
2•vincenzoaurelio•12m ago•0 comments

Why Data Centres Will Change the World and Bankrupt Their Builders [video]

https://www.youtube.com/watch?v=GY5YyPLfqp0
1•dcl•12m ago•1 comments

Nvidia store pulls RTX 5080 following RTX 5090 removal, prices rise to 2.2X MSRP

https://www.tomshardware.com/pc-components/gpus/nvidia-store-quietly-pulls-the-rtx-5080-following...
1•akyuu•13m ago•0 comments

Kashmir's vanishing potato pits: generations of knowledge may be buried forever

https://www.theguardian.com/environment/2026/nov/04/kashmir-potato-pits-vanishing-indigenous-know...
2•bookofjoe•13m ago•0 comments

Puremail and Pure Writer for Haiku

https://pureemail.net/haiku.html
2•rguiscard•14m ago•0 comments

GarlicSignage – open-source Digital Signage Software

https://github.com/garlic-signage
3•thunderbong•19m ago•0 comments

AI triggers PCB shortage for PC makers as order books full until 2030, costs 12x

https://www.tomshardware.com/pc-components/ai-demand-triggers-massive-pcb-shortage-for-pc-makers-...
2•akyuu•20m ago•0 comments

Background subagents in Claude Code now use less of your usage limit

https://twitter.com/ClaudeDevs/status/2118063143167693011
1•mfiguiere•22m ago•0 comments

Raye Mihretab project ice cream

https://docs.google.com/document/d/1N3FX6ER-BMV7mYje-iX4u2Ra6FN9oVwPjxBRRQPNCIk/edit?userstoinvit...
2•bahgihayle•23m ago•0 comments

Successful People (2013)

https://blog.samaltman.com/successful-people
5•epestr•24m ago•4 comments

YouTuber discovers aircraft noise trick that can geolocate videos to within 100M

https://www.techradar.com/computing/cyber-security/youtuber-discovers-aircraft-noise-trick-that-c...
4•pain_perdu•25m ago•0 comments

You Can Build a Database, and how I'm doing it

https://charlesfonseca.substack.com/p/you-can-build-a-database-heres-how
2•barddoo•26m ago•0 comments

GMLK – An open-source Roblox Luau module loader and utility library

https://github.com/Faruk-Icen/GMLK
1•FarukIcen•28m ago•0 comments

I give to charity – but never to people on the street. Is that wrong?

https://www.vox.com/future-perfect/372519/charity-giving-effective-altruism-mutual-aid-homeless
3•herbertl•28m ago•0 comments

Russian Army Losses in Ukraine

https://index.minfin.com.ua/russian-invading/casualties/
1•scapecast•28m ago•0 comments

How to have 1,500 people for dinner

https://morefullyalive.substack.com/p/how-to-have-1500-people-for-dinner
2•herbertl•29m ago•0 comments

Trust Is a Micro-Habit

https://nik.art/trust-is-a-micro-habit/
2•herbertl•29m ago•0 comments

Open-source reference implementation of the Agent Name Service (ANS)

https://github.com/agentnameservice/ans
1•mooreds•30m ago•0 comments

EU/UK Android Devs need to put phone number on Play Store Listing

https://support.google.com/googleplay/android-developer/answer/17594752?hl=en
4•gadders•34m ago•0 comments

Building Barista: Postgres, Embeddings, and Jev

https://read.thecoder.cafe/p/barista-1
3•0xKelsey•35m ago•0 comments

Show HN: Using GPUs for other bs than AI – important prime record for the geeks

https://github.com/djuk8/beacon/
1•mvojvoda•41m ago•1 comments

Clawd's Bar opens - a speakeasy for AI agents and a new kind of service with it

https://x.com/clawds_bar
1•boos_clawdsbar•42m ago•0 comments

It Gives Great Demo

https://blog.jim-nielsen.com/2026/it-gives-great-demo/
3•aray07•43m ago•0 comments

Xenbleed: Xen Guest to Dom0 Escape

https://codeant.ai/security-research/xenbleed-a-grant-copy-cache-bug-that-reaches-dom0-memory
1•markasoftware•43m ago•0 comments

Out Of Office – a daily game for you to escape the 9 to 5

https://outofofficegame.com
2•iambenc•44m ago•1 comments