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

Giraffebench 1.0 – The quality of local and cloud LLMs in a way you can see

https://keno303.github.io/giraffebench/index.html
1•bj-rn•1m ago•0 comments

LLVM Wraps Up Relicensing

https://discourse.llvm.org/t/wrapping-up-llvms-relicensing-effort/92906
1•qtqtqt•2m ago•0 comments

Show HN: Agent Driven Slide Decks

https://github.com/steamfield/decks
1•RileyHilliard•3m ago•0 comments

Locked out of X, for not being human

https://boussejra.com/2026/11/20/locked-out-of-x-not-human.html
1•malikolivier•3m ago•0 comments

White House national cyber director is leaving the administration

https://www.nbcnews.com/politics/white-house/national-cyber-director-sean-cairncross-leaving-kirs...
1•MadrasThorn•5m ago•0 comments

Ask HN: Do you find Windows font rendering jagged?

1•qtqtqt•5m ago•0 comments

South Park Character Maker – Create original paper-cut cartoon avatars

https://southparkmaker.com/
1•cadcraft•5m ago•0 comments

Why created a great product isn't enough for healthcare startups

https://davidngo1562.substack.com/p/its-not-about-the-money-until-it
1•illidan1000•6m ago•0 comments

Xenohumanist

https://sofiechan.com/u/xenohumanist
1•jerlendds•8m ago•0 comments

FFmpeg 9.1 'Gauss'

https://ffmpeg.org/download.html#release_9.1
3•gyan•8m ago•1 comments

I Built the Largest Commentary in the History of Persian Poetry

https://dev.arman.ac/posts/largest-commentary-in-the-history-of-persian-poetry/
1•armanj•9m ago•0 comments

The Wicked Reason Removing Code Beats Better Scheduling

https://infrequently.org/2026/08/notes-on-performance-remediation-strategies/
1•fagnerbrack•9m ago•0 comments

GIMP now has UI tests

https://www.gimp.org/news/2026/11/16/gimp-ui-tests/
2•qtqtqt•10m ago•0 comments

Show HN: GhostFleet: A Battleship game with an advanced AI opponent

https://ghostfleet.in/play?mode=wraithAI
1•anirbanhere•11m ago•0 comments

ZX-UX: Unix Operating System for Sinclair ZX Spectrum 48K

https://tuklusan.itch.io/zx-ux-unix-for-sinclair-zx-spectrum-48k
1•thunderbong•11m ago•0 comments

Myanmar Committed Genocide Against the Rohingya, Top Global Court Finds

https://www.nytimes.com/2026/11/19/world/europe/myanmar-genocide-icj-decision-.html
1•JumpCrisscross•14m ago•1 comments

Magnus Carlsen forfeits scheduled chess game against GM Bibisara Assaubayeva

https://worldchess.com/news/carlsen-forfeits-total-chess-game-as-niemann-accuses-organisers-of-fa...
1•Thorondor•16m ago•0 comments

Show HN: I got Modern Combat 2 – Black Pegasus running in a browser

https://mc2.aryanbaburajan.com
1•aryanbaburajan•18m ago•0 comments

South Korean firm plans $150M lifeline for Eric Trump-backed robot maker

https://www.reuters.com/world/south-korean-firm-plans-150-million-lifeline-eric-trump-backed-robo...
1•JumpCrisscross•22m ago•0 comments

Squeezing Tables with Postgres 19

https://www.enterprisedb.com/blog/squeezing-tables-postgres-19
1•DumBthInker007•22m ago•0 comments

PostgreSQL 19

https://www.postgresql.org/docs/release/19.0/
9•linzhangrun•25m ago•0 comments

EU Sovereign Tech Fund Survey

https://survey.sovereign.tech/eustf
1•lumpa•25m ago•0 comments

Simplint: A fast companion linter for Ruff, written in Rust

https://simplint.readthedocs.io/en/latest/index.html
1•lumpa•26m ago•0 comments

Anthropic's Australian data centre overwhelmingly opposed by residents

https://www.reuters.com/world/asia-pacific/anthropics-australian-data-centre-overwhelmingly-oppos...
4•JumpCrisscross•27m ago•1 comments

Decision model for robot status 90% less time and money

https://www.rightnowai.co/rightnow
3•OsamaJaber•32m ago•0 comments

If tiny 'primordial' black holes exist

https://phys.org/news/2026-11-tiny-primordial-black-holes.html
1•wglb•33m ago•0 comments

Work Network added new lucky draw feature in the app

https://work-networks.com/lucky-draws.html
1•onlineiqbal•39m ago•0 comments

Long DNA strands turn chaotic fluid motion into a steady rhythm

https://phys.org/news/2026-11-dna-strands-chaotic-fluid-motion.html
1•wglb•42m ago•1 comments

Mapping every neuron in Qwen3-8B

https://www.fermionresearch.com/research/mapping-every-neuron-in-qwen3-8b/
3•sheepscreek•44m ago•0 comments

Astronomers discover remarkable 3-star system just 28 light-years from Earth

https://phys.org/news/2026-11-astronomers-remarkable-triple-star-years.html
2•wglb•46m ago•1 comments