frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•10mo 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•10mo 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•10mo 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).

EU Parliament: MEPs Vote to End Untargeted Mass Scanning of Private Chats

https://www.patrick-breyer.de/en/historic-chat-control-vote-in-the-eu-parliament-meps-vote-to-end...
1•anigbrowl•2m ago•0 comments

Shell declares force majeure to clients who buy Qatari LNG

https://www.reuters.com/business/energy/shell-totalenergies-others-declare-fm-their-clients-who-t...
1•geox•3m ago•0 comments

We built a lean, high-perf dashboard for Yeahchain

1•YeahchainTECH•4m ago•0 comments

Veil of Ignorance

https://en.wikipedia.org/wiki/Original_position
1•sillywabbit•4m ago•0 comments

New course on generative AI for behavioral science

https://statmodeling.stat.columbia.edu/2026/03/10/new-course-on-generative-ai-for-behavioral-scie...
1•dlojudice•8m ago•0 comments

Google sells partial stake in fiber, becomes minority owner of new venture

https://www.cnbc.com/2026/03/11/google-sells-partial-stake-in-fiber-becomes-minority-owner-in-ven...
2•internet-390•8m ago•0 comments

ICE/DHS gets hacked, all Contractors exposed

https://micahflee.github.io/ice-contracts/
2•peq42•13m ago•0 comments

Scaling the Lexinova Data Pipeline

1•LEXINOVAFaqs•15m ago•0 comments

Microsoft's growing control of Linux (2022)

https://lunduke.substack.com/p/microsofts-growing-control-of-linux
2•totetsu•16m ago•0 comments

Food costs set to spike as urea prices nearly doubles due to war in Iran

https://tradingeconomics.com/commodity/urea
8•burnt-resistor•16m ago•1 comments

Collecting perceptual data for a possible CSS optical-center property

1•gorkemyildiz•17m ago•0 comments

The Department of War is making a mistake [video]

https://www.youtube.com/watch?v=KBPOTklFTiU
1•ipnon•19m ago•0 comments

How do you handle state persistence in non-orientable data structures?

https://zenodo.org/records/18942850
1•MareSerenitatis•21m ago•1 comments

What happens if OpenAI or Anthropic fail?

https://www.reuters.com/commentary/breakingviews/what-happens-if-openai-or-anthropic-fail-2026-03...
6•billybuckwheat•22m ago•0 comments

Ask HN: Is Github Down Again?

https://twitter.com/m0nle0z/status/2031910716790517895
3•doanbactam•23m ago•4 comments

Why America Is Losing the War with Iran

https://chrishedges.substack.com/p/why-america-is-losing-the-war-with
5•chmaynard•23m ago•0 comments

I made a Chrome extension to export an entire Gemini chat

2•backrun•24m ago•0 comments

10 Years Later, I Reverse-Engineered iCloud's SyncToken by Brute Force

https://robhooper.xyz/blog-synctoken.html
2•rhoopr•25m ago•0 comments

Scalable quantum batteries can charge faster than their classical counterparts

https://phys.org/news/2026-03-scalable-quantum-batteries-faster-classical.html
1•Brajeshwar•26m ago•0 comments

Big Tech backs Anthropic in fight against Trump administration

https://www.bbc.com/news/articles/c4g7k7zdd0zo
4•jethronethro•27m ago•0 comments

Tunneling Nanotube

https://en.wikipedia.org/wiki/Tunneling_nanotube
1•rolph•29m ago•0 comments

The New York Times hated crossword puzzles before it embraced them

https://bigthink.com/pessimists-archive/new-york-times-hated-crossword-puzzles-wordle/
2•michaeld123•30m ago•1 comments

Live Coding with Caffeine

https://caffeine.js.org/talks/2018-08-25-demos-teaser/#/title
2•coliveira•30m ago•0 comments

I Don't Destroy Snowmen

https://writings.hongminhee.org/2026/01/ethics-of-small-actions/
4•foxfired•31m ago•2 comments

The First Telephone Call

https://theconversation.com/the-story-of-the-first-telephone-call-nine-words-that-changed-the-wor...
4•gmays•36m ago•0 comments

Grammarly Hit with Class-Action Suit over AI Identity Theft

https://www.techbuzz.ai/articles/grammarly-hit-with-class-action-suit-over-ai-identity-theft
3•twalichiewicz•38m ago•0 comments

Resume AI Analysis and Tailoring Portal

https://resume-elevator.com/
1•videsh•38m ago•0 comments

I Built a Reddit Alternative

https://exitapp.social
1•oligopoly_2•38m ago•1 comments

Optimizing for Decision Points

https://narphorium.com/blog/decision-points/
1•narphorium•40m ago•1 comments

BlackRock Launches $100M Skilled Trades Initiative

https://www.blackrock.com/corporate/newsroom/press-releases/article/corporate-one/press-releases/...
1•toomuchtodo•44m ago•0 comments