frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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

Red went from the #1 to the #5 colour for Japanese schoolgirls' backpacks

https://jivx.com/randoseru
1•momentmaker•5m ago•0 comments

Movwin: My (Unpublished) TUI Framework

https://movq.de/blog/postings/2026-05-29/0/POSTING-en.html
1•zdw•7m ago•0 comments

In situ cryo-ET defines the ultrastructure of ER exit sites in human cells

https://www.nature.com/articles/s41556-026-01964-2
1•bookofjoe•9m ago•0 comments

What a 98-Year Old Children's Book Teaches Us About AI

https://angrystaffofficer.com/2026/05/28/what-a-98-year-old-childrens-book-teaches-us-about-ai/
2•caycep•9m ago•0 comments

Textile Markup Language Documentation

https://textile-lang.com/
2•GaryBluto•14m ago•1 comments

Genomic test could spare millions of breast cancer patients chemotherapy

https://www.theguardian.com/society/2026/may/29/groundbreaking-genomic-test-spare-breast-cancer-p...
3•pseudolus•19m ago•0 comments

Summary of Key Changes in OMB's Proposed Federal Financial Assistance Rule

https://elizabethginexi.substack.com/p/summary-of-key-changes-in-ombs-proposed
1•frigidwalnut•20m ago•0 comments

Key Chemistry Question Answered, No Quantum Computer Required

https://www.quantamagazine.org/key-chemistry-question-answered-no-quantum-computer-required-20260...
2•vi_sextus_vi•23m ago•0 comments

Why we're pivoting away from healthcare

https://saffron.health
1•tanishqkanc•25m ago•0 comments

Goldman's Model Shows Spain as 26% Probable World Cup Winner

https://www.bloomberg.com/news/articles/2026-05-29/goldman-s-model-shows-spain-as-26-probable-wor...
4•vismit2000•29m ago•0 comments

Google Chrome adds session cookie theft protection for all users

https://www.bleepingcomputer.com/news/security/google-chrome-adds-session-cookie-theft-protection...
2•deadbolt•30m ago•0 comments

TokioConf 2026 Talks

https://www.youtube.com/playlist?list=PLgVIJ9TpEgOmHj0ADDpf-qGckYEJs4QCE
2•nomaxx117•32m ago•0 comments

You're Underutilizing Java's Standard Library

https://feds-will-find.you/blog/youre-underutilizing-javas-standard-library
1•onesingleblast•35m ago•0 comments

The largest RC Boeing 777-9X takes flight

https://www.popsci.com/technology/worlds-largest-remote-controlled-boeing7779x/
2•qwertyuiop_•35m ago•0 comments

Release v0.1.0

https://github.com/multigres/multigres/releases/tag/v0.1.0
1•l2dy•37m ago•0 comments

Orbitals from Entanglement: Quantum Information gives rise to Chemical bonds

https://arxiv.org/abs/2501.15699
1•vi_sextus_vi•39m ago•0 comments

Petition in Support of Wikipedia Workers Union

https://en.wikipedia.org/wiki/Wikipedia:Wiki_Workers_United_solidarity
3•ftgregg•41m ago•1 comments

Prompt to Silicon with LangGraph

https://coresmith.ai/
1•ppabench•43m ago•0 comments

Tezcatl: A 2MB alternative to Puppeteer for scraping on macOS

https://george.mand.is/2026/05/tezcatl-a-2mb-alternative-to-puppeteer-for-scraping-on-macos/
1•xrd•46m ago•0 comments

Tokens or Humans? The New AI Cost Trade-Off Reshaping Corporate Budgets [video]

https://www.youtube.com/watch?v=niBP4qhNSWw
2•mgh2•51m ago•0 comments

Britain has crushed immigration, and harmed itself

https://www.economist.com/britain/2026/05/28/britain-has-crushed-immigration-and-harmed-itself
3•Anon84•51m ago•0 comments

How to Think Like a World-Class Marketer – Rory Sutherland

https://fs.blog/knowledge-project-podcast/rory-sutherland-2/
2•walterbell•53m ago•0 comments

A Closer Look at the Damage to New Glenn's Launch Pad

https://www.youtube.com/watch?v=5DAS7i9VD2w
2•busymom0•1h ago•0 comments

US to Appeal Judge's Order for Broad Refund of Trump Tariffs

https://www.bloomberg.com/news/articles/2026-05-29/us-to-appeal-judge-s-order-for-broad-refund-of...
4•petethomas•1h ago•2 comments

Software Architecture After AI

https://brianguthrie.com/p/software-architecture-after-ai/
2•bguthrie•1h ago•0 comments

Russia is being beaten by robots in Ukraine [video]

https://www.youtube.com/watch?v=_9GkUkIaOno
2•breve•1h ago•0 comments

Ember.js 7.0

https://blog.emberjs.com/ember-released-7-0/
6•satvikpendem•1h ago•2 comments

Top Three Favorite Apple Apps (Mac/iPhone)?

3•CootieRaccoon•1h ago•0 comments

What Is a Dickover?

https://daringfireball.net/2026/05/what_is_a_dickover
62•tambourine_man•1h ago•15 comments

China Limits Overseas Travel for AI Talent at DeepSeek, Alibaba, Private Firms

https://www.bloomberg.com/news/articles/2026-05-26/china-expands-travel-curbs-to-top-ai-talent-at...
6•gmays•1h ago•0 comments