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

Near-real-time global gridded daily CO2 emissions

https://www.cell.com/the-innovation/fulltext/S2666-6758(21)00107-7
1•geox•10s ago•0 comments

Learn RUDRA – Complete Course (25 video chapters)

https://www.youtube.com/playlist?list=PLCFVBA46rFmY
1•rakshanex•14s ago•0 comments

Show HN: Tell the Sky – message lanterns drift on winds from live weather data

https://tellthesky.com
1•andycodeman•24s ago•0 comments

Ask HN: Banned for Reddit Inauthentic Ads?

1•polywickstudio•2m ago•0 comments

Meat Proxy – Claude Opus 5.5 music video

https://www.youtube.com/watch?v=gQvQ2NanBTI
1•bobajeff•3m ago•0 comments

Will AI Kill Mathematics?

https://www.youtube.com/watch?v=WLYW6BPkkIk
1•rzr999•4m ago•1 comments

The Moe Training Handbook

https://huggingface.co/spaces/huggingface/moe-blogpost
1•kashifr•6m ago•0 comments

Are You Improving?

https://irinarokosz.substack.com/p/are-you-improving
2•mooreds•9m ago•0 comments

Less Is More UI Agent Skill

https://github.com/Mendiak/less-is-more-ui
1•mendiak•9m ago•0 comments

HN: CloneGuard – scan a repo for credential-stealing tricks before you run it

https://github.com/tharun208/cloneguard
1•tharun208•10m ago•0 comments

A Jev that can ask Opus for help gives Opus accuracy at 4x lower cost

https://hightouch.com/blog/llm-judges-identity-resolution
13•theanomaly•10m ago•0 comments

The Mineral Age

https://www.tomhegen.com/product/the-mineral-age
3•smartmic•15m ago•1 comments

GoLand's Profiler Now Works with AI Agents – The JetBrains Blog

https://blog.jetbrains.com/go/2026/11/06/we-gave-ai-agents-goland-s-profiler-they-found-the-same-...
1•99lcccss•17m ago•0 comments

Partnering with Hacktron to find vulnerabilities in OpenAI's systems – OpenAI

https://openai.com/index/partnering-with-hacktron/
2•99lcccss•17m ago•0 comments

Chinese Civilization and the Computerization of the World

https://nexa.polito.it/chinese-civilization-and-the-computerization-of-the-world/
1•thenthenthen•18m ago•0 comments

Northstar: A New Booster Engine with More Thrust and Less Mass

https://www.blueorigin.com/news/introducing-northstar-new-booster-engine
1•simonebrunozzi•18m ago•0 comments

Show HN: Agents infer Lego mechanisms from sources, then animate them

https://github.com/anteloc/ldraw-mecha/tree/v0.5.0
3•antelocnova•18m ago•0 comments

Fox completes its $22B Roku acquisition

https://www.foxcorporation.com/news/corp-press-releases/2026/fox-corporation-completes-acquisitio...
1•rexbee•18m ago•0 comments

The launch market is tough as satellite companies start building rockets

https://arstechnica.com/space/2026/11/ast-spacemobile-is-so-desperate-for-launch-theyre-building-...
1•ryan_j_naughton•18m ago•0 comments

Fly.io Got Breached

https://fly.io/blog/well-that-wasnt-fun/
4•ushakov•19m ago•1 comments

How to lie with statistics? (Huff,1954)

https://open.spotify.com/episode/5GbfZKqpO63pZuM6RWGO7n
3•realsarm•20m ago•0 comments

Datacenters were on the ballot. US voters rejected them

https://www.theguardian.com/us-news/2026/nov/04/datacenters-midterm-elections
3•Betelbuddy•21m ago•0 comments

TSMC Is Reportedly Considering 3D DRAM Production

https://www.techpowerup.com/354547/tsmc-is-reportedly-considering-3d-dram-production
2•kristianp•21m ago•0 comments

<script> alert("hi") </script>

1•z58•22m ago•1 comments

Radio Waves Coming from an Alien Planet May Be a Cosmic First

https://www.nytimes.com/2026/09/29/science/space/exoplanet-magnetic-field.html
1•gmays•23m ago•0 comments

As the Japanese Countryside Empties Out, Wildlife Is Disappearing

https://e360.yale.edu/digest/japan-depopulation-biodiversity
10•rdmuser•23m ago•0 comments

Fake security tools on GitHub push backdoors and infostealers

https://www.bleepingcomputer.com/news/security/fake-security-tools-on-github-push-backdoors-and-i...
5•sshah03•25m ago•0 comments

About Loopback Interfaces

2•wuway•26m ago•0 comments

Firecracker VM Escape: PwnEscape Part 2

https://pwn.ai/blog/firecracker-escape
20•SerCe•26m ago•2 comments

Trump Names Stephen Miller His Chief of Staff, Replacing Susie Wiles

https://www.nytimes.com/live/2026/11/06/us/trump-miller-wiles-chief-of-staff
9•mikhael•26m ago•0 comments