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

Sana.cpp – Nvidia's Sana T2I model in C++, 4.8x faster than PyTorch

https://github.com/cconthekeyboard/sana.cpp
1•cconthekeyboard•3m ago•1 comments

Octopuses could help us conceptualize a different form of intelligence

https://www.cbc.ca/lite/story/1.6871036
1•colinprince•6m ago•0 comments

Amodei Re. Regulation

https://twitter.com/DarioAmodei/status/2088758816376807762
1•jacquesm•11m ago•1 comments

Python's http.server – Add support for HTTP Range header in HTTPServer

https://github.com/python/cpython/pull/118949
2•gregsadetsky•13m ago•0 comments

Show HN: An open-source workspace for your agents

https://github.com/gigeey/launchpad-studio
1•SEArongo•15m ago•1 comments

A gas-enshrouded and gas-reddened black hole at cosmic dawn

https://www.nature.com/articles/s41586-026-10846-4
2•diwank•16m ago•0 comments

DeepSeek V4 Pro at 207 tok/s with the full 1M context, no quantization

https://runinfra.ai/inference-api/deepseek-v4-pro
3•OsamaJaber•16m ago•0 comments

Cross-Sectional Stock Selection: Where Returns Come from and Why Models Fail

https://wangqiao.me/posts/cross-sectional-stock-selection-models/
1•unliftedq•20m ago•0 comments

An app to streamline data analytics – and do it cheaply

https://app.verbagpt.com/
1•symuz•23m ago•0 comments

AGI-64 Brings Sierra Adventures to the Commodore 64

https://meanhamster.com/news/agi-64-brings-sierra-adventures-to-the-commodore-64
3•erickhill•26m ago•0 comments

Why Young Men Are Abandoning the Workforce

https://www.wsj.com/opinion/free-expression/young-men-are-abandoning-the-workforce-a021228a
2•bilsbie•36m ago•2 comments

BlockArena: AI-Generated FPS Game

https://blockarena.puter.com/
1•ent101•39m ago•0 comments

AI Agent Safety Is Still Thinking Like Permissions

https://jeffreyflynt02.medium.com/ai-agent-safety-is-still-thinking-like-permissions-45878337bd98
4•jflynt76•39m ago•0 comments

Why I vibecoded my own terminal multiplexer

https://www.codedsleep.com/posts/wv-multiplexer
1•codedsleep•41m ago•0 comments

Show HN: Adding friction to my automatic open Claude reaction

2•aqureshi8•42m ago•0 comments

Hacking Legends

https://opensourcelegends.com/hacking-legends
1•buffer_overlord•44m ago•0 comments

Rare things become common at scale (2014)

https://longform.asmartbear.com/scale-rare/
1•mooreds•45m ago•0 comments

Protecting water systems from cyberattacks: 5 steps cities can take now

https://www.smartcitiesdive.com/news/protecting-water-systems-cyberattacks-5-steps-cities/827560/
2•mooreds•45m ago•0 comments

Forecasting Andean rainfall and crop yield from influence of El Niño on Pleiades

https://www.nature.com/articles/47456
1•mooreds•46m ago•0 comments

Why Chinese Citizens Are More Optimistic About AI Than Americans

https://www.bloomberg.com/news/articles/2026-08-14/why-ai-optimism-is-so-much-higher-in-china-tha...
2•pella•46m ago•0 comments

PPS Watch – The Most Accurate Watch That Doesn't Tell Time

https://www.instructables.com/PPS-Watch-the-Most-Accurate-Watch-That-Doesnt-Tell/
1•sudo_cowsay•49m ago•0 comments

Code Is the Byproduct

https://yagmin.com/blog/code-is-the-byproduct/
2•lubujackson•54m ago•0 comments

Path Protocol – an open-source browser precision game and course editor

https://github.com/argentquest/protocol
2•EricMSilver•59m ago•0 comments

Inverse Problem

https://en.wikipedia.org/wiki/Inverse_problem
2•soupspaces•1h ago•0 comments

Physicists discover a hidden gluon structure inside protons

https://www.sciencedaily.com/releases/2026/08/260815064805.htm
6•gradus_ad•1h ago•0 comments

Play Anthakshari Online

https://anthakshari.ai/
3•hareeshimo•1h ago•0 comments

Israeli minister calls for killing '30 to 40′ Palestinians in Gaza nightly

https://www.aljazeera.com/news/2026/8/16/israeli-minister-calls-for-killing-30-to-40-palestinians...
28•LAC-Tech•1h ago•6 comments

Prolly: A content-addressed ordered map built on prolly trees

https://github.com/crabbuild/prolly
2•forhappy•1h ago•0 comments

Show HN: Continuum – Financial simulations for DIY multimillionaires

https://continuum-app.xyz/
3•charleswcho•1h ago•7 comments

Wallflower – A Social Reader

https://thewallflower.app/about
2•tldrthelaw•1h ago•0 comments