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

UK Brings in Full Social Media Ban for Under-16s

https://deadline.com/2026/06/uk-social-media-ban-under-16s-x-youtube-tiktok-reddit-1236956163/
1•01-_-•51s ago•0 comments

Inside tech elites’ madcap war against the California billionaire tax

https://sfstandard.com/2026/06/13/billionaire-tax-fight-sergey-brin-chris-larsen-mike-moritz-ron-...
1•thm•1m ago•0 comments

Derbyshire officer investigated for using AI to create evidence in cases

https://news.sky.com/story/derbyshire-police-officer-investigated-for-using-ai-to-create-evidence...
1•01-_-•1m ago•0 comments

Do-the-work instead of proof-of-work, for Git hosting

https://blog.legoktm.com/2026/06/14/do-the-work-instead-of-proof-of-work-for-git-hosting.html
1•rapnie•2m ago•0 comments

Ukraine's Zelenskiy discusses peace talks in call with Trump

https://www.reuters.com/world/europe/ukraines-zelenskiy-discussed-war-diplomacy-call-with-trump-a...
1•Soumya_Max•4m ago•0 comments

Show HN: Canopy – parallel, sandboxed Claude Code sessions on macOS

https://github.com/juliensimon/canopy
1•julsimon•4m ago•0 comments

Proof

https://en.wikipedia.org/wiki/Proof_(play)
1•tosh•5m ago•0 comments

Apple PowerMac G4 – Weapon (1999) [video]

https://www.youtube.com/watch?v=lb7EhYy-2RE
1•DesaiAshu•5m ago•0 comments

You don't need React: creating a minimal UI library

https://pedroth.github.io/?p=post/NoNeedReact
1•pedro_movai•6m ago•0 comments

Building a personal meeting assistant that routes through your existing audio

https://techstackups.com/articles/deepgram-personal-meeting-assistant/
1•ritzaco•6m ago•0 comments

A spy in your pocket? How the UK's on-device nude image blocking could work

https://www.techradar.com/vpn/vpn-privacy-security/a-spy-in-your-pocket-how-the-uks-proposed-on-d...
1•nickslaughter02•6m ago•1 comments

Employees are checking out of AI

https://www.asymptotes.ai/notes/the-self-replacement-crisis
1•spinmaster•7m ago•0 comments

Show HN: TimeZoria – fast way to check and compare time zones

https://timezoria.org/
1•TimeZoriaAI•9m ago•0 comments

Abandoning the indie hacking dream for now (2022)

https://www.tinystruggles.com/posts/abandoning_indie_hacking/
1•mmarian•9m ago•0 comments

Shutting down my startup (2025)

https://lachlangreen.substack.com/p/shutting-down-my-startup
1•mmarian•12m ago•0 comments

Oracle Cuts Free Tier Ampere A1 Resources in Half

https://linuxiac.com/oracle-quietly-cuts-free-tier-ampere-a1-resources-in-half/
1•hyruo•12m ago•0 comments

Tell HN: Listening to blog posts is a nice form of self-therapy

1•mmarian•13m ago•0 comments

What the Fuck Happened to Nerds

https://mrmarket.lol/what-the-fuck-happened-to-nerds/
2•vrnvu•13m ago•0 comments

Airis – A zero-install, local AI ecosystem with autonomous PC control

https://github.com/Samael-1976/Airis
1•Samael1976•14m ago•0 comments

Berkadia Data Breach

https://haveibeenpwned.com/Breach/Berkadia
1•rexthonyy•14m ago•0 comments

Show HN: Instant live endpoints your front end needs, from natural language

https://github.com/thomscoder/zero-1
1•thomscoder•16m ago•0 comments

Relativity for Retired Engineers

https://arxiv.org/abs/2605.21660
1•calligram•16m ago•0 comments

Show HN: X – A programming language with switchable memory modes

https://github.com/xdotxxx/x
1•x-xxx•19m ago•0 comments

Nightly Rust Development with Devenv

https://paperless.blog/nightly-rust-devenv
1•l0b0•19m ago•0 comments

Britain announces social media ban for under-16s

https://www.reuters.com/business/media-telecom/britain-expected-set-out-under-16s-social-media-re...
2•austinallegro•19m ago•0 comments

Research Replication Attempt

https://paperless.blog/research-replication-attempt
1•l0b0•19m ago•0 comments

Testing desktop notifications with NixOS

https://paperless.blog/desktop-notification-tests
1•l0b0•19m ago•0 comments

The open-source Agent Communication Infrastructure

https://novu.co/connect/
1•scopsy•22m ago•0 comments

Open Source Seeds

https://www.opensourceseeds.org/en/home
2•Cider9986•22m ago•0 comments

Manticore-projects/aurscan: Scan AUR packages for malware using Claude LLM

https://github.com/manticore-projects/aurscan/tree/main
1•aiNohY6g•23m ago•0 comments