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 Psychological Warfare of the Modern Sterile Interior

https://lussoarchive.substack.com/p/the-psychological-warfare-of-the
1•evo_9•1m ago•0 comments

Show HN: SetDPI – Change image DPI without re-encoding (runs in browser)

https://setdpi.com/
1•caseymarlin•2m ago•0 comments

The importance of stupidity in scientific research

https://fermatslibrary.com/s/the-importance-of-stupidity-in-scientific-research
1•wslh•3m ago•0 comments

Show HN: Say Toucan – my feedback board 3x'd its price, so I built my own

https://saytoucan.com
1•artoonie•7m ago•0 comments

AI-Assisted Design of a Post-Quantum Cryptographic Accelerator

https://arxiv.org/abs/2609.04058
1•sbulaev•9m ago•0 comments

AI Stock Research Assistant · Streamlit

https://ai-stock-research-kiaan.streamlit.app
1•KiaanKothari•9m ago•0 comments

Routed: Local, zero-token hybrid router for AI agent skills (<20ms)

https://github.com/bshea-1/Routed
2•bshea1•11m ago•0 comments

Boston, 1960s Video

https://www.youtube.com/watch?v=v23f7rQ4E6Q
1•sheri•12m ago•0 comments

Make infectious disease data boring again

https://www.statnews.com/2026/09/04/pennsylvania-measles-deaths-data-cdc-director-rfk-jr/
1•EA-3167•18m ago•0 comments

The Innovative HP Computer Behind a Hedge Fund Pioneer

https://thechipletter.substack.com/p/the-innovative-hp-computer-behind
1•chmaynard•19m ago•0 comments

What Linux does when you malloc()?

https://medium.com/@ankitadhiman650/what-linux-actually-does-when-you-malloc-162caa460052
1•syumei•22m ago•0 comments

Nvidia Personal AI Router (Pair)

https://github.com/NVIDIA/Personal-AI-Router
2•ystad•22m ago•0 comments

Spike – alerts when a competitor's YouTube video hits N views in T hours

https://spike.yt
1•astarostenkov•23m ago•0 comments

Accelerating LLM Inference with Lossless Speculative Decoding Algorithms (2025)

https://arxiv.org/abs/2502.05202
1•wslh•25m ago•0 comments

Title: A local signed notebook for AI agents, with CLI and MCP interfaces

https://github.com/davidnichols-ops/aafp-commons
1•davidnicholsops•27m ago•0 comments

Show HN: Slicky – a desktop robot for macOS that opens your apps

https://github.com/ananthasharma/Slicky
1•apsharma•27m ago•0 comments

How to sideload apps onto Android Auto

https://www.engadget.com/2246259/how-to-sideload-android-auto-apps/
1•cf100clunk•30m ago•0 comments

Show HN: Read Binary from Screenshots in the Browser

https://onlinebinarytranslator.com/
1•jackking1•32m ago•1 comments

Teardown: DeepSeek Harness

https://github.com/jimy-r/agent-workspace-architecture/blob/main/teardowns/2026-09-05-deepseek-ha...
2•jimyr•33m ago•0 comments

I Missed Tilix, So I Built the Terminal I Wanted

https://medium.com/@yalovoy/i-missed-tilix-so-i-built-the-terminal-i-wanted-ccd7535f4c94
1•zero-ground-445•34m ago•0 comments

Show HN: ChessNotate – Fix a broken PGN without branching into a new variation

https://chessnotate.app/
2•gantengx•35m ago•0 comments

The ZZZ backup page was a response to a wiki outage

https://mob.so/darkforest/p/f609e41e-57f6-476f-9210-6ffb28755c08
1•david_shi•36m ago•0 comments

The Logic of Surveillance (2013)

https://www.ianwelsh.net/the-logic-of-surveillance/
1•bediger4000•39m ago•0 comments

EvoMind: A local-first cognitive AI architecture with runtime safety gates

https://zenodo.org/records/20580153
1•Salt19•40m ago•0 comments

Disruption of the OTP in the adult male forebrain reveals its diverse functions

https://academic.oup.com/endo/article-abstract/167/4/bqag029/8525632?redirectedFrom=fulltext&logi...
3•wslh•41m ago•0 comments

Show HN: Blink

https://blinkmarkets.xyz
1•gauryvg98•46m ago•0 comments

AMD Based FreeBSD Desktop Reloaded

https://vermaden.wordpress.com/2026/09/06/amd-based-freebsd-desktop-reloaded/
3•vermaden•51m ago•0 comments

"Radical responsibility" means treating people like tools

https://www.seangoedecke.com/radical-responsibility-means-treating-people-like-tools/
3•gfysfm•51m ago•0 comments

Please don't rearrange our shoes when we turn up, paramedics in Japan urge

https://www.theguardian.com/world/2026/aug/28/never-tidy-paramedics-shoes-japan-custom-etiquette
3•tagawa•1h ago•0 comments

AI, Tools and Transformation

https://www.ben-evans.com/benedictevans/2026/9/3/ai-tools-and-transformation
2•firexcy•1h ago•0 comments