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

Even if every California billionaire left tomorrow, it would take 25 years...

https://finance.yahoo.com/economy/policy/articles/even-every-california-billionaire-left-16491874...
1•1vuio0pswjnm7•51s ago•0 comments

Rivian will deliver the first R2 SUVs on June 9

https://techcrunch.com/2026/05/27/rivian-will-deliver-the-first-r2-suvs-on-june-9/
1•01-_-•2m ago•0 comments

Giant cockroach statue brings new life to shrinking Nara village

https://mainichi.jp/english/articles/20260527/p2g/00m/0na/048000c
2•rawgabbit•3m ago•0 comments

Ottawa's latest deal with U.S. data giant Palantir raises warnings

https://www.thestar.com/politics/federal/ottawas-latest-deal-with-us-data-giant-palantir-raises-w...
1•01-_-•3m ago•0 comments

The Ridgeway

https://www.historic-uk.com/HistoryMagazine/DestinationsUK/The-Ridgeway/
1•mellosouls•3m ago•0 comments

Google engineer charged with using inside information to win $1.2M on Polymarket

https://www.washingtonpost.com/technology/2026/05/27/google-employee-charged-with-insider-trading...
1•1vuio0pswjnm7•4m ago•0 comments

TopRec (toprec.io) – AI screening and CRM for recruiters and hiring teams

https://toprec.io
1•girish-fokusly•9m ago•0 comments

The fog is alive: bacteria in fog droplets clear toxins from air

https://news.asu.edu/20260514-environment-and-sustainability-fog-alive-researchers-discover-bacte...
1•XzetaU8•13m ago•0 comments

Rust Will Save Linux from AI, Says Greg Kroah-Hartman

https://www.zdnet.com/article/rust-will-save-linux-from-ai-says-greg-kroah-hartman/
1•signa11•14m ago•0 comments

Amazon to Acquire Apple's Globalstar Stake in Satellite Deal

https://www.macrumors.com/2026/05/27/amazon-apple-globalstar-deal/
1•mgh2•14m ago•0 comments

Ebola exposed Americans blocked from US return

https://arstechnica.com/health/2026/05/us-walls-itself-off-from-ebola-beefed-up-travel-ban-no-cit...
1•M_bara•21m ago•1 comments

AI Is Starting to Hit Power Grid Limits Simple, Crédible, Ouvre La Discussion

https://nypost.com/2026/05/22/business/data-center-debacle-roiling-midterms-as-ai-may-have-to-pay/
1•latentframe•22m ago•0 comments

The Orchestration Tax

https://twitter.com/addyosmani/status/2059844244907696186
1•pretext•22m ago•0 comments

Amiga Networking FAQ (1994)

https://groups.google.com/g/comp.answers/c/Yfa-YSE_7H8/m/-TqlJ2sfg28J
1•doener•26m ago•0 comments

KA9Q

https://en.wikipedia.org/wiki/KA9Q
2•doener•28m ago•1 comments

Durable links between everything you work on

https://www.mjanssen.nl/linkano/index.html
1•marc0janssen•28m ago•0 comments

OpenPowerlifting – creating a public-domain archive of powerlifting history

https://www.openpowerlifting.org/
1•andre9317•29m ago•0 comments

Archive-It – Built at Archive.org

https://archive-it.org/
2•gurjeet•39m ago•0 comments

Show HN: Camera Lets You See Sound in Complete Darkness [video]

https://www.youtube.com/watch?v=1zeHfH5TzWY
1•Regina0727•42m ago•0 comments

Grid-Forming vs. Grid-Following Inverters

https://www.batterydesign.net/grid-forming-vs-grid-following-inverters/
1•leonidasrup•43m ago•0 comments

UC Berkeley Law Artificial Intelligence Policy

https://www.law.berkeley.edu/academics/registrar/academic-rules/artificial-intelligence-policy/
1•fbrusch•45m ago•0 comments

The World Cup Is a Petri Dish

https://www.bloomberg.com/news/articles/2026-05-28/how-companies-are-tracking-disease-threats-dur...
1•petethomas•45m ago•0 comments

Show HN: BetterCallClaude – Open Source AI Legal Agents for Italy

https://bettercallclaude.it/
1•ReDeiPirati•48m ago•0 comments

Emacs Bra Size Calculator

https://pulusound.fi/blog/emacs-bra-size-calculator/
1•grumblepeet•51m ago•0 comments

MTerm

https://github.com/d0x2a/mTerm
1•vad_n__•51m ago•0 comments

WP23

https://wordpress.org/news/2026/05/wp23/
1•OuterVale•55m ago•0 comments

I Found the US Nuclear Detection System in Space [video]

https://www.youtube.com/watch?v=DjLnIb41DuQ
2•noazark•56m ago•0 comments

Mini-SWE-agent scores up to 74% on SWE-bench in 100 lines of Python code

https://mini-swe-agent.com/latest/
1•fittingopposite•58m ago•0 comments

A Comprehensive Analysis of the Open-Weight Frontier (May 2026)

https://deepresearch.ninja/2026/05/Qwen3.6-27B/35B-A3B-vs-Gemma-4-vs-DeepSeek-V4-A-Comprehensive-...
1•jackalxyz•1h ago•0 comments

PeerDrop – Direct file transfer. No cloud

https://peerdrop.app/
1•janandonly•1h ago•0 comments