frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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

Save the balti Can Birmingham's best dish come back from the brink?

https://www.theguardian.com/food/2026/jun/02/balti-birmingham-best-dish-back-from-brink
1•YeGoblynQueenne•1m ago•0 comments

Idea for New Social Media

1•thisIsNotRandom•2m ago•0 comments

Small businesses can leverage AI

https://www.technologyreview.com/2026/06/02/1138227/how-small-businesses-can-leverage-ai/
1•joozio•4m ago•0 comments

Elon's Trillions (text-transformer-generated)

https://pastebin.com/LH0FRzVA
1•joebig•4m ago•0 comments

The Metaverse Fever-Dream

https://pxlnv.com/blog/metaverse-fever-dream/
1•ch_sm•5m ago•0 comments

Show HN: Whirligig

https://whirligig.live
1•idiocache•5m ago•0 comments

Can LLMs Play Baba Is You?

https://meffmadd.github.io/samplesurium/posts/baba_is_agent/
1•gychoi•6m ago•0 comments

Updates to GitHub Copilot billing and plans

https://github.blog/changelog/2026-06-01-updates-to-github-copilot-billing-and-plans/
1•Klaster_1•8m ago•0 comments

State Is No Good

https://yusufaytas.com/state-is-no-good
5•creativesober•8m ago•0 comments

Seritor – Bookmark Specific Messages Across Claude, ChatGPT, Gemini, and Grok

https://chromewebstore.google.com/detail/seritor-ai-conversation-b/dnehmimnheiflolgbdnbfeakbaealbla
1•logic_engine•9m ago•0 comments

Shotcut 26.2 Beta released bringing OpenFX plugin support

https://www.neowin.net/news/shotcut-262-beta-released-finally-bringing-openfx-plugin-support/
1•bundie•10m ago•0 comments

There's No Photos Allowed at the Studio Ghibli Amusement Park

https://petapixel.com/2026/06/02/theres-no-photos-allowed-at-the-studio-ghibli-amusement-park/
2•ilreb•12m ago•0 comments

Why do Nigerian Scammers Say They are from Nigeria? (2016) [pdf]

https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/WhyFromNigeria.pdf
1•tosh•13m ago•0 comments

Show HN: Best of AI – Handpicked and Curated Open-Source List of AI Tools

https://bestofai.io
2•dariubs•13m ago•0 comments

Proof of (Human) Thought

https://erik.wiffin.com/posts/proof-of-thought/
1•tony-vlcek•14m ago•0 comments

ClickHouse Table per Tenant in Production

https://ananthakumaran.in/2026/06/02/clickhouse-table-per-tenant-in-production.html
1•ananthakumaran•16m ago•0 comments

A Zipper Patent Sat in a Garage for 40 Years. Now It's Real.

https://www.yankodesign.com/2026/05/31/a-zipper-patent-sat-in-a-garage-for-40-years-now-its-real/
2•bookofjoe•19m ago•0 comments

Show HN: PoC to use the Chrome Prompt API on other people's machine

https://datm.nl/chat-together/
2•psyonity•20m ago•0 comments

Gabon's TLD .ga seems to be somewhat down

https://www.mon.ga/
1•elikoga•20m ago•0 comments

We think giant pterosaurs could fly (2018)

http://markwitton-com.blogspot.com/2018/05/why-we-think-giant-pterosaurs-could-fly.html
1•downbad_•26m ago•0 comments

Amazon molly fish species survived 100k years without males

https://www.bbc.com/future/article/20260601-amazon-molly-the-fish-thats-lived-for-100000-years-wi...
1•giuliomagnifico•29m ago•0 comments

Chasing Ghosts: On progress, memory, and its generations

https://msavina.substack.com/p/chasing-ghosts
1•archival_moth•32m ago•0 comments

HTML Deployer – Publish HTML from AI Chats to a Website

https://chromewebstore.google.com/detail/html-deployer-1-click-ai/gihmknkabkkghpiocgnoiejagngdegea
1•quysala1•35m ago•0 comments

1979: Will Word-Processors start a home revolution?

https://www.youtube.com/watch?v=b6URa-PTqfA
1•madradavid•35m ago•0 comments

Jellycat: a Rust CLI for Turning Jujutsu Changesets into GitHub PR Stacks

https://github.com/fanzeyi/jellycat
1•mos3abof•35m ago•1 comments

Reverse-Engineered Userspace Driver for Asus ZenVision Lid OLED on Linux"

https://github.com/tarpediem/zenvision-linux
3•berlianta•36m ago•0 comments

His Chatbot Nearly Ruined Him. To Recover, He Had to Destroy It

https://www.wsj.com/tech/personal-tech/chatgpt-addiction-chatbots-recovery-7977308e
1•Michelangelo11•36m ago•1 comments

A Review of QucsStudio

https://electroagenda.com/en/a-review-of-qucsstudio/
1•teleforce•37m ago•0 comments

Consolidated AI First Startup Guide

https://benemson.com/resources/ai-first-startup-guide
1•emson•37m ago•1 comments

Basil and fennel compound may build up dangerous DNA damage in vulnerable people

https://medicalxpress.com/news/2026-06-basil-fennel-compound-dangerous-dna.html
3•XzetaU8•38m ago•0 comments