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

Wrst – Build smartwatch apps with React and TypeScript

https://www.wrst.dev/
1•karolbisztyga•47s ago•0 comments

Smoobu website builder suffers from bad UX, I used their API instead

https://waldo.vanderlore.de/blog/str-booking-guide/
1•waldov•1m ago•0 comments

What happens when OKF runs inside an AI tool

https://tenureai.dev/writing/open-knowledge-format-ai-memory-benchmark/
1•jflynt76•2m ago•0 comments

Millions in UK could claim share of £3B after Apple case given green light

https://www.bbc.co.uk/news/articles/c932d1r0p96o
1•fredley•3m ago•0 comments

Huskmail: A disposable email with private inboxes and trial library

https://huskmail.xyz
1•draggodra•4m ago•1 comments

Sorites Paradox (Paradox of the Heap)

https://en.wikipedia.org/wiki/Sorites_paradox
2•chistev•12m ago•0 comments

Downed US pilot reported 'jellyfish' drone formation before crash

https://www.cnn.com/2026/06/23/politics/iran-drones-f-15-pilot-intelligence
1•farseer•12m ago•0 comments

Show HN: Neural Particle Automata

https://selforg-npa.github.io/
5•esychology•13m ago•0 comments

Show HN: SharpSkill, a LeetCode alternative built in 15 spoken languages

https://sharpskill.dev/en
2•Enjoyooor•13m ago•2 comments

The secret cause of the industrial revolution

https://www.worksinprogress.news/p/how-smashing-the-nimbys-created-modern
1•bensouthwood•14m ago•0 comments

Dunky State-Machine

https://www.dunky.dev/state-machine
1•ivanbanov•15m ago•1 comments

Show HN: Continuum – an open, local-first memory layer for your Mac

https://github.com/nikhilkagita04/continuum
2•nikhilkagita97•15m ago•0 comments

Most of What You Read on the Internet Is Written by Insane People (2018)

https://old.reddit.com/r/slatestarcodex/comments/9rvroo/most_of_what_you_read_on_the_internet_is_...
2•downbad_•27m ago•0 comments

AI Built a Nuke and Still Lost

https://www.lwilko.com/blog/i-gave-an-ai-a-civilization
3•kensai•28m ago•0 comments

China's CATL bets battery swapping will cut costs for Europe's electric trucks

https://www.ft.com/content/c2175609-d106-4a9c-b6a3-56aac71c569a
2•JumpCrisscross•34m ago•0 comments

Ralph Harness, a tiny guarded loop for coding agents

https://github.com/rxdt/py_ralph_frame
1•rxdt•35m ago•0 comments

Ionos warns of acute capacity shortage in Frankfurt, Germany region

https://cdn.imgtree.co/images/jvJVQIZy.jpg
1•nor0x•40m ago•1 comments

36 Hours with Fable

https://tossrock.substack.com/p/36-hours-with-fable
3•fragmede•41m ago•1 comments

New £1.1B plan to back chip firms, boost computing and skills for the AI

https://www.gov.uk/government/news/a-decisive-shift-to-power-british-ai-new-11-billion-plan-to-ba...
1•rbanffy•41m ago•0 comments

Artificial intelligence-based law firm wins in court

https://www.computerweekly.com/news/366644941/Artificial-intelligence-based-law-firm-wins-in-court
1•TMWNN•44m ago•0 comments

Zero Weights Language Model (MSE-GLM)

https://aircityshops.com/index.php?url=city/mse_blog
2•fodokidza•45m ago•0 comments

I built an AI memory engine in 10 days, then needed a project to prove it works

https://parametric-memory.dev
2•EntityOne•45m ago•1 comments

Show HN: Ideate a trading strategy with an Ex-Citadel Trader

https://sean-but-ai.vercel.app/
9•Entropnt•47m ago•4 comments

Generated this marketing video in just 12 minutes using this tool Clickcast.tech

https://www.youtube.com/shorts/ow0JWuBLCgA
1•clickcasttech•50m ago•0 comments

How to turn compute into a financial asset

https://www.economist.com/finance-and-economics/2026/06/22/how-to-turn-compute-into-a-financial-a...
2•zczc•51m ago•2 comments

How sad should I be about ChatGPT? (2022)

https://robertheaton.com/chatgpt/
3•reasonableklout•52m ago•0 comments

Ask HN: In the age of agentic coding why no one talks about orchestration tools

2•ios-contractor•56m ago•1 comments

Causal Summit

https://causalsummit.com/
2•northlondoner•57m ago•0 comments

Don't waste Claude limits babysitting AI experiments

https://heyneo.com/claude-code
2•gauravvij137•1h ago•0 comments

Show HN: Treating PowerPoint decks like code

https://github.com/sirilsengolraj-source/presentation-skill
1•Sirilsengolraj•1h ago•0 comments