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

The Price Assigned to a Person: Loyalty, Data, and the Limits of Competition

https://medium.com/@smoking2man/the-price-assigned-to-a-person-loyalty-data-and-the-limits-of-com...
1•Aldus551•1m ago•0 comments

Show HN: A native iPhone app for robot vacuums running Valetudo

https://github.com/bsidio/OpenVaccum
1•humbfool2•1m ago•0 comments

Show HN: In-browser PDF compressor and sensitive data blur (zero uploads)

https://vault-pro.rashid-salimov96.workers.dev/en/tools/pdf-compress/
1•badrasr•1m ago•0 comments

The Jevons Paradox Explains Why AI Will Create More Software

https://hrih.si/articles/the-jevons-paradox-has-a-second-half/
1•DonAtimator•2m ago•0 comments

Don't flip, algebra inside [video]

https://www.youtube.com/watch?v=-k-Dnw0F3kc
1•levmiseri•2m ago•0 comments

GitHub affordances as human-agent conveyances

https://qmacro.org/blog/posts/2026/11/11/github-affordances-as-human-agent-conveyances/
1•meetpateltech•4m ago•0 comments

CLI-Based Keystore: my latest small project

https://github.com/mateasmario/keystore
1•mmateas•6m ago•1 comments

Show HN: Canontra, deterministic semantic fingerprints for source code

https://github.com/symtrace/canontra
1•JashT14•6m ago•0 comments

What if any process could handle SIGKILL?

https://vulpinecitrus.info/blog/what-if-you-could-handle-sigkill/
1•joshcsimmons•7m ago•0 comments

Ubuntu 26.10 ships with initial upki support

https://discourse.ubuntu.com/t/introducing-initial-upki-support/91540
2•ruimarquesXYZ•16m ago•0 comments

Do the day's losing stocks still bounce in the last half hour? A registered test

https://arxiv.org/abs/2611.09286
5•svidov222•17m ago•0 comments

Why does Reddit want me to use the iOS app on my desktop?

4•corroclaro•20m ago•0 comments

The Challenge of Separating All Things Seen from All Things Unseen

https://www.jagregory.com/abrash-black-book/#the-challenge-of-separating-all-things-seen-from-all...
1•taspeotis•21m ago•0 comments

Show HN: 130M mutations against Solana's consensus parsers, zero crashes

https://github.com/latent-9/chainoffuzz
1•latent-9•26m ago•0 comments

Reddit's app download popup is blocking desktop browsing

https://www.reddit.com/r/bugs/comments/1xtdlv7/windowsweb_it_seems_like_the_ios_get_the_app/
4•pavelrub•28m ago•0 comments

QNet: An open-source post-quantum state machine built in Rust

https://github.com/AIQnetLab/QNet-Blockchain
1•egheose13•30m ago•0 comments

Will It Tip?

https://kerfcraft.app/blog/will-it-tip/
1•asoorm•31m ago•0 comments

Phala Confidential AI Compromised

https://phala.com/posts/phala-november-preliminary-incident-report
2•miohtama•31m ago•0 comments

AI companion that matches humans

https://kindredso.social
1•harunselam1•34m ago•1 comments

Show HN: Ascope – Daily App Store and Google Play keyword ranks, native Mac app

https://ascope.app/
2•ssarisen•35m ago•0 comments

Discovery of doughnut-like topology at tipping points breaks physics convention

https://www.scmp.com/news/china/science/article/3371371/chinese-discovery-doughnut-topology-tippi...
1•bryanrasmussen•37m ago•0 comments

Update on Code of Conduct Actions

https://discourse.gnome.org/t/update-on-code-of-conduct-actions/39994
1•lakeviewterrace•40m ago•0 comments

Technology Radar Vol 35

https://www.thoughtworks.com/en-de/radar
6•epaga•44m ago•0 comments

GeminiRealEstate

https://gemini-real-estate-b-u220.bolt.host/
2•emmanuelnyonges•44m ago•0 comments

Extensible Web Apps

https://aifoc.us/extensible-web-apps/
1•kinlan•46m ago•0 comments

'Apple Support Community' Permanently Closing on November 20

https://www.macrumors.com/2026/11/10/apple-support-community-closing-november-20/
2•thm•47m ago•0 comments

An AI flyer designer that generates designs with code, not images

https://www.tryanvil.dev/
1•Alumu•48m ago•0 comments

We Run a Bootstrapped AI Startup on Almost Zero Operating Costs

https://dmv.is-a.dev/writing/how-we-run-a-bootstrapped-ai-startup-on-almost-zero-operating-costs
1•divija07•48m ago•0 comments

How to Scrape Apple App Store Reviews and App Data

https://scrapfly.io/blog/posts/how-to-scrape-app-store
5•Dylan-Hayes•48m ago•0 comments

Claude Harness to Avoid Getting Trapped in Junior Developer Purgatory

https://piethanegraaf.github.io/en/
2•Piet_Hanegraaf•49m ago•0 comments