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

The Underground Economy Behind Children's Smartwatches in China

https://www.sixthtone.com/news/1017854
1•thenthenthen•2m ago•0 comments

High-Quality Free Transparent PNG Images

https://pngdex.com/
1•kanlabs•7m ago•0 comments

User awareness in frontier models: Who's asking shifts what models say

https://transluce.org/user-awareness#how-robust-are-these-effects
1•nlpnerd•10m ago•0 comments

Pair Team (YC S19) Hit with Class Action Alleging Unpaid Wages

https://runtimewire.com/article/exclusive-pair-team-hit-with-class-action-alleging-unpaid-wages-a...
1•ryanmerket•16m ago•0 comments

How to fine-tune open weights models

https://fastino.ai/blog/how-to-fine-tune-open-weights-models-model-selection-data-curation-fine-t...
1•eigenBasis•16m ago•0 comments

Mt Cleese

https://www.atlasobscura.com/places/mt-cleese
1•beatthatflight•20m ago•0 comments

OpenEdit – Claude Code can now edit videos (Open Source)

https://github.com/veedstudio/open-edit
1•byamja•25m ago•0 comments

Kalshi and Polymarket have begun taking bets on Phase III drug trials

https://www.science.org/content/blog-post/put-your-money-down-they-say
2•400thecat•28m ago•1 comments

NASA Engineers Help Prolong Voyager 2's Science Mission

https://science.nasa.gov/blogs/voyager/2026/08/04/nasa-engineers-help-prolong-voyager-2s-science-...
1•Tomte•29m ago•0 comments

Show HN: Sidebar – a private ESP32 intercom for five kids, no accounts

https://www.sundaradnus.ca/writing/sidebar-building-a-ham-radio-for-my-son
3•nonstopnonsense•32m ago•0 comments

A Short Lesson in Perspective (2012)

https://lindsredding.com/2012/03/11/a-overdue-lesson-in-perspective/
1•colinprince•37m ago•0 comments

Lines of code. 1,596 BTC gone

https://onekey.so/anzen/coldcard-entropy-failure/
2•Archie627•38m ago•0 comments

C64 Demo Effects Explained: Rodents in the Attic [video]

https://www.youtube.com/watch?v=uZ1atMUOUMU
2•guiambros•38m ago•0 comments

Bingebuster Video – your streaming services, restocked as a video store

https://bingebuster.net/
1•Slow_Hand•38m ago•0 comments

Organ donation group trying to take living man's organs faces shutdown

https://arstechnica.com/health/2026/08/us-to-shutter-organ-donation-group-accused-of-trying-to-ta...
3•Tomte•43m ago•4 comments

Looking for something to do while GitHub is down?

https://pelican.clutch.engineering/cheatsheets/self-hosted-gitlab/
1•featherless•47m ago•0 comments

Xcode's Clever Minimap

https://unsung.aresluna.org/xcodes-clever-minimap/
5•andsoitis•48m ago•0 comments

Framework Data Breach

https://www.reddit.com/r/LinusTechTips/comments/1vhjbok/framework_data_breach/
6•rkagerer•49m ago•1 comments

Why did the greatest juggler of all time stop and open a construction business?

https://grantland.com/features/anthony-gatto-juggling-cirque-du-soleil-jason-fagone/
2•mhb•50m ago•2 comments

Muscle protein can now be grown in chloroplasts of lettuce and tobacco plants

https://phys.org/news/2026-08-powerhouses-fake-meat-muscle-protein.html
1•vinni2•51m ago•0 comments

Guillotine Brought to Oppose New Data Center Left Company Reps Feeling "Unsafe"

https://www.gadgetreview.com/salem-brought-a-guillotine-to-oppose-new-data-center-company-reps-le...
2•healsdata•55m ago•0 comments

"It's unclear how Sopwith escaped to the general public."

https://unsung.aresluna.org/its-unclear-how-sopwith-escaped-to-the-general-public/
3•colinprince•1h ago•0 comments

Gloriously Underqualified

https://jeffarnoldlabs.com/blogs/gloriously-underqualified
1•mooreds•1h ago•0 comments

Baby-Sitting the Economy (1998)

https://slate.com/business/1998/08/baby-sitting-the-economy.html
1•mooreds•1h ago•0 comments

About Rx Kids

https://rxkids.org/about/
1•mooreds•1h ago•0 comments

Wyden proposes new taxes on data centers

https://www.eenews.net/articles/wyden-proposes-new-taxes-on-data-centers/
2•1vuio0pswjnm7•1h ago•0 comments

Hikerapi Is the Best

https://hikerapi.com/
1•unknownunknownn•1h ago•0 comments

Gemini is Cooked but GCP is Cooking

https://newsletter.semianalysis.com/p/gemini-is-cooked-but-gcp-is-cooking
2•gmays•1h ago•0 comments

ColorSpace: A framework for building text-based crypto-stegosystems

https://github.com/ChronicRhyno/ColorSpace
2•thunderbong•1h ago•0 comments

What are Looped Transformers? Explained clearly

https://twitter.com/neural_avb/status/2081741935883223196
2•gmays•1h ago•0 comments