frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

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

Why Airport Security Feels Random

https://yusufaytas.com/why-airport-security-feels-random
5•legallytired•4m ago•0 comments

Dead internet theory: AI-generated articles using MCP [video]

https://vimeo.com/1191324557
1•linksku•5m ago•0 comments

No more Access Denied – I am TrustedInstaller(2023)

https://fourcore.io/blogs/no-more-access-denied-i-am-trustedinstaller
1•rolph•6m ago•0 comments

AI Hype vs. AI Reality

https://fixingtao.com/2026/05/ai-hype-vs-ai-reality/
1•gslepak•8m ago•0 comments

Agent View in Claude Code

https://claude.com/blog/agent-view-in-claude-code
1•elffjs•8m ago•0 comments

New US counterterror strategy focuses on cartels but omits right-wing extremism

https://www.pbs.org/newshour/show/new-u-s-counterterror-strategy-focuses-on-drug-cartels-but-omit...
3•latexr•14m ago•1 comments

TanStack NPM Packages Compromised

https://github.com/TanStack/router/issues/7383
6•varunsharma07•15m ago•0 comments

I Built an AliExpress Homelab, Is It Surprisingly Good or Total E-Waste?

https://the-diy-life.com/i-built-an-aliexpress-homelab-is-it-surprisingly-good-or-total-e-waste/
1•bdcravens•15m ago•0 comments

From E-Waste to AI Powerhouse: Upcycling Smartphones for On-Device AI

https://www.gesellschaft-zur-entwicklung-von-dingen.de/challenge
2•luckow•15m ago•1 comments

Ads Are Coming to Apple Maps This Summer: Here's What to Expect

https://www.macrumors.com/2026/04/24/apple-maps-ads-what-to-expect/
3•celsoazevedo•15m ago•0 comments

Apple's iOS 26.5 Update Patches More Than 50 Security Flaws

https://www.macrumors.com/2026/05/11/ios-26-5-security-fixes/
1•celsoazevedo•18m ago•1 comments

Manuals Plus: The Wrap-Up

https://ascii.textfiles.com/archives/5833
1•kencausey•18m ago•0 comments

I let AI build a tool to help me figure out what was waking me up at night

https://martin.sh/i-let-ai-build-a-tool-to-help-me-figure-out-what-was-waking-me-up-at-night/
2•showmypost•19m ago•0 comments

People turning to gambling or fraud in response to rigged/unfair system

https://greyenlightenment.com/2026/05/04/people-turning-to-gambling-or-fraud-in-response-to-rigge...
2•paulpauper•20m ago•0 comments

Teen Boys and Young Men Are Injecting Peptides in Search of Perfection

https://www.wsj.com/health/wellness/boys-peptides-stacks-looksmaxxing-trevor-larcom-835e58cd
2•JumpCrisscross•21m ago•0 comments

Stay indoors warning issued across three US states as toxic smog fills the air

https://www.dailymail.com/sciencetech/article-15809079/stay-indoors-warning-arizona-texas-califor...
1•Bender•21m ago•0 comments

Linux 7.1-Rc3 Released with Many Networking Changes

https://www.phoronix.com/news/Linux-7.1-rc3-Released
1•Bender•23m ago•0 comments

Linux 7.0.6 Released to Finish Mitigating the Dirty Frag Vulnerability

https://www.phoronix.com/news/Linux-7.0.6-Released
1•Bender•23m ago•0 comments

Cash register makers seek 1% food tax rate, citing extra time needed for 0% rate

https://www.japantimes.co.jp/news/2026/04/29/japan/politics/japan-food-tax-cut-challenges/
3•PaulHoule•24m ago•1 comments

Native Instruments Is Bought Out

https://www.the-berliner.com/berlin/native-instruments-sold-to-inmusic/
2•mrzool•25m ago•0 comments

Token Budgeting: How to Think About AI Cost Control

https://www.vantage.sh/blog/ai-token-budgeting
1•StratusBen•26m ago•0 comments

The 45% Hidden ROI of Automation No One Puts in the Business Case

https://sneakbug8.com/vertical-spillover-effect/
1•SneakBug8•26m ago•0 comments

Beneath the Linux surface: the Unix legacy, a lively ecology

https://club.unix.rocks/commentary/under-linux/
1•fcambus•27m ago•0 comments

Seeking technical co-founder (USA) – B2B global trade platform

https://www.ventraa.com/
1•rithwik29345•27m ago•0 comments

Kicking the Tires: A Voluntary Path to Pre-Deployment AI Vetting

https://www.lawfaremedia.org/article/kicking-the-tires--a-voluntary-path-to-pre-deployment-ai-vet...
1•yurivish•27m ago•0 comments

What breaks when you ask an LLM for JSON (288 model outputs tested)

https://thecrosswalk.news/what-breaks-when-you-ask-an-llm-for-json/
2•ndcorder•27m ago•0 comments

US Counterterrorism Strategy 2026: "We Will Find You and We Will Kill You" [pdf]

https://www.whitehouse.gov/wp-content/uploads/2026/05/2026-USCT-Strategy-1.pdf
3•latexr•28m ago•0 comments

We got our first paid user. And we're still stuck in Google's audit process

https://www.indiehackers.com/post/we-got-our-first-paid-user-and-were-still-stuck-in-google-s-aud...
3•festivilia•28m ago•0 comments

The Pace of Feedback

https://thoughtbot.com/blog/the-pace-of-feedback
1•paulhebert•28m ago•0 comments

AI, VPS Usage and $22B in Bead Funding Affects on IPv4 Prices

https://brandergroup.net/2026/04/hostinger-and-hetzner-signal-real-ipv4-demand/
1•JakeBrander•28m ago•0 comments