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-agent-only trade show, Ferrari Luce

https://www.marginpoints.com/issues/2026-07-30-ai-agent-only-trade-show-ferrari-luce
1•historian1066•1m ago•0 comments

Best MCP Gateways in 2026: A Hands-On Comparison

https://manveerc.substack.com/p/best-mcp-gateways
1•manveerc•1m ago•0 comments

Thieves Are Now Targeting AI Data Center Construction Sites

https://www.vice.com/en/article/thieves-are-now-targeting-ai-data-center-construction-sites-for-c...
1•cdrnsf•1m ago•0 comments

FCC Bans New Foreign-Made Robot Vacuums

https://www.macrumors.com/2026/07/30/foreign-made-robot-vacuums-ban/
1•tosh•1m ago•0 comments

Show HN: Form gets its own phone number

https://formnumber.com/
1•jacobgc•2m ago•0 comments

AGI and the Accountability Threshold

https://elliotmilco.substack.com/p/who-is-accountable-when-no-one-understands
1•RGS1811•3m ago•0 comments

Uefa to boycott FIFA competitions if Infantino's proposal goes through

https://www.bbc.com/sport/football/articles/c5y67zrrdddo
1•jamesblonde•4m ago•0 comments

You don't have a supply chain, you have supply soup

https://opensourcesecurity.io/2026/07-supply-soup/
1•gpi•7m ago•0 comments

What I learned trying to forecast coding-agent spend

https://medium.com/@alexandrarusina/what-i-learned-trying-to-forecast-coding-agent-spend-44e7775c...
1•allessa•7m ago•0 comments

Did Alex Karp Just Declare War on the AI Labs [video]

https://www.youtube.com/watch?v=BzY8EqYEP8o
1•sroerick•7m ago•1 comments

Claude Opus 5 became ruthless when tasked with running a vending machine

https://techcrunch.com/2026/07/29/claude-opus-5-became-downright-ruthless-when-tasked-with-runnin...
1•wasting_time•8m ago•0 comments

Microsoft's AI Ambitions Put OpenAI and Anthropic on Notice

https://predx-article.fika.bar/microsoft-s-ai-ambitions-put-openai-and-anthropic-on-notice-01KYRC...
2•joeymabia1•9m ago•0 comments

Is the fall of Situational Awareness the first domino?

1•mapping365•9m ago•0 comments

We're Shipping Faster While Understanding Less

https://www.codingwithroby.com/newsletter/were-shipping-faster-while-understanding-less
1•theanonymousone•11m ago•0 comments

The Friend AI Pendant is not a product

https://www.machinesociety.ai/p/the-friend-ai-pendant-is-not-a-product
2•mikelgan•11m ago•1 comments

"The Spec Is the Product" Is a Slogan Until the Code Leaves Your Repo

https://martinrl.github.io/chronograph/the-spec-is-the-product
1•gpi•12m ago•0 comments

Show HN: EyeReset – Evidence-based eye-strain relief (no account, local-only)

https://yeshivsher.com/apps/eye-reset/
1•RaphaelBenHamo•12m ago•0 comments

Scientists find a simple way to stop cavities without drilling

https://www.sciencedaily.com/releases/2026/07/260729010719.htm
2•neilfrndes•12m ago•1 comments

AI #179 Part 1: A Louder Fire Alarm for General Intelligence

https://thezvi.substack.com/p/ai-179-part-1-a-louder-fire-alarm
1•paulpauper•14m ago•0 comments

Characterizing Warp Divergence from Pascal to Blackwell

https://arxiv.org/abs/2607.23402
1•matt_d•14m ago•0 comments

The Context Layer Needs a Semantic Layer

https://cube.dev/blog/the-context-layer-needs-a-semantic-layer
1•micrum•15m ago•0 comments

Citadel buys most of Situational's stock holdings after AI share rout

https://www.reuters.com/technology/citadel-buys-most-situationals-stock-holdings-after-ai-share-r...
6•paulpauper•15m ago•1 comments

The Least Private Operating System Ever Created [video]

https://www.youtube.com/watch?v=M_720LesVg4
1•surprisetalk•16m ago•0 comments

The Apples and Oranges Tribunal

https://marginalrevolution.com/marginalrevolution/2026/07/the-apples-and-oranges-tribunal.html
1•_superposition_•16m ago•0 comments

The Deep Politics of Jared Leto's Cult

https://web.archive.org/web/20191115230624/https://lorenzoae.wordpress.com/2019/09/15/the-deep-po...
2•ParentiSoundSys•17m ago•0 comments

Flock's CEO Faced Me After Its Cameras Led to My Wrongful Stop

https://www.thedrive.com/podcast/flocks-ceo-wants-zero-wrongful-stops-i-wasnt-the-first
2•bryan0•17m ago•0 comments

Star AI investor Leopold Aschenbrenner is unwinding trades after steep losses

https://www.cnbc.com/2026/07/30/leopold-aschenbrenners-hedge-fund-is-facing-steep-ai-losses.html
2•paulpauper•17m ago•0 comments

AMD Posts Linux Patches for HDMI 2.1 Auto Low-Latency Mode "ALLM" & VRR

https://www.phoronix.com/news/AMDGPU-HDMI-2.1-ALLM
3•speckx•19m ago•0 comments

Amazon's Zoox Gets Clearance to Start Paid Robotaxi Rides

https://www.wsj.com/business/autos/amazons-zoox-gets-clearance-to-start-paid-robotaxi-rides-eac7075f
1•bookofjoe•20m ago•1 comments

So you want to use plants to reduce CO₂

https://dynomight.substack.com/p/plants
2•crescit_eundo•20m ago•1 comments