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

Hacking for Defense Stanford 2026 – Lessons Learned Presentations

https://steveblank.com/2026/06/08/g-for-defense-stanford-2026-lessons-learned-presentations/
1•sblank•36s ago•0 comments

What's New in SwiftUI for iOS 27

https://blakecrosley.com/blog/whats-new-swiftui-ios-27
1•blakec•2m ago•0 comments

FrontierCode

https://cognition.ai/blog/frontier-code
2•streamer45•4m ago•0 comments

In Support of Mandatory Nucleic Acid Synthesis Screening and Recordkeeping

https://screendna.org/
1•JumpCrisscross•5m ago•0 comments

China's Lab-Grown Diamonds Emerge as Unlikely Winner in AI Boom

https://www.bloomberg.com/news/articles/2026-06-02/china-s-lab-grown-diamonds-emerge-as-unlikely-...
1•JumpCrisscross•6m ago•0 comments

County-level map of air conditioning in the U.S.

https://twitter.com/StatisticUrban/status/2062887160743641293
2•JumpCrisscross•7m ago•0 comments

Nine Fours – your 36 top wiki picks across media

https://0g.software/nine-fours
1•0gs•8m ago•1 comments

Controllable Generative Modeling in Minecraft by Training on Billions of Cubes

https://arxiv.org/abs/2604.22847
2•PaulHoule•9m ago•0 comments

Show HN: macOS Apps on Linux: SwiftUI for Linux (and AppKit, NSFoundation, etc.)

https://github.com/Lore-Hex/QuillUI
2•ljlolel•9m ago•0 comments

PostgreSQL 19 Beta: The Four Features You'll Feel

https://thebuild.com/blog/postgresql-19-beta-the-four-features-youll-actually-feel/
1•pgedge_postgres•9m ago•0 comments

Avoiding wasteful electricity use while self hosting LLMs

https://patrickmccanna.net/fixing-a-stuck-ollama-runner-and-building-a-gpu-watchdog/
1•0o_MrPatrick_o0•10m ago•0 comments

Why LLM Inference Needs a New Kind of Router

https://www.modular.com/blog/why-llm-inference-needs-a-new-kind-of-router-part-1
1•aviziva•12m ago•0 comments

The Korean Stock Market Just Crashed Sunday Night but the Nasdaq Is Rising

https://247wallst.com/investing/2026/06/08/the-korean-stock-market-just-crashed-sunday-night-will...
2•carabiner•12m ago•1 comments

The Third Generation of Apple's Foundation Models

https://machinelearning.apple.com/research/introducing-third-generation-of-apple-foundation-models
1•2bit•13m ago•1 comments

The World Needs Replicators: Do science in your home so we know what's true

https://chillphysicsenjoyer.substack.com/p/the-world-needs-replicators
1•crescit_eundo•16m ago•0 comments

'Unbelievable how accurate': How paid influencers hype Polymarket's odds

https://www.politico.com/news/2026/06/05/polymarket-paid-political-influencers-00932789
4•momentmaker•19m ago•0 comments

Apple Passwords Now Auto Fixes Weak and Compromised Passwords with Agentic AI

https://www.macrumors.com/2026/06/08/apple-passwords-can-now-automatically-fix-passwords-with-age...
1•7777777phil•20m ago•1 comments

Performance Mantras

https://hazn.com/performance-mantras
2•hazn•21m ago•0 comments

Show HN: RunAPI – one API for AI video, image, music, audio, and LLMs

https://runapi.ai/
1•billy42•21m ago•0 comments

Regrade

https://regradeapp.tech/#cta
1•preston_s•22m ago•0 comments

An open letter to office suite users, just before the Euro-Office announcement

https://blog.documentfoundation.org/blog/2026/06/08/an-open-letter/
8•jethronethro•22m ago•1 comments

Agents are getting phone numbers. The reason is not obvious

https://newsletter.gtmengineering.ai/p/a-phone-carrier-for-agents-not-what
1•alexjl1226•22m ago•0 comments

Vibe Diaries: Training Nanochat

https://www.vibediary.dev/essays/nanochat
1•stopachka•22m ago•0 comments

Donut Lab's 'solid-state' battery exposed as regular li-ion in investigation

https://electrek.co/2026/06/08/donut-lab-solid-state-battery-exposed-lithium-ion-fraud/
3•virgildotcodes•23m ago•0 comments

Search as Code: The End of the Query-Results Loop

https://medium.com/@tbelbek/perplexity-search-as-code-why-ai-agents-now-write-python-to-find-info...
1•rdstrtwlkr•23m ago•0 comments

JMB585 (SATA Chip) Silent Data Corruption – Root Cause Analysis and Kernel Patch

https://github.com/artmoty-dev/n5pro-jmb585-fix
1•Modified3019•29m ago•0 comments

Judge Strikes Down $100k Fee for Skilled Foreign Worker Visas

https://www.nytimes.com/2026/06/08/us/politics/judge-visa-skilled-workers-fee-trump.html
2•ceejayoz•30m ago•0 comments

Paving the Way for Agents in Biology

https://www.anthropic.com/research/agents-in-biology
1•dataking•33m ago•0 comments

Show HN: Generate production grade Lottie animations with Claude Code

https://twitter.com/konstipaulus/status/2064011863889788972
1•K9-P5•33m ago•0 comments

Yale reinstates SAT, ACT requirement after six years of flexible policy

https://yaledailynews.com/articles/yale-reinstates-sat-act-requirement-after-six-years-of-flexibl...
2•loughnane•34m ago•1 comments