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

Testosterone Administration Induces a Red Shift in Democrats

https://www.vice.com/en/article/testosterone-hormone-politics-research/
1•bilsbie•17s ago•0 comments

How the LSAT Become the Ticketmaster of Law School Admissions

https://www.thebignewsletter.com/p/the-law-school-admissions-racket
1•connor11528•1m ago•0 comments

Project HydraFusion: Frontier quality via multi-model orchestration

https://github.blog/ai-and-ml/github-copilot/project-hydrafusion-frontier-quality-via-multi-model...
1•qainsights•1m ago•0 comments

What the Third Reich Can Teach Us About America Today

https://www.nytimes.com/2026/09/01/books/review/53-days-timothy-ryback.html
2•connor11528•2m ago•1 comments

Language Models Need Inductive Biases to Count Inductively (2024)

https://arxiv.org/abs/2405.20131
1•wslh•5m ago•0 comments

White House debuts video games

https://apnews.com/article/trump-white-house-video-game-arcade-d540ff089ed5b1d432715a4209b16a23
3•_doctor_love•5m ago•0 comments

OpenAI: GPT-6 Astra Model guidance

https://developers.openai.com/api/docs/guides/latest-model
1•tosh•7m ago•0 comments

Rare Half-Male, Half-Female Bird Took Up Residence Outside of Chicago

https://www.smithsonianmag.com/smart-news/an-extremely-rare-half-male-half-female-bird-temporaril...
1•gmays•7m ago•0 comments

Porsche Unleashed

https://www.filfre.net/2026/09/porsche-unleashed/
1•doppp•10m ago•0 comments

What shifts threshold distributions in social contagions?

https://arxiv.org/abs/2510.04785
1•StatsAreFun•10m ago•0 comments

USPS Plays a 'Puzzle Game' with the Right to Vote

https://www.lawfaremedia.org/article/usps-plays-a-%27puzzle-game%27-with-the-right-to-vote
3•hn_acker•11m ago•0 comments

Cash in on the AI Boom by Renting Out Your Spare Compute

https://spectrum.ieee.org/ai-inference-distributed-computing
1•gadgetboy•12m ago•0 comments

The Art of Simplifying Decisions

https://dpereira.substack.com/p/the-art-of-simplifying-decisions
2•herbertl•12m ago•0 comments

GitHub Stacks in Jujutsu

https://alan.norbauer.com/articles/github-stacks-with-jujutsu/
1•birdculture•13m ago•0 comments

UN to move to Equal Earth Projection

https://en.wikipedia.org/wiki/Equal_Earth_projection
1•dguest•13m ago•0 comments

Flowtica Verso

https://www.flowtica.ai/pages/flowtica-verso
1•heyzac•14m ago•0 comments

UN votes to adopt new map that makes our world look different

https://www.cnn.com/2026/09/04/world/un-vote-new-world-map-intl-scli
3•everybodyknows•14m ago•0 comments

UN to vote on adopting new world map that shows true size of all countries

https://www.independent.co.uk/news/world/mercator-map-change-un-africa-b3044531.html
3•Markoff•14m ago•0 comments

Engineers grieve a job that no longer exists

https://leaddev.com/career-development/engineers-grieve-a-job-that-no-longer-exists
2•tonkkatonka•15m ago•3 comments

Baseline existing JVM architecture violations and block new ones

https://github.com/aalsanie/shamash
1•aalsanie•17m ago•1 comments

Search agent beats GPT-6 Astra on benchmarks, just days after release

https://findcheap.ai/introducing-findcheap
1•givesushi•17m ago•0 comments

The Joy of Making Stuff with a 3D Printer

https://notetoself.studio/post/the-joy-of-3d-printing/
2•karakoram•18m ago•0 comments

Have We Destroyed Childhood?

https://www.newyorker.com/culture/open-questions/have-we-destroyed-childhood
1•Brajeshwar•19m ago•0 comments

Understanding China's Frontier AI Landscape

https://www.emergingtrajectories.com/lh/frontier-ai-in-china/
3•cl42•22m ago•0 comments

Elon Musk argues with chess.com

https://twitter.com/elonmusk/status/2095868436597354751
2•tosh•23m ago•0 comments

PMF Signal – an idea-validation tool built to say no

https://pmfsignal.com
1•rui_m_luis•25m ago•0 comments

Please Define Your Jargon

https://extralongdivision.com/articles/please-define-your-jargon/
1•extralongdivisi•25m ago•0 comments

Industry Standard Tools

https://industrystandard.tools/
1•karakoram•25m ago•0 comments

Language Models Can Control Their Own Attention

https://academy.dair.ai/papers/language-models-can-control-their-own-attention-2609.02737
2•omarsar•28m ago•0 comments

Developers want to write code by hand

https://orchidfiles.com/write-code-by-hand/
3•theorchid•31m ago•0 comments