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

Norway's first adventure games (2025)

https://spillhistorie.no/2025/09/11/norways-first-adventure-games-part-1/
1•kqr•27s ago•0 comments

Sunsetting New.email

https://resend.com/blog/sunsetting-new-email
1•vednig•2m ago•0 comments

Stacked Diffs (and why you should know about them) (2023)

https://newsletter.pragmaticengineer.com/p/stacked-diffs
2•theanonymousone•7m ago•0 comments

Simon Willison on DeepSeek-V4-Flash-0731

https://simonwillison.net/2026/Jul/31/deepseek-v4-flash-0731/
6•theanonymousone•12m ago•0 comments

The Kurzgesagt Situation is Insane [video]

https://www.youtube.com/watch?v=OX1yHmeLPy8
2•wrxd•13m ago•0 comments

RamenHaus

https://ramen.haus/
4•oler•13m ago•0 comments

Unifeyn – upload any content and get notes, flashcards, and quizzes from it

https://www.unifeyn.app/
2•securemepro•18m ago•0 comments

1 in 10 comments across 40 subreddits disappeared within 36 hours

https://growtika.com/blog/reddit-comment-removal-study
2•Growtika•21m ago•0 comments

Show HN: SendPage – Paste AI-generated HTML, get a link clients can open

https://sendpageapp.com
2•jack714•22m ago•0 comments

The Obligatory AI Post

https://lapcatsoftware.com/articles/2026/7/15.html
3•latexr•25m ago•0 comments

"Last month, you watched TV for less than an hour per day on average"

https://twitter.com/oohweehuman/status/2083162929369878606
2•turrini•28m ago•0 comments

Multi-Paxos vs. Strong-Sync vs. Raft

https://medium.com/from-zero-to-seekdb/multi-paxos-vs-strong-sync-primary-replica-vs-raft-which-h...
2•jinqueeny•32m ago•0 comments

EU will mandate labels on authentic-looking AI content starting August 2

https://www.engadget.com/2227966/eu-mandate-labels-on-authentic-looking-ai-content/
3•vrganj•35m ago•0 comments

Free tools for Etsy sellers, podcasters, and indie devs

https://thesellermind.com/tools/fee-calculator
2•haimo•36m ago•0 comments

FBI gets voter's IP address in new fraud probe tactic

https://www.axios.com/2026/07/31/fbi-voter-ip-address-investigation
4•_tk_•40m ago•1 comments

How to Do Great Work

https://paulgraham.com/greatwork.html
2•tosh•42m ago•0 comments

The Chatbot Act Forces One Parenting Model on Every Family

https://www.eff.org/deeplinks/2026/07/chatbot-act-forces-one-parenting-model-every-family
3•mdp2021•45m ago•0 comments

Leopold Aschenbrenner Built a Hot A.I. Hedge Fund. Then It Melted Down

https://www.nytimes.com/2026/07/31/business/situational-awareness-leopold-aschenbrenner.html
5•sbulaev•55m ago•2 comments

Google Just Ruined One of Its Most Important Tools

https://www.theatlantic.com/technology/2026/07/google-earth-ai-images/688145/
4•eloisius•55m ago•1 comments

Perplexity AI loses bid to toss Reddit lawsuit over data scraping

https://www.reuters.com/legal/litigation/perplexity-ai-loses-bid-toss-reddit-lawsuit-over-data-sc...
2•thm•58m ago•0 comments

What makes good magnet programs attractive?

https://www.educationprogress.org/p/what-makes-good-magnet-programs-attractive
2•barry-cotter•1h ago•0 comments

Ask HN: How did your boss's behavior change with the rise of AI?

2•aredirect•1h ago•1 comments

Granola Class Action Lawsuit

https://twitter.com/RobertFreundLaw/status/2083350273758728216
1•freestylematt•1h ago•0 comments

WTF Happened in 1971?

https://wtfhappenedin1971.com/
2•baxtr•1h ago•1 comments

Show HN: Wisp – a Linux shell with Lua scripting and structured pipelines

https://github.com/Hinikaa/wisp
1•hinikaa•1h ago•0 comments

Bloom Filters

https://arpitbhayani.me/blogs/bloom-filters/
1•vishwajeet_thok•1h ago•0 comments

AI doesn't generate working products, that's still your job

https://weeraman.com/the-prototype-isnt-the-product/
2•smckk•1h ago•1 comments

Amgen Reports Breach to SEC

https://databreaches.net/2026/07/31/amgen-reports-breach-to-sec/
1•WaitWaitWha•1h ago•0 comments

How Functional Is Human Tetrachromacy? (Ooqui) [video]

https://www.youtube.com/watch?v=NLC38iB7deE
1•zeristor•1h ago•0 comments

Google plans to exempt sanctioned nations from Android developer verification

https://arstechnica.com/gadgets/2026/07/google-plans-to-exempt-sanctioned-nations-from-android-de...
2•01-_-•1h ago•1 comments