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

Whereabouts Daily: How many of today's five countries can you guess?

https://whereabouts.earth/
1•webology•1m ago•0 comments

Explicit Instruction Does Not Cause Learned Helplessness

https://scienceoflearning.substack.com/p/no-explicit-instruction-does-not
1•obscurette•1m ago•0 comments

The US economy added a stronger-than-expected 172,000 jobs last month

https://www.cnn.com/2026/06/05/economy/us-jobs-may-final
4•mgh2•5m ago•0 comments

"Steve Jobs in Exile" is a fine profile of Jobs' years at NeXT

https://arstechnica.com/apple/2026/06/steve-jobs-in-exile-is-a-fine-profile-of-jobs-years-at-next/
1•pseudolus•7m ago•0 comments

Tutorial: A Comic strip from A to Z with Krita

https://www.davidrevoy.com/article1150/tutorial-comic-strip-from-a-to-z-with-krita
4•Tomte•8m ago•0 comments

MCP hits the mainstream with Strava's and Tredict's end-user MCPs, far from dead

https://www.tredict.com/blog/strava_mcp_server/
1•Aldipower•8m ago•0 comments

Hola Browser for Windows compromised to deliver cryptominer

https://www.bleepingcomputer.com/news/security/hola-browser-for-windows-compromised-to-deliver-cr...
2•Brajeshwar•11m ago•0 comments

S&P and DJI indices decline changing inclusion requirements

https://press.spglobal.com/2026-06-04-S-P-Dow-Jones-Indices-Consultation-on-Treatment-of-MegaCap-...
1•wting•11m ago•0 comments

AI is designing OpenAI's next model in a sign of 'super intelligence'

https://www.cnbc.com/2026/06/05/softbank-masayoshi-son-openai-model-super-intelligence.html
1•geox•11m ago•0 comments

Johnny.Decimal: A system to organise your life

https://johnnydecimal.com/
1•surprisetalk•12m ago•0 comments

OpenSUSE Geeko

https://en.opensuse.org/openSUSE%3AGeeko#The_original_hand_drawn_Geeko
2•skogstokig•14m ago•0 comments

ISS astronauts in evacuation mode as Russia attempts to fix widening air leak

https://www.reuters.com/science/international-space-station-astronauts-evacuation-mode-russia-att...
4•espenwa•15m ago•0 comments

Process Engineering Strategies for Microbial Lipid Production

https://www.mdpi.com/1422-0067/27/9/3760
1•PaulHoule•16m ago•0 comments

A visual introduction to kernel functions

https://kelvinpaschal.com/blog/kernel-functions/
1•Kelvinidan•16m ago•0 comments

Alarm over computer "worms" created with AI

https://www.cbsnews.com/video/alarm-over-computer-worms-created-with-ai/
2•mgh2•18m ago•0 comments

LEGO Sagrada Familia Is the Biggest Set in History, at over 12,000 Pieces

https://www.yankodesign.com/2026/06/04/the-lego-sagrada-familia-is-the-biggest-set-in-history-at-...
1•bookofjoe•18m ago•0 comments

SwiftTUI

https://snopia.net/en/blog/introducing-swifttui
2•antfarm•21m ago•1 comments

Digital Product Passports Change What You Track

https://holdmybill.com/blog/digital-product-passport-tracking
2•niksmac•21m ago•0 comments

International Space Station astronauts under evacuation orders

https://www.theguardian.com/science/2026/jun/05/international-space-station-astronauts-under-evac...
3•robin_reala•21m ago•1 comments

Detection Is Not a Strategy

https://www.cringely.com/2026/06/05/detection-is-not-a-strategy/
1•superchink•22m ago•0 comments

Crustafarianism: The religion AI agents built in 14 hours

https://mibitacora.eu/57-crustafarianismo-religion-agentes/
2•tempranillo•22m ago•1 comments

'Bear-Repelling Poles' Attracting Attention; Developed by Man Who Faced Bear

https://japannews.yomiuri.co.jp/society/general-news/20260526-329259/
3•rawgabbit•25m ago•2 comments

How to make firecracker fast(er) to start Chromium in < 20ms

https://www.kernel.sh/blog/firecracker-faster
3•juecd•25m ago•1 comments

Rave HN: Private HN rave at a loft in Manhattan

https://hallucinate.site/hn
1•stagas•26m ago•0 comments

Ascetic Computing

https://ratfactor.com/ascetic-computing
1•surprisetalk•27m ago•0 comments

China, HK Investors Banned from SpaceX IPO over Security

https://www.bloomberg.com/news/articles/2026-06-05/chinese-hk-investors-banned-from-spacex-ipo-on...
1•leopoldj•27m ago•0 comments

US posts another month of strong job gains in May

https://www.reuters.com/business/world-at-work/us-posts-another-month-strong-job-gains-may-unempl...
1•tcp_handshaker•29m ago•1 comments

Trump officials planned to mark 2.7M living people as dead, whistleblower claims

https://www.washingtonpost.com/politics/2026/06/05/doge-planned-falsely-mark-27-million-people-de...
5•internet_points•29m ago•0 comments

Chebyshev Polynomials

https://en.wikipedia.org/wiki/Chebyshev_polynomials
1•tosh•29m ago•0 comments

How the Internet Crosses Oceans

https://www.engadget.com/2187834/how-transatlantic-internet-cables-work/
2•SanjayMehta•31m ago•0 comments