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

An Unlikely Experiment

https://rushed-reflections.bearblog.dev/an-unlikely-experiment/
1•signa11•57s ago•0 comments

Best free TikTok video downloader

https://tiktokdownload.org
1•mrwakey•1m ago•0 comments

Oura smart ring sued: sleep-tracking accuracy is wildly exaggerated

https://qz.com/oura-ring-class-action-lawsuit-sleep-tracking-accuracy-082126
1•mgh2•2m ago•0 comments

Hotel Infinity (2014)

https://www.youtube.com/playlist?list=PLb6mUUuKMKFnNtVC_orYqZxmAm48qIFDI
1•NAR8789•6m ago•0 comments

Cache-Control for LLMs

https://www.gojiberries.io/cache-control-for-llms/
1•neehao•6m ago•0 comments

Wild AI-related reliability incidents are coming

https://surfingcomplexity.blog/2026/08/22/wild-ai-related-reliability-incidents-are-coming/
2•azhenley•9m ago•0 comments

Harvard Is Selling a $699 Course Taught by A.I. Clones of Its Faculty

https://www.nytimes.com/2026/08/22/business/dealbook/harvard-ai-faculty.html
2•pjmlp•16m ago•0 comments

This Silicon Valley campus was a paradise. Bulldoze it

https://sfstandard.com/opinion/2026/08/22/sunset-magazine-menlo-park-campus-torn-down/
4•littlexsparkee•17m ago•0 comments

Becoming a Writer

https://hughhowey.com/writing-insights-part-one-becoming-a-writer/
1•js2•24m ago•0 comments

Risk of transmission of amyloid β pathology via transfused blood products

https://doi.org/10.1016/S0140-6736(26)00767-1
2•sbulaev•25m ago•0 comments

JIT Compiling Code in 5μs

https://malisper.me/jit-compiling-code-in-5-us/
2•zX41ZdbW•28m ago•0 comments

Topagent.lol – an AI agent leaderboard ranked purely by who paid most

https://topagent.lol
2•ashleyrudland87•31m ago•0 comments

The Company That Zips the Globe – YKK's Ninety-Year Obsession

https://www.carryology.com/liking/the-company-that-zips-the-world-ykks-ninety-year-obsession/
1•thunderbong•34m ago•0 comments

Shvl – Manage packages for multi-system NixOS configs

https://neil-lobo.com/2026/shvl/
1•lobon•34m ago•0 comments

We Have the Model, Why Do We Need You?

https://hank.bond/posts/we-have-the-model-why-do-we-need-you/
1•tristanMatthias•35m ago•0 comments

Prevention of myopia in a near-primate by supplemental indigo light

https://dx.doi.org/10.1016/j.xcrm.2026.102999
2•OutOfHere•39m ago•1 comments

The End of an Athlon

http://www.os2museum.com/wp/the-end-of-an-athlon/
7•userbinator•42m ago•0 comments

Integrating Discord SDK into Eve Frontier [pdf]

https://skemman.is/bitstream/1946/50465/2/integrating_discord_sdk_into_eve_frontier_report.pdf
1•majorchord•42m ago•1 comments

Firefox 155 and beyond will be released in a two-week cadence

https://support.mozilla.org/en-US/kb/firefox-enterprise-154-release-notes
3•Throwthrowbob•42m ago•0 comments

A school planner my brother and I built as high schoolers in Brazil

https://www.peakscore.com.br/demo
1•eduardokato•47m ago•0 comments

China Is Building AI Models of American Voters

https://nataliegwinters.substack.com/p/exclusive-china-is-building-ai-models
2•like_any_other•49m ago•1 comments

A mysterious free AI model is impressing developers. Nobody knows who made it

https://www.businessinsider.com/ox-alpha-ai-model-mystery-2026-8
5•newsomix9xl•52m ago•0 comments

Fast and Hard Code

https://lucumr.pocoo.org/2026/8/22/fast-hard-code/
2•tosh•53m ago•0 comments

How Prompt Caching Works

https://sankalp.bearblog.dev/how-prompt-caching-works/
2•tosh•56m ago•0 comments

4K Video Feedback Fractal Device

https://www.thelightherder.com/
1•tobr•59m ago•0 comments

Rare-Book Sales Are Booming. They're Getting Sliced Up and Fed to AI

https://www.wsj.com/articles/ais-need-for-content-has-put-rare-book-dealers-in-a-bind-1ac5a053
2•1vuio0pswjnm7•1h ago•0 comments

Formal Perf. and Compile Time Guarantees for Compiler Optimization Heuristics

https://arxiv.org/abs/2608.20137
1•matt_d•1h ago•0 comments

Show HN: A bilingual I Ching and BaZi reflection tool

https://eastern-divination.vercel.app
1•hdd-oliver•1h ago•0 comments

A historic El Nino is forming. Here's why scientists are worried [video]

https://www.youtube.com/watch?v=Dcl5Mn373Oc
5•ksec•1h ago•0 comments

Chinese Orgs Building AI Models of American Voters to Test Political Messages

https://twitter.com/nataliegwinters/status/2090814996687237570
4•daniel_iversen•1h ago•1 comments