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

Reinforcement learning towards broadly and persistently beneficial models

https://alignment.openai.com/beneficial-rl/
1•vesteny77•57s ago•0 comments

The Secret Life of Circuits by Michal Zalewski (Lcamtuf)

https://nostarch.com/secret-life-of-circuits
1•Curiositry•1m ago•0 comments

Russian Warship RIP – Tracking Losses

https://russianwarship.rip/en
1•sans_souse•2m ago•0 comments

Talk to Your Plant

https://github.com/openai/planttalk
2•bakigul•3m ago•0 comments

Let's say you're hungry for a sandwich

https://beige.party/@Lana/116795397010653803
2•colinprince•3m ago•0 comments

ClaudeMeter – macOS menu bar app to track Claude usage and limits

https://github.com/yotake/claude-meter
1•chibeeMan•3m ago•0 comments

Show HN: Freestyle – Wispr Flow Alternative that respects privacy

https://github.com/freestyle-voice/freestyle
1•matteo8p•4m ago•0 comments

This Word Does Not Exist

https://www.thisworddoesnotexist.com/
1•SpyCoder77•4m ago•0 comments

AI stock slump raises the question are investors taking profits or very nervous

https://apnews.com/article/tech-stocks-ai-investments-8a0ff4c95d5cae6f65c6e2ba03047058
1•1vuio0pswjnm7•4m ago•0 comments

Extreme Heat conference cancelled due to extreme heat warning

https://www.lse.ac.uk/granthaminstitute/events/extreme-heat-improving-governance-and-strengthenin...
1•rendx•6m ago•0 comments

SpaceX Falls for Third Day, Erases $600B in Market Value

https://www.bloomberg.com/news/articles/2026-06-22/spacex-shares-poised-to-slide-again-as-us-mark...
1•1vuio0pswjnm7•7m ago•0 comments

Pilbara's North Pole Dome the oldest known asteroid crater

https://www.abc.net.au/news/2026-06-24/worlds-oldest-asteroid-crater-pilbara-confirmed/106818546
1•Gaishan•8m ago•0 comments

Generosity Is Potency

https://wastebook.substack.com/welcome
2•Curiositry•8m ago•0 comments

Postman launches passport for securing API secret access

https://blog.postman.com/postman-passport-secure-api-access-for-the-agentic-era/
1•paidsandserape•9m ago•0 comments

Building a Western gallium supply chain beyond China's reach

https://wpintelligence.washingtonpost.com/topics/energy-climate/2026/06/17/gallium-gamble-buildin...
1•bookofjoe•10m ago•1 comments

Advanced Nintendo Entertainment System (ANES) – NES Modded to Use 2 PPUs

https://github.com/decrazyo/anes
1•zdw•11m ago•0 comments

Just.witter – a voice feed. no text, no photos, no video, just voices

https://justwitter.com/
1•whatis1215•11m ago•0 comments

The Real-Time Rat Tracking Map

https://googlemapsmania.blogspot.com/2026/06/the-real-time-rat-tracking-map.html
1•gnabgib•13m ago•0 comments

Real Men Run as Root

https://www.garyshood.com/root/
2•helterskelter•15m ago•2 comments

Heap buffer overflow in WolfSSL SNI and ECH code

https://www.wiz.io/vulnerability-database/cve/cve-2026-5503
1•1vuio0pswjnm7•16m ago•0 comments

Lifting E-Graphs: A Function Isn't a Constant

https://arxiv.org/abs/2606.22734
1•matt_d•16m ago•0 comments

Apache Pulsar 5.0.0-M1: A Preview of the Next Major Release

https://pulsar.apache.org/release-notes/versioned/pulsar-5.0.0-M1/
1•matteomerli•19m ago•0 comments

Skills don't have a quality problem. They have a distribution problem

https://skillrepo.dev/blog/skills-distribution-problem
1•atxpace•20m ago•0 comments

How to Give a Technical Presentation (2005)

https://homes.cs.washington.edu/~mernst/advice/giving-talk.html
1•simojo•23m ago•0 comments

Measuring tech debt in tokens instead of engineering hours

https://heysoup.co/notes-tech-debt-token-function
1•heysoup•23m ago•0 comments

Prime Day Is Restaurant Week

https://www.marginpoints.com/issues/2026-06-23-prime-day-is-restaurant-week
1•historian1066•23m ago•0 comments

ACL Recovery with Cross Brace Protocol

https://aadeshnpn.substack.com/p/recovery
1•aadeshnpn•24m ago•0 comments

I turned the Dialog leak into a searchable conflict of interest database

https://build-a-cult.com
7•jakevonportland•27m ago•0 comments

LLM-CTF benchmark – 2,639 real data points from NeurIPS and original runs

https://www.kaggle.com/datasets/manitejamaram/can-ai-hack-llm-ctf-benchmark
1•velotessi•27m ago•1 comments

Why Companies Are Dumping OpenAI and Anthropic [video]

https://www.youtube.com/watch?v=V46Fw9LPNXI
1•mgh2•27m ago•0 comments