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

Google tests paying publishers for using its content in AI Mode and Gemini

https://searchengineland.com/google-tests-paying-publishers-for-using-its-content-in-ai-mode-ai-o...
1•thm•29s ago•0 comments

Robot Basketball

https://kevinkelly.substack.com/p/robot-basketball
1•thm•1m ago•0 comments

Security through obscurity is dead, and AI delivered the fatal blow

https://www.theregister.com/security/2026/09/13/security-through-obscurity-is-dead-and-ai-deliver...
1•abdelhousni•3m ago•0 comments

Libation: Liberate Your Library

https://getlibation.com/
1•Tomte•3m ago•0 comments

Backprop Alternative: Augmented Lagrangian Predictive Coding

https://pub.sakana.ai/pc-alm/
1•guld•4m ago•1 comments

macOS 27 Golden Gate Is Now Available for All Users

https://mrmacintosh.com/macos-27-golden-gate-is-now-available-for-all-users/
2•speckx•4m ago•0 comments

MetaFilter Discussion of "We must pace the frontier"

https://www.metafilter.com/214501/We-must-pace-the-frontier
1•giardini•5m ago•1 comments

Simulation Hypothesis

https://en.wikipedia.org/wiki/Simulation_hypothesis
1•chistev•5m ago•0 comments

Where have all the insects gone?

https://www.science.org/content/article/where-have-all-insects-gone
1•littlexsparkee•5m ago•0 comments

Stanford MS&E435 Economics of the AI Supercycle [video]

https://www.youtube.com/watch?v=LNSvp-9b-J0
2•Anon84•6m ago•0 comments

New Carlo Rovelli book challenges science understanding of reality and universe

https://www.npr.org/2026/09/14/nx-s1-5968442/on-the-equality-of-all-things-physics-carlo-rovelli
1•theanonymousone•6m ago•0 comments

Siri AI

https://www.apple.com/newsroom/2026/09/siri-ai-a-profoundly-more-capable-and-personal-assistant-i...
2•bobrenjc93•7m ago•1 comments

List of people who have held office in all three branches of government

https://en.wikipedia.org/wiki/List_of_people_who_have_held_constitutional_office_in_all_three_bra...
2•manlymuppet•8m ago•0 comments

Iranian banks' SSL certificates are being revoked due to OFAC sanctions

https://digiato.global/report/iran-banks-ssl-certificates-domain-changes/
2•misano•9m ago•0 comments

The Russell-Einstein Manifesto (1955)

https://pugwash.org/1955/07/09/statement-manifesto/
2•jimkleiber•9m ago•1 comments

Flushing toilet releases 'plume' of breathable pathogens – closing lid helps

https://www.theguardian.com/australia-news/2026/sep/09/flushing-the-toilet-releases-pathogens-inh...
1•bookofjoe•10m ago•0 comments

Show HN: Taskuary – turn your inbox into tasks for Claude Code, Codex, or Gemini

https://github.com/ldbumble/taskuary
2•monkeydo09•11m ago•2 comments

Pollard's P-1 Factoring Algorithm in Plain C

https://leetarxiv.substack.com/p/pollards-p-1-factoring-algorithm
2•theanonymousone•12m ago•0 comments

Show HN: Threshyr – An offline automatic time tracker with on-device AI

https://threshyr.com
2•affanBajwa•13m ago•1 comments

Trojan Horses

https://www.butthistime.com/p/trojan-horses
2•monksdream•13m ago•0 comments

Nvidia's RTX 5090 ($9,500) vanishes from online retail in the US

https://www.tomshardware.com/pc-components/gpus/nvidias-rtx-5090-vanishes-from-online-retail-in-t...
3•speckx•14m ago•1 comments

OpenTelemetry and one UI trick changed the way we debug Kubernetes

https://cardinalhq.io/blog/one-click-from-spike-to-pod
2•chipfixer•14m ago•0 comments

Apple releases OS 27 updates with Siri AI

https://www.theverge.com/news/994756/apple-ios-27-launch-iphone-siri-ai-update
3•utiiiD•14m ago•0 comments

Greg Brockman: We're now in the AGI era

https://twitter.com/a16z/status/2099506569238990908
2•tosh•14m ago•0 comments

Anthropic targets financial advisers with new Claude tool

https://www.reuters.com/business/anthropic-targets-financial-advisers-with-new-claude-tool-2026-0...
3•giuliomagnifico•15m ago•0 comments

Ritual and Rationality: Some Problems of Interpretation in European Archaeology [pdf]

https://www.cambridge.org/core/journals/european-journal-of-archaeology/article/abs/ritual-and-ra...
2•thunderbong•16m ago•0 comments

iOS 27, iPadOS 27, and macOS 27

https://www.apple.com/newsroom/2026/09/major-updates-for-apples-software-platforms-are-now-availa...
45•throw0101d•16m ago•10 comments

Deep theorems were scarce and difficult and identified deep thought. AI broke it

https://terrytao.wordpress.com/2026/09/13/deep-theorems-were-scarce-and-difficult-and-so-became-a...
1•gmays•17m ago•0 comments

Statussy – one page to see if your stack is down

https://www.statussy.com
1•colinbreeding•17m ago•0 comments

Surgical derivative of Orca. Residual orchestration and safety contracts closed

https://github.com/unempyd/odin
1•unempyd•18m ago•1 comments