frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

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

AI-Powered Y Combinator Company Research

https://fyicombinator.com
1•cmpit•15s ago•0 comments

A Python Script to End All Life and Take the Universe with It

https://starkeblog.com/dos/denial-of-service/weird/2025/11/28/universal-denial-of-service.html
1•bootbloopers•1m ago•0 comments

Ten Kubernetes Superpowers You Forget to Use

https://oneuptime.com/blog/post/2025-11-27-ten-kubernetes-superpowers-developers-overlook/view
1•ndhandala•1m ago•0 comments

Ask HN: What's your go-to strategy for programmatic SEO in 2025?

1•liquid99•2m ago•0 comments

Ask HN: What's the most underrated VS Code extension?

1•liquid99•3m ago•0 comments

AI Voice Agents: Transforming Customer Conversations in 2025

https://www.aiheadshotreviews.com/articles/ai-voice-agents-guide
1•naveensky•3m ago•0 comments

Nbaranker

https://nbaranker.com/
1•NBAnba•5m ago•1 comments

Zero-Width Space – The Sneaky Unicode Character

https://starikov.co/zero-width-space/
1•liquid99•6m ago•0 comments

Dumbindent: Because 93% of the time was spent in Clang-format

https://nigeltao.github.io/blog/2020/dumbindent.html
1•fanf2•7m ago•0 comments

The Performance Inequality Gap, 2026

https://infrequently.org/2025/11/performance-inequality-gap-2026/
1•ColinWright•8m ago•0 comments

Show HN: I made a free Git repository viewer

https://graph.gat.sh
1•rafmardev•8m ago•0 comments

The Math of Why You Can't Focus at Work

https://justoffbyone.com/posts/math-of-why-you-cant-focus-at-work/
1•0x79de•9m ago•0 comments

Denmark sets up 'night watch' to monitor Trump after Greenland row

https://www.theguardian.com/world/2025/nov/27/denmark-sets-up-night-watch-to-monitor-trump-since-...
1•saubeidl•9m ago•0 comments

iSmartPack| the smartest backpack for work, travel and life

https://ismartpack.com/
1•fisnikmaxhuni•11m ago•1 comments

A Repository with 44 Years of Unix Evolution

https://www.spinellis.gr/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html
1•lioeters•16m ago•0 comments

A Day at the Park (2013)

https://kiriakakis.net/comics/mused/a-day-at-the-park
1•gebdev•17m ago•0 comments

When Playdate Stopped Being Fun

https://blog.gingerbeardman.com/2025/04/15/when-playdate-stopped-being-fun/
1•latexr•18m ago•0 comments

Quantum Safe E2EE File-Transfer

https://github.com/collapsinghierarchy/noisytransfercli
1•whitenoises•19m ago•1 comments

Organizations Are Distributed Systems

https://www.industrialempathy.com/posts/organizations-are-distributed-systems/
1•smartmic•21m ago•0 comments

Building a 64-Bit OS from Scratch with Claude Code

https://isene.org/2025/11/SimplicityOS.html
1•birdculture•24m ago•0 comments

Cross-Compiling Common Lisp to WASM

https://turtleware.eu/posts/Common-Lisp-and-WebAssembly.html
1•jackdaniel•25m ago•0 comments

Breakdown of Lichess' annual expenses [video]

https://www.youtube.com/watch?v=oEbW1Lv1vus
1•fionnohGoDeo•25m ago•1 comments

Tech Titans Amass Multimillion-Dollar War Chests to Fight AI Regulation

https://www.wsj.com/tech/ai/tech-titans-amass-multimillion-dollar-war-chests-to-fight-ai-regulati...
6•thm•27m ago•0 comments

US Patent Office issues new guidelines for AI-assisted inventions

https://www.reuters.com/legal/government/us-patent-office-issues-new-guidelines-ai-assisted-inven...
1•isaacfrond•27m ago•0 comments

The Generational Burden

https://rodgercuddington.substack.com/p/the-generational-burden
1•freespirt•28m ago•1 comments

Download Snow Linux: The distro with a truly modern design.

https://file.pizza/download/bsyftq6n
1•telui•31m ago•1 comments

Officials Clashed in Investigation of Deadly Air India Crash

https://www.wsj.com/business/airlines/air-india-investigation-conflict-crash-36aed1ee
2•JumpCrisscross•34m ago•1 comments

Great Math Software: List of fun visual math programs

http://xahlee.info/math_software/mathPrograms.html
2•the-mitr•35m ago•0 comments

Better Mood – Journaling with sentiment analysis to track trends

https://better-mood.com/
1•Nukloop•40m ago•0 comments

Cyber-Sleuth Cliff Stoll: How a Mad Genius Exposed Moscow's Hacker Spies

https://spyscape.com/article/how-an-astronomer-unraveled-the-worlds-first-cyber-attack
1•thunderbong•43m ago•0 comments