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

YC startup offers interviews to people who get their name permanently tattooed

2•codexon•3m ago•0 comments

Neuroprosthesis restores hand movement&sensation in human w complete tetraplegia

https://www.nature.com/articles/s41591-026-04498-0
1•bookofjoe•3m ago•0 comments

Benchmarking LLMs on SAST Triage

https://www.fencer.dev/blog/llm-triage-sast-false-positives
2•timols•4m ago•0 comments

FrameCut – Split contact sheet negative film scans in Chrome

https://github.com/stabruriss/framecut/blob/main/README.md
1•chriswunan•4m ago•0 comments

Runlayer sues Rippling, alleging source-code access preceded rival AI gateway

https://runtimewire.com/article/runlayer-sues-rippling-alleging-source-code-access-preceded-rival...
1•ryanmerket•4m ago•0 comments

Collection of Vintage User-Interfaces

https://typewritten.org/Media/
1•karakoram•4m ago•0 comments

A digitally controlled silicon quantum processing unit

https://www.nature.com/articles/s41586-026-10754-7
1•sbulaev•5m ago•0 comments

China's Moonshot AI reportedly used Nvidia Blackwell chips for training Kimi K3

https://www.tomshardware.com/tech-industry/artificial-intelligence/chinas-moonshot-ai-reportedly-...
2•rndsignals•6m ago•0 comments

Thorpe – semi-WYSIWYG Markdown editor

https://thorpeapp.com/
1•jasoncartwright•7m ago•0 comments

Botswana Did Everything Right

https://www.cremieux.xyz/p/botswana-did-everything-right
1•admp•7m ago•0 comments

Microsoft FY26 Q4 Earnings

https://www.microsoft.com/en-us/Investor/earnings/FY-2026-Q4/press-release-webcast
3•corvad•8m ago•1 comments

Meta Reports Second Quarter 2026 Results

https://investor.atmeta.com/investor-news/press-release-details/2026/Meta-Reports-Second-Quarter-...
1•mfiguiere•8m ago•0 comments

Kimi k3 now runs on one consumer GPU

https://twitter.com/Akashi203/status/2082555972380401852
4•OsamaJaber•9m ago•0 comments

Why too much time online makes us unhappy

https://www.cnn.com/2026/07/29/health/too-much-time-online-wellness
2•01-_-•11m ago•1 comments

Schools Are Confiscating Phones All Day

https://www.gadgetreview.com/schools-are-confiscating-phones-all-day-and-most-americans-are-fine-...
1•01-_-•12m ago•0 comments

Cory Doctorow on Why AI Won't Replace Workers, but Will Crash the Economy [video]

https://www.youtube.com/watch?v=rRRmUuxJolY
1•SockThief•12m ago•0 comments

The GitHub Platform Era Is Over

https://julien.danjou.info/blog/the-github-platform-era-is-over/
1•yruzin•13m ago•0 comments

The Prevention Paradox: Why Successful Resilience Work Becomes Its Own Enemy

https://newsletter.resiliumlabs.com/p/the-prevention-paradox
1•gpi•15m ago•0 comments

Cloudflare removes top open coding models from free tier

https://developers.cloudflare.com/changelog/post/2026-07-28-models-require-workers-paid/
1•ankushKun•17m ago•0 comments

Kimi K3 for local use (1.56TB –> 594GB) compressed by Unsloth

https://huggingface.co/unsloth/Kimi-K3-GGUF
4•pavelai•18m ago•1 comments

Can You Survive the Kobayashi Maru?

https://moai.studio/blog/posts/rewrite-the-simulator.html
1•ionwake•18m ago•0 comments

Why are databases so hard?

http://gtowey.blogspot.com/2026/07/why-are-databases-so-hard.html
1•gtowey•19m ago•0 comments

Personal Instagram Clone: WordPress and ActivityPub

https://fotos.kaffeeringe.de/
1•kaffeeringe•19m ago•1 comments

China starts production of home-grown immersion DUV chipmaking tools

https://www.reuters.com/world/china/china-starts-production-home-grown-immersion-duv-chipmaking-t...
2•dariosalvi78•20m ago•0 comments

Mathematicians Reveal Why Humans Keep Becoming Cannibals

https://www.sciencealert.com/mathematics-reveals-why-human-cannibalism-keeps-reappearing
1•wjSgoWPm5bWAhXB•20m ago•0 comments

Claude Is Down

https://status.claude.com/incidents/q2kg8n613kr3
64•gregsadetsky•21m ago•25 comments

Show HN: Cedric's Quest – A Dragon Quest–Style RPG in Rust and Bevy

https://store.steampowered.com/app/4569680/Cedrics_Quest__The_Waning_Ward/
1•coolwulf•22m ago•0 comments

Its operating system demo (from Computerphile)

https://www.youtube.com/watch?v=hISbyatih44
1•ozymandiax•22m ago•1 comments

Transitioning to the Verification Economy

https://www.unite.ai/transitioning-to-the-verification-economy/
1•Hard_Space•23m ago•0 comments

Built a household organizer in Flutter – what would you improve?

https://apps.apple.com/us/app/roomli-shared-home-organizer/id6761788107
1•mladenConcept•24m ago•0 comments