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

China Is Devastating the Last Stronghold of German Industry

https://www.wsj.com/economy/china-is-devastating-the-last-stronghold-of-german-industry-c7a98514
1•JumpCrisscross•10s ago•0 comments

The New MCP Specification: What Security Teams Must Prepare For

https://www.akamai.com/blog/security-research/new-mcp-specification-security-teams-must-prepare
1•mooreds•1m ago•0 comments

Are MAGA and MAHA Heading for Divorce

https://www.rollingstone.com/politics/politics-features/maha-maga-alliance-fracture-robert-kenned...
1•maxerickson•3m ago•0 comments

How to benchmark persistent repo memory for coding agents

https://autoloops.ai/greplica/blog/benchmarking-greplica/
1•kushalpatil07•4m ago•1 comments

Potential session/cache leakage between workspace instances or consumer accounts

https://github.com/anthropics/claude-code/issues/74066
1•chatmasta•4m ago•0 comments

How working memory could give rise to consciousness

https://www.scientificamerican.com/article/how-working-memory-could-give-rise-to-consciousness/
1•bookofjoe•5m ago•1 comments

A martian rock has lots of carbon on it, and it's not clear why

https://arstechnica.com/science/2026/07/a-martian-rock-has-lots-of-carbon-on-it-and-its-not-clear...
2•Brajeshwar•8m ago•0 comments

Warner bill would create federally vetted list for secure, trustworthy AI agents

https://cyberscoop.com/ai-agent-act-senate-draft-bill-mark-warner/
2•softwaredoug•8m ago•1 comments

One engine, many tools – Introducing Rubydex

https://railsatscale.com/2026-05-12-one-engine-many-tools/
1•frou_dh•12m ago•0 comments

Fake AI Agent Skill Slipped Past Every Scanner

https://www.csoonline.com/article/4188840/how-a-malicious-ai-agent-skill-passed-security-checks-a...
1•shivamthange•13m ago•0 comments

Thinking about buying a Prusa 3D printer?

https://bambu3design.com/prusa-summer-sale-2026-mk4s-gets-up-to-20-off-core-one-shipping-discount/
1•ehsanamel•13m ago•0 comments

Write Code, Not Specs

https://softwaredoug.com/blog/2026/07/04/write-code-not-specs
1•softwaredoug•14m ago•0 comments

BitTorrent's disastrous, legendary, and controversial story

https://www.theverge.com/tech/959848/bittorrent-story-25-years-piracy
1•blakesterz•16m ago•1 comments

Cultural effects of the Western African Ebola virus epidemic

https://en.wikipedia.org/wiki/Cultural_effects_of_the_Western_African_Ebola_virus_epidemic
1•YeGoblynQueenne•17m ago•0 comments

Show HN: Quick and dirty inter-agent collaboration

https://github.com/ovidiuiliescu/simpleagentchat
1•ovvyblabla•18m ago•0 comments

'clustered index penalty' on all non-clustered indexes

https://use-the-index-luke.com/blog/2014-01/unreasonable-defaults-primary-key-clustering-key
1•tosh•19m ago•0 comments

How the Biosphere 2 experiment changed our understanding of the Earth (2025)

https://www.bbc.com/future/article/20250703-how-the-biosphere-2-experiment-changed-our-understand...
2•taubek•19m ago•0 comments

Ask HN: What are you working on? (July 2026)

2•vinhnx•20m ago•2 comments

Cosmos DB

https://en.wikipedia.org/wiki/Cosmos_DB
1•tosh•24m ago•0 comments

Show HN: Language Learning Roguelike Game

https://language.aitida.com
1•howthisends•28m ago•0 comments

Fable5-world-demo: 3D world built by Claude Fable 5 using Three.js

https://github.com/Braffolk/fable5-world-demo
2•Garbage•30m ago•0 comments

Nearly a Million Investors Lost a Total of $3.8B on Trump Crypto Coin

https://www.nytimes.com/2026/07/04/us/politics/nearly-a-million-investors-lost-a-total-of-3-8-bil...
2•_tk_•30m ago•1 comments

The Purgatory Job Market of 2026

https://www.nytimes.com/2026/07/04/opinion/purgatory-job-market.html
1•littlexsparkee•31m ago•0 comments

Show HN: Mycelium – AI agent plugin guiding you from purpose to market

https://github.com/haabe/mycelium
1•haabe•33m ago•0 comments

Intelligence Agencies, a Fight over Building a Master List of Spies

https://www.nytimes.com/2026/06/29/us/trump-intelligence-agencies-spies-master-list.html
1•JumpCrisscross•38m ago•0 comments

Division Polynomials of Elliptic Curves in Python

https://leetarxiv.substack.com/p/division-polynomials-of-elliptic
1•thunderbong•39m ago•0 comments

AI-powered mass emails are warping local politics

https://www.msn.com/en-us/news/technology/ai-powered-mass-emails-are-warping-local-energy-climate...
3•rwmj•41m ago•0 comments

AI search could kill the web without new quality signals and revenue models

https://theguptalog.blogspot.com/2026/07/ai-search-could-kill-web-without-new.html
1•bhartipoddar•45m ago•1 comments

The Graduate-School Dropout Toppling a Country's Academic Stars

https://www.wsj.com/science/the-graduate-school-dropout-toppling-chinas-academic-stars-3c1e5d86
2•ilamont•46m ago•0 comments

Hyperia 0.15.20 released: Terminals for Agents and Humans

https://github.com/DeepBlueDynamics/hyperia/releases
1•kordlessagain•46m ago•1 comments