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

Costco and Safeway are getting housing built where others fail

https://www.governance.fyi/p/costco-and-safeway-are-getting-housing
1•MaysonL•36s ago•0 comments

The 5% freakout: Inside tech elites' war against the California billionaire tax

https://sfstandard.com/2026/06/13/billionaire-tax-fight-sergey-brin-chris-larsen-mike-moritz-ron-...
2•frb•37s ago•0 comments

If your product is Great, it doesn't need to be Good (2010)

http://paulbuchheit.blogspot.com/2010/02/if-your-product-is-great-it-doesnt-need.html
1•skogstokig•2m ago•0 comments

The Curious Case of Youngening Grad Students

https://www.collegetowns.org/p/the-curious-case-of-youngening-grad
1•raybb•2m ago•0 comments

EU Air travellers to enjoy free cabin luggage and keep delay compensation

https://www.euronews.com/my-europe/2026/06/15/air-travellers-to-enjoy-free-cabin-luggage-and-keep...
2•TechTechTech•3m ago•0 comments

Typst 0.15.0

https://typst.app/docs/changelog/0.15.0/
2•schu•4m ago•0 comments

Java's Project Valhalla lands a preview in JDK 28

https://www.theregister.com/devops/2026/06/15/javas-project-valhalla-finally-lands-a-preview-in-j...
1•mfiguiere•5m ago•0 comments

Dozens walk out as Google boss Pichai addresses Stanford graduates

https://www.bbc.com/news/articles/cqx10gg2r2vo
2•leopoldj•8m ago•0 comments

US Army commissions second cohort of tech executives into innovation unit

https://www.militarytimes.com/news/your-military/2026/06/12/us-army-commissions-second-cohort-of-...
1•tiagod•10m ago•0 comments

How AI is revealing the secret lives of animals from hummingbirds to pumas

https://www.nature.com/articles/d41586-026-01887-w
1•Brajeshwar•14m ago•0 comments

PhoenixDKIM 1.0.0 Released – First Stable release

https://www.phoenixdkim.org/announcements/phoenixdkim-1.0.0.html
1•peregrinus_13•16m ago•1 comments

How Many Elementary Particles Are There, Really?

https://www.quantamagazine.org/how-many-elementary-particles-are-there-really-20260615/
1•ibobev•16m ago•0 comments

Seventeen Camels and Where They Can Take You

https://mathenchant.wordpress.com/2026/06/15/seventeen-camels-and-where-they-can-take-you/
1•ibobev•16m ago•0 comments

In-N-Out Animations: Popovers (Part 2/3)

https://master.dev/blog/in-n-out-animations-popovers-part-2-3/
1•ibobev•16m ago•0 comments

The Golden Age of AI Applications

https://tomtunguz.com/golden-age-of-applications/
1•swolpers•18m ago•0 comments

Show HN: Quickish – Instant HTML Hosting

https://quickish.website
1•PaybackTony•19m ago•0 comments

Anthropic shuts down Fable, Mythos models

https://arstechnica.com/ai/2026/06/anthropic-shuts-down-fable-mythos-models-following-trump-admin...
2•Hypathia•21m ago•0 comments

The Window Has Closed

https://twitter.com/AndrewCurran_/status/2066332670817456584
2•gmays•22m ago•0 comments

Eratosthenes

https://en.wikipedia.org/wiki/Eratosthenes
2•helterskelter•23m ago•0 comments

Long-term lithium treatment is associated with longer leukocyte telomeres (2013)

https://pubmed.ncbi.nlm.nih.gov/23695236/
1•helterskelter•25m ago•0 comments

Show HN: AutoLISP in Rust/WASM, reused to script GLDF and IFC file formats

https://gldf.icu
1•holg•26m ago•2 comments

Recursion got into programming: a tale of intrigue (2014)

https://vanemden.wordpress.com/2014/06/18/how-recursion-got-into-programming-a-comedy-of-errors-3/
1•downbad_•26m ago•0 comments

A man with ALS is "the first power user" of a brain implant that lets him sp

https://www.technologyreview.com/2026/06/15/1138953/man-als-first-power-user-brain-implant-speak-...
2•joozio•26m ago•0 comments

Ask HN: Specialization to stay relevant in the age of AI

1•WhyIsItAlwaysHN•26m ago•0 comments

Ask HN: Can you stay relevant against AI via specialization

1•WhyIsItAlwaysHN•27m ago•1 comments

How Anthropic trained Fable 5 => by analysing its reasoning traces

https://ankitmaloo.com/fable/
4•ankit219•28m ago•0 comments

The SDK Is for Developers. The MCP Server Is for Agents

https://blog.bridgexapi.io/the-sdk-is-for-developers-the-mcp-server-is-for-agents
2•Bridgexapi•30m ago•0 comments

Scaling Security Insights at Cloudflare

https://blog.cloudflare.com/scaling-security-scans/
1•FlyingSnake•30m ago•0 comments

Can Compute Commoditize If It's Not Fungible?

https://davefriedman.substack.com/p/can-compute-commoditize-if-its-not
1•gmays•31m ago•0 comments

Programming Language Design and Implementation (PLDI) 2026 Live Streams

https://pldi26.sigplan.org/attending/live-streams
2•matt_d•31m ago•0 comments