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

AI borrowing slows as investors grow wary of debt binge

https://www.ft.com/content/9c13d40e-d2b2-45d5-921c-a68cd4b308f9
1•1vuio0pswjnm7•49s ago•0 comments

The AI Torture Chamber

https://jesse.id/blog/the-ai-torture-chamber
1•jesse_dot_id•1m ago•0 comments

Why Do We Have Baby Teeth and Adult Teeth?

https://www.the-scientist.com/why-do-we-have-baby-teeth-and-adult-teeth-73746
1•Anon84•1m ago•0 comments

Autism in boys, girls looks genetically similar but early, late diagnoses don't

https://www.psypost.org/autism-in-boys-and-girls-looks-genetically-similar-but-early-and-late-dia...
1•theanonymousone•6m ago•0 comments

The Nature of the Swarm

https://hallerite.com/posts/on-the-nature-of-the-swarm/
1•hallerite•9m ago•0 comments

Microsoft Has $80B of AI Chips It Can't Plug in [video]

https://www.youtube.com/watch?v=es4FfRU8saQ
1•xbmcuser•9m ago•0 comments

Turing: Opposition from the Intellectuals

1•daly•11m ago•0 comments

Ariodb – a proxy that checks and can undo what AI agents do to your DB

https://github.com/roozjalali/ariodb
2•roozbehjalali•13m ago•0 comments

Advancing mathematics research with AI-driven formal proof search

https://www.science.org/doi/10.1126/science.aej2213
1•01-_-•14m ago•0 comments

The very bad ad for the very first laptop

https://buttondown.com/suchbadtechads/archive/hx-20-rubber-ducky/
1•rfarley04•17m ago•0 comments

Cited but Not Consulted: A Counterfactual Audit of Legal Chain-of-Thought

https://arxiv.org/abs/2610.12361
1•sbulaev•17m ago•0 comments

LLMs Aren't Inevitable

https://deadsimpletech.com/blog/llms-arent-inevitable
5•rizsyed1•20m ago•0 comments

Vega: A decision model that rolls a ball down a hill

https://www.nandakishorm.com/writing/vega
1•yarapavan•22m ago•0 comments

AI model submitted false tip about unsolved murder, Philadelphia police say

https://6abc.com/post/anthropic-ai-model-submitted-false-tip-unsolved-murder-philadelphia-police-...
1•geox•23m ago•0 comments

If LLMs Can Decide Without Fine-Tuning, Do We Still Need Models Like Jev?

https://itsodeleo.github.io/posts/local-decision-workflow/
1•LeoisNotAI•26m ago•0 comments

Custom Agents Are Antipatterns

https://simianwords.bearblog.dev/custom-agents-are-antipatterns/
1•simianwords•27m ago•0 comments

Show HN: AntiPDF – PDF as it should have been all along

https://antisoftworks.com/
1•civnode•28m ago•0 comments

The Beam Book, Second Edition

https://happihacking.com/resources/the-beam-book/
1•Tomte•28m ago•0 comments

Sitecopy.ai

1•Arizonabusiness•29m ago•0 comments

Sitecopy.ai

1•Arizonabusiness•32m ago•0 comments

Show HN: Pre Python 3.15 PEP 661 compat-sentinel

https://pypi.org/project/compat-sentinel/
4•owebeeone•40m ago•1 comments

A (Reasonably) Opinionated Comparison of Isabelle/HOL, Lean, HOL4, and Agda

https://blueberrywren.dev/blog/primes/
1•fanf2•42m ago•0 comments

November first: Western Canada keeps its clocks. Is your software ready?

https://julien.duponchelle.info/canada-stops-daylight-saving-time/
1•noplay•43m ago•0 comments

TallyCal: Signupgenius Alternative Without the Ads

https://tallycal.com/
1•sk24iam•43m ago•0 comments

Building Piclaw on Top of an Opinionated Coding Agent

https://taoofmac.com/space/blog/2026/08/21/2218
1•rcarmo•45m ago•0 comments

Elisha Wiesel: The Death of the Nobel Peace Prize

https://www.thefp.com/p/elie-wiesel-death-nobel-peace-prize-israel
3•myth_drannon•48m ago•2 comments

Retrieval Centric Deep Learning: Replacing Weight Matrices with Vector Databases

https://twitter.com/oswaldjoh/status/2108669918883230177
1•porridgeraisin•55m ago•0 comments

A simple liters to US and UK gallons converter

https://liters2gallons.com/
1•Bashar42•55m ago•1 comments

The deadlock at the top climate science body

https://www.reuters.com/sustainability/cop/inside-deadlock-worlds-top-climate-science-body-2026-1...
2•layer8•56m ago•0 comments

Characters open up a world of typosquatting opportunities in Chromium browsers

https://www.theregister.com/security/2026/10/10/two-characters-open-up-a-world-of-typosquatting-o...
3•sohkamyung•57m ago•0 comments