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

NYC's last horse track, Aqueduct, ending live races

https://apnews.com/article/nyc-horse-racing-track-closing-aqueduct-c52bac4978ba99d2c921408ffdf05f13
1•geox•5m ago•0 comments

What Everyone Gets Wrong About AI and Learning [video]

https://www.youtube.com/watch?v=0xS68sl2D70
1•thunderbong•8m ago•0 comments

How much does a token cost?

https://www.erikjs.com/experiences/llm-token-counter
1•csgod•11m ago•0 comments

A New Fossil Discovery Just Rewrote 150 Years of Evolutionary Theory

https://www.404media.co/a-new-fossil-discovery-just-rewrote-150-years-of-evolutionary-theory/
1•susiecambria•17m ago•0 comments

The "Digital Cash Envelope": Making Crypto Gifting as Easy as Cash

https://www.indiehackers.com/post/the-digital-cash-envelope-making-crypto-gifting-as-easy-as-cash...
1•mybucks_online•21m ago•0 comments

Eyes Do More Than See (1965) – Isaac Asimov

http://www-graphics.stanford.edu/~tolis/toli/other/eyes.html
1•kegenaar•22m ago•0 comments

Fine-tuned a model on Advaita Vedanta text

https://huggingface.co/aaravshirpurkar/turiya-model
2•aaravshirpurkar•26m ago•1 comments

Plane slams into Beijing's tallest building, sends debris raining down [video]

https://www.youtube.com/watch?v=YNJYR_HE8uo
2•Imustaskforhelp•29m ago•0 comments

Search SDK – Integrate web search into agents

https://search-sdk.dev/
1•haxzie•31m ago•0 comments

Sequence Modeling with CTC

https://distill.pub/2017/ctc/
1•diginova•32m ago•0 comments

WebSite Grader and Analytics for Small Businesses

https://stackra.app/
1•LBeck84•34m ago•0 comments

Show HN: PhoneCode: Local-First ADE Running Natively on Android

https://github.com/dttdrv/phonecode
1•dttdrv•34m ago•0 comments

A model-free runtime that holds photonic/quantum hardware steady under drift

https://compute.neophotonics.ca/
1•quantumbum•39m ago•0 comments

Higher rate limits on the Claude API

https://platform.claude.com/docs/en/api/rate-limits
1•thedebuglife•41m ago•0 comments

Show HN: Cyclearchive.com – search vintage cycling magazines

https://cyclearchive.com/search/
1•alastairr•43m ago•0 comments

How to evaluate multimodal VLMs for your video use case

https://labs.videodb.io/research/how-to-evaluate-multimodal-vlms-for-your-video-use-case
1•notTechy•43m ago•0 comments

Show HN: Brytlog – AI logger

https://github.com/Guy-Sela/brytlog
1•guy-sela•50m ago•0 comments

The US lock of the Web – ache

https://ache.one/notes/the-us-lock-of-the-web
3•abdelhousni•52m ago•0 comments

World Cup fans frustrated by 'confusing and expensive' tipping culture in US

https://www.bbc.com/news/articles/clyxgjykx7lo
8•theanonymousone•53m ago•2 comments

I owe my life to a 1913 road rage incident

https://blog.plover.com/2026/06/27/#andor
2•Tomte•54m ago•0 comments

Early Computer Viruses Spread Before the Internet

https://comuniq.xyz/post?t=1328
1•01-_-•56m ago•0 comments

Ask HN: Has Ilya Sutskever spoken publicly lately?

4•aurenvale•56m ago•0 comments

The Calculator Discipline – AI-Assisted Disclosure Hallucinations

https://zenodo.org/records/20393083
1•ethical•1h ago•0 comments

Researchers have developed pixels that can emit and analyse light together

https://ethz.ch/en/news-and-events/eth-news/news/2026/06/a-new-type-of-pixel.html
2•tspng•1h ago•1 comments

Decline in IQ linked to frequent or dependent use of cannabis use in youth

https://www.cambridge.org/core/journals/psychological-medicine/article/intelligence-quotient-decl...
7•vixen99•1h ago•1 comments

Om interviews Brunello Cucinelli (2015)

https://om.co/2015/04/27/brunello-cucinelli-2/
2•tosh•1h ago•0 comments

US Military conducts strikes on Iran after attack on ship in Strait of Hormuz

https://twitter.com/BBCBreaking/status/2070610019578511419
3•aurenvale•1h ago•0 comments

NLNet Labs LLM Policy

https://nlnetlabs.nl/llm-policy/
5•birdculture•1h ago•1 comments

Clockwork, a browser engine of intermeshing gears and impossible motion

https://sand-morph.up.railway.app/clockwork
1•echohive42•1h ago•0 comments

Germany urges EU to suspend methane rules after US pressure

https://www.ft.com/content/c5c97c40-6afe-4a22-a9b8-aea456b85326
5•littlexsparkee•1h ago•1 comments