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

Cursor Bridge – Run Unlimited Claude Code on Your Cursor Subscription

https://github.com/hkc5/cursor-bridge
1•hakancan•13s ago•1 comments

Scriptc by Vercel: TypeScript-to-Native Compiler

https://github.com/vercel-labs/scriptc
1•maxloh•2m ago•0 comments

Shepherd Model Gateway – Model-routing gateway for LLM deployments

https://github.com/lightseekorg/smg
1•rekl•11m ago•0 comments

Your GPS Is Lying to You

https://medium.com/@rohitdastalks/your-gps-is-lying-to-you-and-thats-a-national-security-crisis-7...
2•jonbaer•12m ago•0 comments

"A vicious circle of incompatibility" – Unsung

https://unsung.aresluna.org/a-vicious-circle-of-incompatibility/
1•rbanffy•13m ago•0 comments

A live black-box capability eval for autonomous offensive-security agents

https://phantomlogin.entropicsystems.net/
1•snorbleck•14m ago•0 comments

Claude of Duty

https://github.com/mshumer/Claude-of-Duty/tree/main
1•SweetSoftPillow•15m ago•0 comments

Stories Told About Data Centres – Pixel Envy

https://pxlnv.com/blog/stories-told-about-data-centres/
1•rbanffy•16m ago•0 comments

Tesler's Law

https://en.wikipedia.org/wiki/Law_of_conservation_of_complexity
3•soupspaces•18m ago•0 comments

Videos Helped Me Uncover Abuse at an Arkansas Private School

https://www.propublica.org/article/arkansas-private-school-abuse-video
2•Jimmc414•18m ago•0 comments

Court Reporter Submitted AI-Generated Errors in Official Court Transcript

https://www.404media.co/judge-caught-court-reporter-using-ai-transcript-errors/
1•Jimmc414•19m ago•0 comments

Fabric Interface Tutorial: E-Textiles, Conductive Thread and Trill Craft

https://www.youtube.com/watch?v=ClBYyYEFkF0
1•soupspaces•19m ago•0 comments

Hundreds of Drone-as-First-Responder Programs to Be Launched Across the Country

https://www.eff.org/deeplinks/2026/07/hundreds-drone-first-responder-programs-could-soon-be-launc...
1•Jimmc414•20m ago•0 comments

Show HN: Anyclaude-SDK – Claude Code-Style SDK for OpenAI/Anthropic Endpoints

https://github.com/pipilot-dev/anyclaude-sdk
1•hansade•21m ago•0 comments

Show HN: The Jac Programming Language

https://jaclang.org/
2•marsninja•21m ago•4 comments

The Metaverse Fever Dream – Pixel Envy

https://pxlnv.com/blog/metaverse-fever-dream/
2•rbanffy•22m ago•0 comments

Why does every mammal get 1B heartbeats in their life? [video]

https://www.youtube.com/watch?v=tL9Lw250spc
1•binyu•24m ago•0 comments

The highest-leverage bet in the whole market is not AI, it's LSD

https://www.singularityrainbow.ai/p/you-have-no-idea-how-big-dftx-is
1•charliejordan•25m ago•0 comments

Show HN: GG Translator – Turn gaming shit talk into friendly phrases

https://ggtranslator.com
1•mcadenhe•25m ago•0 comments

US citizen charged after GrapheneOS phone wipes during airport search

https://www.techspot.com/news/113236-us-prosecutors-charge-atlanta-man-after-grapheneos-phone.html
2•eecc•26m ago•0 comments

So-called 'Skynet Day' came too close to SF after rogue agent hacked a startup

https://apnews.com/article/skynet-ai-terminator-artificial-intelligence-eb85da03a0161beaa5f3babc4...
3•billybuckwheat•27m ago•0 comments

Show HN: LuaJIT with Native SIMD

https://github.com/TheLuaOSProject/LuaJITMT/releases/tag/1.0.0-simd
1•frityet•28m ago•1 comments

Can Frontier Models Recall Long-Tail Facts? A Cricket Stress Test

https://corvi.careers/blog/frontier-models-long-tail-facts/
1•sp1982•29m ago•0 comments

Building a CEL Engine for .NET

https://bsid.io/writing/building-a-cel-engine-for-net
2•jackedEngineer•29m ago•0 comments

Refactoring cuisine: how an Iraqi stew sailed to Singapore

https://iza.ac/posts/2026/07/the-journey-of-bamya/
1•infinitewalk•29m ago•0 comments

Browser-Based QBasic Environment

https://kavak.run/studio/
2•rickcarlino•33m ago•0 comments

RAMpocalypse, Now With Lawyers – ByteHaven – Where I ramble about bytes

https://blog.ppb1701.com/rampocalypse-now-with-lawyers
2•abdelhousni•35m ago•0 comments

Show HN: Codex fixed my 2010 MacBook Pro driver troubles with kernel patches

https://github.com/ldyeax/macbook2010_nouveau_and_sleep_fixes/
1•jimmaswell•36m ago•0 comments

Frontier LLMs drop from 83% to 43% once reasoning has to chain across domains

https://arxiv.org/abs/2607.18438
2•MarcoDewey•38m ago•1 comments

Anti-AI nostalgia and the cult of the past

https://www.seangoedecke.com/anti-ai-nostalgia/
1•gfysfm•39m ago•0 comments