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

Everyone feared AI taking over; the real danger is AI serving just the few

1•PhilipDaineko•29s ago•0 comments

Reef: Paste bash into fish. It just works

https://github.com/ZStud/reef
1•thunderbong•4m ago•0 comments

Can you rate my AI slop that I build for fun?:D

https://swipeitup.vercel.app/
1•RoastSlop•5m ago•0 comments

Update Your Secure Boot Cert Before It Expires

https://nochan.net/b/Internet-Crap/20260621-Update-Secure-Boot-Cert-Before-It-Expires/
1•Bender•5m ago•1 comments

Shard your locks: benchmarking 6 Golang cache designs

https://strebkov.dev/posts/shard-your-locks/
1•fanf2•6m ago•0 comments

Show HN: Adrafinil – keep a lid-closed Mac awake only while agents work

https://github.com/kageroumado/adrafinil
2•kageroumado•13m ago•0 comments

Show HN: Tickerstar – Instant SEC and company earnings summaries

https://www.tickerstar.com
1•TickerStar•13m ago•0 comments

A Perfect Meritocracy Will Have Little Social Mobility

https://outlookzen.com/2026/06/27/a-perfect-meritocracy-will-have-little-social-mobility/
2•whack•16m ago•0 comments

What If a Man Practised Shooting a Million Times? Shot 90172, Football Progress [video]

https://www.youtube.com/watch?v=CI9oUUnUzw0
2•mmarian•18m ago•0 comments

Check out the new US passport

https://mishtalk.com/economics/does-president-trump-have-any-idea-what-passports-are-for/
2•megamike•18m ago•1 comments

Mojo programming language will become open-source soon

https://console.modular.com/signup
2•birdculture•19m ago•0 comments

Empero: A 9B that checks its own work

https://empero.org
2•modinfo•20m ago•0 comments

Show HN: Answer questions and see which countries share your personal values

https://jaylol.com/values-survey/
2•marifjeren•21m ago•0 comments

V16 Engine, a mechanical simulation with sixteen synchronized pistons

https://sand-morph.up.railway.app/v16-engine
2•echohive42•22m ago•0 comments

New York Housing Market suffers fatal news after Mamdani freezes rents [video]

https://www.youtube.com/watch?v=5vBkoEvZN6s
2•Bender•25m ago•0 comments

Art Is for Seeing Evil (2022)

https://thepointmag.com/examined-life/art-is-for-seeing-evil/
2•jger15•26m ago•0 comments

Show HN: Remote control for dev environment, not just agents

https://shellular.dev/
2•biraj-rocks•30m ago•0 comments

Claude Ecosystem

https://claude.com/ecosystem
2•geoffbp•30m ago•0 comments

GPT-5.6 Preview System Card

https://deploymentsafety.openai.com/gpt-5-6-preview
2•e2e4•31m ago•0 comments

A German AI publisher rewrites Hacker News posts and strips the sources

https://christopher-helm.com/die-dunkle-seite-der-ki-im-journalismus-1-500-ki-texte-im-eilverfahr...
2•chelm•31m ago•0 comments

GitHub DeepSeek-AI/DeepSpec

https://github.com/deepseek-ai/DeepSpec
2•geoffbp•31m ago•0 comments

A Farmer Arrested for Going 5 Seconds over His Time Limit at Data Center Meeting

https://www.gadgetreview.com/arrest-him-the-moment-police-handcuffed-a-farmer-for-going-5-seconds...
11•spenvo•31m ago•4 comments

Recursive self improvement for human skills

1•rando77•34m ago•0 comments

DIY your own open-source Robot Vacuum

https://twitter.com/dfrobotcn/status/2070852143964139763
1•Noghartt•37m ago•0 comments

Voting with Feet

https://maxmautner.com/2026/06/25/voting-with-feet.html
1•mslate•37m ago•0 comments

Videogenr.com

https://videogenr.com/en
1•kilincarslan•38m ago•2 comments

Open handoff: Thought Tree, a markup/spec idea for modular LLM workflows

https://github.com/RobertBateman/thoughttree-framework
1•xavier1764•42m ago•0 comments

Quora and mass AI poisoning: An organized crime AI spam ring

https://tacit.livejournal.com/687903.html
3•AndrewDucker•45m ago•1 comments

US Government allows Anthropic limited release of Mythos/Fable models

https://www.cnn.com/2026/06/26/tech/anthropic-mythos-release
1•alonp99•51m ago•0 comments

United Auto Workers Vote to Divest from Israel in Historic Victory – Truthout

https://truthout.org/articles/united-auto-workers-vote-to-divest-from-israel-in-historic-victory/
5•abdelhousni•57m ago•1 comments