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

Top Bank Regulator Spoke at an Invite-Only Client Dinner After Fed Meeting

https://www.wsj.com/economy/central-banking/top-bank-regulator-spoke-at-an-invite-only-client-din...
1•petethomas•31s ago•0 comments

Shrinking a NixOS ISO from 458 MiB to 183 MiB

https://natkr.com/2026-06-19-nixos-but-smol/
1•logickkk1•36s ago•0 comments

Pre-Modern Armies for Worldbuilders: Officials, Contractors and Professionals

https://acoup.blog/2026/06/19/collections-pre-modern-armies-for-worldbuilders-part-iib-officials-...
3•JohnHammersley•2m ago•0 comments

Trust Identity Protocol v1.0, an open post-quantum standard for human identity

https://theailab.org/whitepaper
1•dineshmendhe•2m ago•0 comments

Ask HN: Do you find it annoying to share your availability over text/DMs?

2•siddhibee•3m ago•0 comments

Zenzizenzizenzic

https://en.wikipedia.org/wiki/Zenzizenzizenzic
4•gyosifov•6m ago•0 comments

Ask HN: Do you use Apache Iceberg in Production?

1•vira28•10m ago•0 comments

Optimizing for Decision Points

https://narphorium.com/blog/decision-points/
1•azhenley•10m ago•0 comments

The data black hole at the center of AI

https://www.dwarkesh.com/p/the-sample-efficiency-black-hole-2
1•jedixit•10m ago•0 comments

The Wrong End of the Problem

https://schrottner.at/2026/06/18/The-Wrong-End-of-the-Problem.html
1•aepfli•14m ago•0 comments

OCaml 5.5.0

https://discuss.ocaml.org/t/ocaml-5-5-0-released/18265
3•cod1r•16m ago•0 comments

Gemini CLI vs. Claude Code: Why agent capabilities matter more than prompts

https://imaxxs.com/behavioral-induction-capabilities-shape-execution
1•imaxxs•16m ago•0 comments

HN: A free book on how "AI easy money" scams work

https://singularityforge.space/2026/06/20/di-and-easy-money-on-the-edge-of-a-myth/
1•Voice_of_Void•17m ago•0 comments

Cervical cancer mortality trends after HPV vaccination in England 2001–24

https://www.thelancet.com/journals/lancet/article/PIIS0140-6736(26)00918-9/fulltext
4•bookofjoe•17m ago•0 comments

Europe buys the future, America builds it

https://economist.com/finance-and-economics/2026/06/18/europe-buys-the-future-america-builds-it
1•andsoitis•18m ago•0 comments

Google Is Using Nvidia's Playbook to Build a Rival AI Chip Business

https://www.wsj.com/tech/ai/google-is-using-nvidias-playbook-to-build-a-rival-ai-chip-business-1e...
2•Brajeshwar•22m ago•1 comments

Show HN: SkillsGuard – static scanner for malicious AI agent skills

https://github.com/Teycir/SkillsGuard
1•teycir•23m ago•0 comments

Computer Vision – Lecture 1.1 (Introduction: Organization) [video]

https://www.youtube.com/watch?v=YW1cIaOBkI8
1•skidrow•23m ago•0 comments

Anthropic Lacks Emotional Intelligence

https://www.lawfaremedia.org/article/anthropic-lacks-emotional-intelligence
1•ano-ther•24m ago•0 comments

Get notified the second Fable 5 comes back

https://fablewatch.com
1•markksantos•25m ago•0 comments

What happens if the EU loses the AI race [video]

https://www.youtube.com/watch?v=uVPoq1Svz7g
1•SpyCoder77•29m ago•0 comments

Show HN: Konxios a local first AI OS that connects LM Studio, Ollama and cloud

https://konxios.com
1•ifrosted•34m ago•0 comments

Eerie landscape of 100.000 monoliths made with fable 5(when it was available)

https://sand-morph.up.railway.app/atlas-of-quiet-monoliths
1•echohive42•36m ago•0 comments

The science behind Qantas' bet on 20-hour flights

https://www.reuters.com/business/aerospace-defense/sleep-light-science-behind-qantas-bet-20-hour-...
2•1659447091•37m ago•0 comments

Shellular: Run agents, terminals and browser DevTools from your phone

https://shellular.dev/
3•aquajet•40m ago•0 comments

GLM-5.2 vs. Claude Opus 4.8: Full Comparison

https://llm-stats.com/blog/research/glm-5-2-vs-claude-opus-4-8
3•gjvc•43m ago•0 comments

An offline earthquake monitor that detects P-waves before S-waves

https://play.google.com/store/apps/details?id=com.muhsin.mkdepremmonitor&hl=en_US
2•Muhsinkosoglu•46m ago•0 comments

How to Get Fired Using Switch Statements and Statement Expressions (2016)

https://blog.robertelder.org/switch-statements-statement-expressions/
1•downbad_•46m ago•0 comments

Show HN: Let agents send/receive SMS using your old Android phone

https://simlink.snaz.cz/
1•LukBrezina•49m ago•0 comments

HN with Pics

https://hn.is-ai-good-yet.com/
1•ilyaizen•49m ago•1 comments