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

Show HN: PartSense – Smart inventory and BOM management for hardware labs

https://partsense.app
1•loicd31•1m ago•0 comments

Show HN: AI Meter – Local token usage with energy and water estimates

https://ai-meter.app
1•zeko1195•2m ago•0 comments

Names with the largest count in their first appearance on the national list

https://nobodynamed.com/viz/debut-of-the-year
1•michaelcolenso•2m ago•1 comments

Can AI Run a Food Truck Business?

https://foodtruckbench.com
1•handfuloflight•3m ago•0 comments

Kimi K3's Design Secret May Be in Its Thinking Traces

https://notes.designarena.ai/kimi-k3s-design-secret-may-be-in-its-thinking-traces/
2•giuliomagnifico•3m ago•0 comments

Classical Acceptance Is Not Hybrid Authentication: Measuring X.509 Verifier

https://arxiv.org/abs/2607.20800
1•sbulaev•6m ago•0 comments

Black Perl

https://en.wikipedia.org/wiki/Black_Perl
1•thunderbong•7m ago•0 comments

Japanese Firm to Train Robot with AI to Reproduce Runners' Movements

https://japannews.yomiuri.co.jp/science-nature/technology/20260403-320199/
1•mushstory•8m ago•0 comments

Setting up a remote environment for agentic coding on a VPS

https://ma.ttias.be/remote-coding-environment-vps/
1•nreece•11m ago•0 comments

Cut Token Costs in Half

https://tokenkits.vercel.app
1•mattmerrick•20m ago•0 comments

IT Atlas

https://www.levels.fyi/atlas
2•trekhleb•25m ago•0 comments

Show HN: RMCP.dev – An MCP server that finds other MCP servers

https://rmcp.dev/
1•garazy•26m ago•0 comments

Fountible: Agentic Figma

https://fountible.com/
1•handfuloflight•27m ago•0 comments

Reddit Calls Anthropic a 'Freeriding Pirate'

https://runtimewire.com/article/reddit-calls-anthropic-a-freeriding-pirate-and-cites-ruling-behin...
2•ryanmerket•28m ago•0 comments

Starship's Thirteenth Test Flight

https://www.spacex.com/launches/starship-flight-13v
1•JumpCrisscross•29m ago•0 comments

Hannah Fry Wins the Leelavati Prize in 2026 for Mathematics Outreach

https://www.maths.cam.ac.uk/features/professor-hannah-fry-wins-leelavati-prize
2•agnishom•29m ago•0 comments

US moves to regulate hidden car handles

https://www.semafor.com/article/07/23/2026/us-moves-to-regulate-hidden-car-handles
2•jmsflknr•32m ago•0 comments

Show HN: Maps of >100 theories for how society works inc. Graham / Thiel / Smith

https://society.clearerthinking.org/
1•bestOfSocrates•34m ago•0 comments

IBM Acquiring HRL Laboratories

https://newsroom.ibm.com/2026-07-23-ibm-to-acquire-hrl-laboratories-to-power-the-future-of-quantum
1•osnium123•35m ago•2 comments

Midjourney Releasing v8.2

1•endmund•43m ago•1 comments

Pliny the Liberator claims universal jailbreak of models

https://twitter.com/elder_plinius/status/2080767011614015543
2•dnw•46m ago•0 comments

Trump's Plan for Science: More Money for A.I., Less for Universities

https://www.nytimes.com/2026/07/22/us/politics/trump-research-funding-artificial-intelligence.html
4•cratermoon•52m ago•1 comments

22 Years of Rails

https://twitter.com/rails/status/2080580838530355432
1•vinnyglennon•1h ago•0 comments

Show HN: Codebeat – turn any function into a song (no signup)

https://www.codedswitch.com/codebeat
1•Asume21•1h ago•0 comments

A Great Deal of Information About Hacker News

https://vale.rocks/posts/hacker-news
2•OuterVale•1h ago•0 comments

Show HN: Jolta – Automatic per-project JDK switching (like Volta, for Java)

https://oneappplatform.github.io/jolta/
1•pdxdave•1h ago•0 comments

Ukraine' Simple But Effective Protection Against Russian Starlink Jamming (2023)

https://www.technology.org/2023/08/01/did-russia-learn-to-jam-starlink-satellites-ukraine-is-alre...
5•pinkmuffinere•1h ago•0 comments

Exercise Erased Half the Molecular Signature of Muscle Aging

https://www.gethealthspan.com/research/article/exercise-molecular-signature-muscle-aging?zp_type=...
2•bilsbie•1h ago•1 comments

Evaluation of a pentapropellant upper stage (1970) [pdf]

https://ntrs.nasa.gov/api/citations/19700022572/downloads/19700022572.pdf
2•Eridanus2•1h ago•0 comments

Show HN: Modelfac

1•IceRay•1h ago•1 comments