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

Become the Thousand Servers

https://sabot.media/guides/become-the-thousand-servers/
1•ibobev•2m ago•0 comments

Std: Call_once vs. Std:Async

https://devblogs.microsoft.com/oldnewthing/20260917-00/?p=112706/
1•ibobev•3m ago•0 comments

Comparing exception behavior of magic statics, std:call_once, and std:async

https://devblogs.microsoft.com/oldnewthing/20260918-00/?p=112709/
1•ibobev•3m ago•0 comments

The hottest new hangout for middle schoolers is NPR's comment section?

https://techcrunch.com/2026/09/25/the-hottest-new-hangout-for-middle-schoolers-is-nprs-comment-se...
1•geneticdrifts•3m ago•0 comments

Ask HN: Does your team still have humans review and understand code?

1•taurath•5m ago•0 comments

Show HN: Ekselio – Loveable for Finance Workflows (local first)

https://www.gptbeyond.com/try?home=1
1•kdautaj•5m ago•0 comments

Revealing the details of how OpenAI agents hacked Hugging Face

https://swarmtraces.org/
1•specked-citrus•5m ago•0 comments

FYI: OpenAI "spend limits" aren't always limits

1•iambateman•6m ago•0 comments

Shipping Code Faster Is Not the Bottleneck

https://valentinprugnaud.dev/posts/2026/07/shipping-code-faster-is-not-the-bottleneck
2•conorcleary•8m ago•0 comments

Jev was built for agents, here's how we're using it in computer use instead

https://twitter.com/kylejeong/status/2102108924677927169
3•Kylejeong21•8m ago•0 comments

Human homeostasis is more efficient in social proximity

https://www.science.org/doi/10.1126/sciadv.aeg4937
2•anigbrowl•9m ago•0 comments

Browser Bookmarks, Done Right: Stop Building a Cemetery of Links

https://chromewebstore.google.com/detail/kosh-bookmark-manager/meldjdfnfgefeoegccphimkmgmeamcce
4•havu12•10m ago•0 comments

Show HN: Pbi-guard – Unit testing for Power BI

https://github.com/Patens-dev/pbi-guard
1•randomlyGenerat•11m ago•0 comments

Teaching a World Model to Play Pokemon

https://nostalgia.dev/posts/teaching-a-world-model-to-play-pokemon/
1•stmonty•12m ago•2 comments

North Korea 'Likely' Behind $388M Hack of Crypto Exchange Bitget

https://gizmodo.com/north-korea-very-likely-behind-388-million-hack-of-crypto-exchange-bitget-200...
4•MC995•16m ago•0 comments

Excel now supports multiple values in a single cell

https://techcommunity.microsoft.com/blog/excelblog/excel-now-supports-multiple-values-in-a-single...
3•luispa•20m ago•0 comments

Analyzing Frontier Model Progress with My Favourite Game: Prince of Persia

https://blog.priyan.in/2026/09/analyzing-frontier-model-progress-with.html
2•msephton•21m ago•0 comments

Learning the Bitter Lesson of Agent Harnesses [video]

https://www.youtube.com/watch?v=smBOBYZ3-5w
1•tuanlda•26m ago•1 comments

What one vLLM replica on an L40 can carry and how it fails

https://percentes.ai/writing/2026/calibrating-one-l40-configuration/
1•itsveems•26m ago•0 comments

The stupidity and arrogance of GNOME developers

https://felipec.wordpress.com/2024/03/18/stupid-gnome-developers/
1•Muhammad523•26m ago•0 comments

Finally, A True Blue Rose Exists

https://www.sciencenews.org/article/true-blue-rose-pigment-copigment
2•bookofjoe•30m ago•0 comments

Using Claude Code: Spending your effort

https://twitter.com/trq212/status/2103576349499855160
2•mfiguiere•30m ago•0 comments

Cringe and Corny

https://ambrook.com/offrange/culture/on-cringe-and-corny
1•surprisetalk•32m ago•0 comments

Yegge's Paradox

https://willbeddow.substack.com/p/yegges-paradox
1•willbeddow•32m ago•0 comments

Show HN: Piloxa – an MCP server that sends USPS Certified Mail from your AI

https://piloxa.com/for-ai-agents
1•kameir•37m ago•0 comments

Tell HN: Chrome 154 corrupt Fontconfig cache and crash KDE Plasma

1•vdfs•37m ago•0 comments

Too AI; Didn't Read

https://www.tai-dr.com/
5•rfonseca•37m ago•2 comments

The Scarcity Premium: AI made images free; advertising as a solvency bond

https://scarcity.danieldeboulay.com
2•freedmans•39m ago•0 comments

Asteroids named after Tom Lehrer and 'Weird Al' Yankovic

https://science.slashdot.org/story/26/09/24/009238/asteroids-named-after-tom-lehrer-and-weird-al-...
3•MilnerRoute•41m ago•0 comments

Show HN: I read ISO 273 off the standard because the online charts disagree

https://supra.silviaai.dev/reference/iso-273-clearance-holes
1•Seeper•42m ago•0 comments