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 Little Book of Generative AI Foundations: An Intuitive Mathematical Primer

https://arxiv.org/abs/2605.29713
1•ibobev•2m ago•0 comments

Startup Red Flags

https://endlessfootnote.substack.com/p/startup-red-flags
1•rxm233•2m ago•0 comments

Chainlet – a daily word-chain game scored by how rare your answer is

https://chainlet.online/
1•cosmorphik•2m ago•0 comments

We're all bad at writing software

https://blog.senko.net/were-all-bad-at-writing-software
1•speckx•3m ago•0 comments

Safari introduces Adaptive Dark Mode in 27.3

https://webkit.org/blog/18541/introducing-adaptive-dark-mode/
2•paddingtone•3m ago•0 comments

Show HN: Small Print, see when an MCP server changes what it tells your agent

https://smallprint.dev
1•nickcosta•4m ago•0 comments

Topographically

https://topographically.vercel.app/
1•bpierre•4m ago•0 comments

Books and YouTube HN Library

https://vektormemory.com/blog/v2-0-4-hacker-news-books-videos-added-node-js-and-sqlite
1•minimaxa•5m ago•0 comments

Superscalar Loop Processors

https://arxiv.org/abs/2611.01904
1•matt_d•5m ago•0 comments

Hedge Fund Presentations by Renowned Activist Investors

https://www.10xebitda.com/hedge-fund-presentations/
2•7777777phil•9m ago•0 comments

Stop Hardcoding Your Timeouts

https://alfy.blog/2026/04/23/stop-hardcoding-your-timeouts.html
1•birdculture•9m ago•0 comments

Linux 7.3: Color format control, Tyr progress, and more

https://www.collabora.com/news-and-blog/news-and-events/linux-73-color-format-control-tyr-progres...
1•losgehts•10m ago•0 comments

Algorithms for Optimization

https://algorithmsbook.com/optimization/
1•ibobev•15m ago•0 comments

US tech giants' hidden AI debt swells 90% to $3.2T in 6 months

https://asia.nikkei.com/business/technology/artificial-intelligence/us-tech-giants-hidden-ai-debt...
5•angry_impala•16m ago•0 comments

Canva Brush, a vision-language model for design

https://www.canva.com/newsroom/news/canva-brush/
2•SerCe•16m ago•0 comments

The AI Boom May Be Sowing Seeds of Another Financial Crisis

https://www.bloomberg.com/opinion/articles/2026-11-03/ai-investment-boom-demands-stronger-financi...
12•angry_impala•17m ago•5 comments

Show HN: An MCP Server for Manpages

https://www.chainguard.dev/unchained/every-manual-page-in-chainguard-os-now-readable-by-your-agent
1•dustinkirkland•18m ago•1 comments

Verifying Apple Reference Images

https://pps-lab.com/blog/verifying-apple-reference-image/
3•laksjd•18m ago•1 comments

British fintech Revolut slashes AI coding costs 10x by going self-hosted

https://www.theregister.com/ai-and-ml/2026/11/03/british-fintech-revolut-slashes-ai-coding-costs-...
5•gr_norm•19m ago•1 comments

AMD Reports Third Quarter 2026 Financial Results

https://ir.amd.com/news-events/press-releases/detail/1303/amd-reports-third-quarter-2026-financia...
1•tekdude•20m ago•0 comments

Intel releases v0.9 14A PDK for foundry customers

https://www.intel.com/content/www/us/en/newsroom/news/intel-foundry/what-is-the-intel-14a-pdk-0-9...
1•Thorondor•21m ago•0 comments

Canva Cutting 22% of Staff

https://www.smh.com.au/technology/canva-unveils-mass-job-cuts-in-hardest-moment-of-its-history-20...
7•holografix•22m ago•0 comments

iOS 27.3 Adds Vertical Tabs and Adaptive Dark Mode to Safari

https://www.macrumors.com/2026/11/03/ios-27-3-safari/
1•MBCook•22m ago•0 comments

Learning with Kernels [pdf]

https://mcube.lab.nycu.edu.tw/~cfung/docs/books/scholkopf2002learning_with_kernels.pdf
1•ibobev•22m ago•0 comments

Show HN: Uncracked City, detective game where you question LLM suspects that lie

https://uncracked.city
2•passkey1510•22m ago•0 comments

Google is shutting down Jules

https://jules.google.com/
3•ahurmazda•23m ago•1 comments

Sierra Quest – classic Sierra point and click adventure game

https://pointandclick.studio/games/sierra-quest
1•ibobev•23m ago•0 comments

Turning Every Radio into a Radar

https://tiaminetworks.com/turning-every-radio-into-a-radar/
2•hasley•24m ago•0 comments

Zig 0.17.1 Released

https://ziglang.org/news/0.17.1-released/
4•jesperlang•25m ago•0 comments

Show HN: Run faster MoE inference on Mac with less RAM

https://github.com/davide-troiani/moeshift
2•davidetroiani•25m ago•1 comments