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

Prompting was middle management – loops fired you and sent you the bill

https://readtheinference.substack.com/p/prompting-was-middle-management
1•mmayernick•2m ago•0 comments

Show HN: I made a Free, on sign up, C

1•yurimhln•3m ago•1 comments

Zenzic VS Code – Deterministic Markdown Analysis via LSP

https://zenzic.dev/blog/2026/07/18/zenzic-vs-code-extension/
1•PythonWoods-Dev•4m ago•0 comments

Ontario prison AI assigns black prisoners harsher living conditions

https://breachmedia.ca/black-prisoners-are-assigned-harsher-living-conditions-in-ontario-jails-th...
1•hn_acker•4m ago•1 comments

Fertility is collapsing because motherhood is zero-status

https://twitter.com/JohannKurtz/status/2079218735915860441
1•bilsbie•4m ago•0 comments

Type Safe Servant Auth Roles

https://blog.cofree.coffee/2026-07-20-servant-auth-roles/
1•solomonb•4m ago•0 comments

AliExpress fined €550M by EU for failing to stop sale of illegal and fake goods

https://www.theguardian.com/business/2026/jul/20/aliexpress-fined-by-eu-sale-of-illegal-fake-goods
2•atombender•6m ago•1 comments

Laws of Tech: Commoditize Your Complement

https://gwern.net/complement
1•kblissett•6m ago•0 comments

Why Did We Let Big Tech Take over Education?

https://www.afterbabel.com/p/sophie-winkleman-edtech-rollback-2026
1•paulpauper•7m ago•0 comments

EU to give industry more time to pollute and more funds to clean up

https://www.ft.com/content/c3c33e7b-8faf-4f06-b281-112117aeeb5a
1•alephnerd•7m ago•0 comments

Over 30% of new ArXiv submissions now read as AI-written

https://unslop.run/blog/measuring-ai-writing-on-arxiv
1•dopamine_daddy•7m ago•1 comments

GNOME Changes Security Disclosure Policies Due to AI-Generated Reports

https://blogs.gnome.org/mcatanzaro/2026/07/20/some-changes-to-gnome-security-tracking/
2•Erenay09•8m ago•0 comments

Intel Arc G3 Low Power Core Scheduling

https://www.lttlabs.com/articles/2026/07/18/intel-arc-g3-extreme-ibc-v35
1•LorenDB•9m ago•0 comments

Server Migration

https://lmnt.me/blog/server-migration.html
2•speckx•10m ago•0 comments

Admin officials kill proposed rules for PFAS-contaminated sewage fertilizer

https://www.theguardian.com/environment/2026/jul/20/trump-pfas-sewage-farm-fertilizer
3•howard941•11m ago•0 comments

Das starts up and loads 700 background activities

https://eclecticlight.co/2026/07/20/how-das-starts-up-and-loads-700-background-activities/
1•Brajeshwar•11m ago•0 comments

ProEnhanceX – A 100% local, on-device AI photo studio for Android

https://play.google.com/store/apps/details?id=com.enhancex.aistudio&hl=en_US
1•swawon•12m ago•0 comments

Launch HN: Bloomy (YC S26) – AI-powered mastery learning for K-12

2•alexsouthmayd•12m ago•2 comments

Train a Harness to improve model/env-agnostic capabilities with PyTorch-like API

https://github.com/workofart/harness-training
1•megadragon9•12m ago•0 comments

A Power Trip

https://hackerfactor.com/blog/index.php?/archives/1099-On-a-Power-Trip.html
3•speckx•17m ago•0 comments

There have only been 5 ethical NBA champions in the last 25 years

https://pudding.cool/2026/06/ethical-champions/
4•gmays•18m ago•0 comments

Open Minis Is the iOS Agent I Wish Siri AI Could Be

https://www.macstories.net/reviews/open-minis-is-the-ios-agent-i-wish-siri-ai-could-be/
3•ExMachina73•20m ago•0 comments

Show HN: Take a break, play some puzzles

https://gridmino.com/
3•marko-projects•21m ago•0 comments

Yet another take on layout breakouts

https://noahliebman.net/2024/05/yet-another-take-on-layout-breakouts/
3•ankitg12•21m ago•0 comments

Made a quick quiz to check if your AI project triggers EU AI Act rules

https://tally.so/r/7Rg2y2
2•Safwane•22m ago•0 comments

Anatomy of a Room

https://eviltrout.com/blog/2026-03-23-anatomy-of-a-room/
2•chunkycapybara•22m ago•0 comments

What's Behind the Rise in Mild Autism?

https://www.theatlantic.com/family/2026/07/mild-autism-diagnosis/687998/
3•bookofjoe•24m ago•2 comments

Today IPv6 adoption exceed %50 in Google Statistics

https://www.google.com/intl/en/ipv6/statistics.html
1•xlmnxp•24m ago•0 comments

Why Banks Need 'Sleepy' Customers

https://www.library.hbs.edu/working-knowledge/why-banks-need-sleepy-customers
2•toomuchtodo•25m ago•0 comments

Unexpected events and prosocial behavior: the Batman effect [pdf]

https://www.nature.com/articles/s44184-025-00171-5
1•thunderbong•26m ago•0 comments