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

Some combinatorial applications of spacefilling curves

https://www2.isye.gatech.edu/~jjb/research/mow/mow.html
1•shraiwi•1m ago•1 comments

Show HN: Brolly, a plain-text weather forecast site

https://brolly.sh/forecast/RWFP2qW8
1•jsax•4m ago•0 comments

AgentDeck – local-first mission control for AI CLI agents

https://github.com/hsienchuc/agentdeck
1•hsienchuc•5m ago•0 comments

Inside Ukraine’s Kill Zone

https://www.reuters.com/graphics/UKRAINE-CRISIS/KILL-ZONE/znpnojmknvl/
1•JumpCrisscross•5m ago•0 comments

Ask HN: How to get your open-source project gain popularity?

1•Hussain04•6m ago•0 comments

DEI Fraud and Cover-Up at Cambridge

https://ncofnas.com/p/dei-fraud-and-cover-up-at-cambridge
1•nextos•6m ago•0 comments

AI in the Breach: How an Adversary Leveraged AI to Target a Water Utility's OT

https://www.dragos.com/blog/ai-assisted-ics-attack-water-utility
1•MariusGjerd•7m ago•0 comments

Is It Time to 'Liquidate' the Study of Sociology?

https://www.wsj.com/us-news/education/is-it-time-to-liquidate-the-study-of-sociology-6b85ac14
2•JumpCrisscross•8m ago•0 comments

Nvidia Open Sources First GPU-Accelerated Medical Physics Simulation Framework

https://blogs.nvidia.com/blog/medical-physics-simulation-open-source/
2•saikatsg•10m ago•0 comments

Are the Enhanced Games an existential threat to fairness or a cure for death?

https://www.newyorker.com/magazine/2026/07/20/rope-a-dope
1•momentmaker•10m ago•1 comments

My hobby compiler is now compiling a company's production app

https://edgepython.com/getting-started/introduction
1•dylansuttonc•11m ago•1 comments

The rock star founder behind China's Moonshot AI

https://www.ft.com/content/4730ad91-66aa-477c-9246-6d946afb0c8c
1•nhannht•12m ago•0 comments

Small context menu encryption tool

https://github.com/jvsteiner/fingerlock
1•javast98•15m ago•1 comments

Feedboard – An open-source feedback, roadmap, and changelog

https://feedboard.io/
1•chiragasarpota•15m ago•0 comments

Action Potentials for July

https://neurobiology.substack.com/p/action-potentials-for-july-505
1•paulpauper•16m ago•0 comments

My Dog Is The Best – A dog journal

https://mydogisthebest.org/
2•rrr_oh_man•17m ago•0 comments

Codeberg Disallows Cryptocurrency Projects

https://codeberg.org/Codeberg/org/commit/f383b648fd733ab88083dc390b91e77cd7589980
2•cdrnsf•18m ago•0 comments

GrapheneOS duress PIN could land a man in prison

https://www.androidauthority.com/grapheneos-duress-pin-us-prosecution-3691271/
5•samtheprogram•18m ago•2 comments

India's 'cockroach' movement halts protests after minister quits

https://www.ft.com/content/5f267b7d-9e57-40f6-9bb5-6fe5d6cf9d1d
1•JumpCrisscross•19m ago•0 comments

The Bliss of Graphene

https://srikanthperinkulam.com/2026/07/20/the-bliss-of-graphene
2•speckx•21m ago•0 comments

Magic codec – preprocessing for the Python interpreter (2024)

https://github.com/Tsche/magic_codec
1•zbentley•22m ago•0 comments

Bloomberg published an article based on false information sent from a fake email

https://twitter.com/yatharthmann/status/2081016902890168741
3•porridgeraisin•22m ago•0 comments

How to Recalculate a Spreadsheet

https://lord.io/spreadsheets/
2•thunderbong•23m ago•0 comments

Steps to Secure Your Authentication System

https://fusionauth.io/articles/security/steps-secure-your-authentication-system
2•mooreds•26m ago•0 comments

Emacs Dedicate Windows with toggle-window-dedicated

https://emacsredux.com/blog/2026/07/22/dedicate-windows-with-toggle-window-dedicated/
1•speckx•26m ago•0 comments

The pickle season runs on five business mechanisms

https://www.tsoon.com/posts/pickle-season/
1•mooreds•26m ago•0 comments

Handoff, a memory-only replicated KV on an eviction-prone substrate

https://tlc.proc.io/hub/623f9b12-a08b-4b6d-850a-29d58934eb61/Handoff
1•polvi•26m ago•0 comments

Kain – A non-von Neumann language (Zero GC, Python syntax, no borrow checker)

https://github.com/kainlang/kain
1•ephemara•27m ago•1 comments

Three out of four job postings won't tell you the pay

https://jobweb.io/blog/job-postings-hide-pay/
1•mooreds•27m ago•1 comments

All things are systems – the Idlewild Acres case

https://www.roderick.dev/writing/2026-07-25-systems-axioms-impacts/
1•tomrod•28m ago•0 comments