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

Tiny drones are powered by sound

https://actu.epfl.ch/news/these-tiny-drones-are-powered-by-sound-2/
1•simonebrunozzi•1m ago•0 comments

Jane Street took $15B hit in July tied to Situational Awareness

https://www.reuters.com/business/finance/jane-street-took-15-billion-hit-july-tied-situational-aw...
1•paulpauper•2m ago•0 comments

A mother has spent years caring for her special-needs child

https://www.washingtonpost.com/health/2026/08/16/she-spent-years-caring-her-child-with-disabiliti...
1•paulpauper•2m ago•0 comments

Worse Is Better Considered Harmful

https://cs.stanford.edu/people/eroberts/cs201/projects/2010-11/WorseIsBetter/index.php/Main_Page....
1•so-cal-schemer•2m ago•1 comments

Stock Market Bargains Are Hiding in This Overlooked Place

https://www.wsj.com/finance/stocks/stock-market-bargains-are-hiding-in-this-overlooked-place-6239...
1•paulpauper•3m ago•0 comments

ASCII City Update: Interiors, Elevation and Skyscrapers [video]

https://www.youtube.com/watch?v=UCKEDWowc0o
1•galleywest200•5m ago•1 comments

Companies that buy and sell your data are not following CA’s strict privacy laws

https://hai.stanford.edu/news/companies-that-buy-and-sell-your-data-are-not-following-californias...
1•hhs•6m ago•0 comments

Free Brain-Computer Interface in Udemy

https://www.reddit.com/r/PiEEG_club/comments/1vvq6j7/5_free_eegbci_courses_join_the_new_1020_acad...
1•Christiangmer•9m ago•0 comments

Digital amnesia: Taking screenshots makes you more likely to forget information

https://www.binghamton.edu/news/story/6397/digital-amnesia-taking-screenshots-makes-you-more-like...
1•hhs•11m ago•1 comments

Quiet on set. How AI transformed China's microdrama scene

https://www.cnn.com/2026/08/22/style/short-drama-ai-china-intl-hnk
1•T-A•13m ago•0 comments

Stelm – A BYOC canvas for AWS infra

https://stelm.dev/
1•tredex•13m ago•0 comments

Europe Is Building an Impossible Fusion Reactor [Ben Miles] [video]

https://www.youtube.com/watch?v=bPUAKW1Dyek
2•mdp2021•14m ago•0 comments

Netscape's Rise and Fall: A Browser Wars History

https://medium.com/@gp2030/netscapes-rise-and-fall-a-browser-wars-history-8546e3b52092
1•Bluestein•16m ago•1 comments

How much is crawling your content worth to an AI bot?

https://insights.som.yale.edu/insights/how-much-is-crawling-your-content-worth-to-an-ai-bot
1•hhs•17m ago•0 comments

MiniMax M3 Medium hits 73.17% F1 on DeepSearchQA, near GPT-5 High

https://huggingface.co/datasets/youdotcom/minimax-m3-deepsearchqa-skill-eval
1•EdwardIrby•17m ago•0 comments

People vs. the AI Overlords

https://anarc.at/blog/2026-08-18-people-vs-ai-overlords/
1•edward•20m ago•0 comments

From Mega-Machines to Mega-Algorithms (2015)

https://thenewinquiry.com/from-mega-machines-to-mega-algorithms/
1•measurablefunc•20m ago•0 comments

Mysterious Astroturf Group Popped Up to Defend the Paramount Merger

https://theintercept.com/2026/08/21/paramount-merger-warner-discovery-david-ellison-antitrust/
3•mukmuk•22m ago•0 comments

The Biblical myth of the CREATION of EVE, the first woman

https://medium.com/freedomofthought/the-biblical-myth-of-the-creation-of-eve-the-first-woman-0f2d...
1•raynchad•23m ago•0 comments

Follow live the open training of a 535B (23B activated) LLM

https://twitter.com/percyliang/status/2090918065634684997
1•ggcr•25m ago•1 comments

436× faster exact state updates with a disk-backed incremental Merkle tree

https://github.com/yangofzeal/Hkd_merkle
1•msyang2004_82•26m ago•0 comments

Show HN: Structo – Claude Code for short form writing

https://structo.redbeardlab.com/
2•siscia•26m ago•0 comments

Optical Earth – Earth as the human eye would see it

https://www.opticalearth.com/
2•afterglowreader•27m ago•1 comments

Ordinary agent tool calls can create shadow delegation

https://niyikiza.com/posts/agents-to-agents/
2•niyikiza•28m ago•0 comments

Microscheme: A functional programming language for the Arduino

https://ryansuchocki.github.io/microscheme/
2•so-cal-schemer•37m ago•1 comments

NanoGPT Speedrun Frontier

https://www.primeintellect.ai/research/nanogpt-speedrun
3•stared•38m ago•0 comments

Pre-Scheme: a Scheme for low-level programming

https://prescheme.org/
2•so-cal-schemer•39m ago•1 comments

Why Some People Are Born with Devastating Gene Conditions–and Never Get Sick

https://www.nationalgeographic.com/health/article/genetic-mutation-inherited-disease-dna
3•bookofjoe•39m ago•1 comments

China recovers rocket stage on land for the first time

https://apnews.com/article/china-space-rocket-reuse-land-7280ab07f29771e2034a917ff679e1a6
4•root-parent•39m ago•0 comments

Palantir Billionaire's Passion Project Is Criminalizing Homelessness

https://www.motherjones.com/politics/2026/08/joe-londsdale-cicero-institute-homelessness/
4•cdrnsf•40m ago•0 comments