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

Show HN: Display Big Text on Screen

https://bigtext.net/
2•liquid99•1m ago•0 comments

Show HN: Spendict – a performance marketer's verdict for AI agents, over MCP

https://www.spendict.com/
2•ds246•5m ago•0 comments

Cloud Rebuild (Preview)

https://learn.microsoft.com/en-us/windows/configuration/cloud-rebuild/
1•taubek•9m ago•0 comments

Turbocharged solo dev – zooming out a couple of clicks

https://adjohu.com/blog/turbocharged-solo-dev/
1•adjohu•10m ago•0 comments

Children (Composition)

https://en.wikipedia.org/wiki/Children_(composition)
1•doener•13m ago•0 comments

Show HN: Lip Sync AI – Create Your Talking Videos Instantly

https://lipsyncai.co/
1•vtoolpro•15m ago•0 comments

AI-powered video generator SaaS Application for Sale

https://flippa.com/13365327-ai-powered-video-generation-platform-for-creating-viral-short-form-co...
1•kilincarslan•15m ago•1 comments

Movement Is Not Progress

https://frederickvanbrabant.com/blog/2026-07-10-movement-is-not-progress/
1•TheEdonian•16m ago•0 comments

Onemind.md – give your repo a memory without any extra tooling

https://github.com/lazardanlucian/onemind.md
1•lazardanlucian•19m ago•0 comments

I don't need you. I do

https://www.sunilshenoy.com/2026/07/12/i-dont-need-you-i.html
1•cybersunil•20m ago•0 comments

Yakr – a social-relay messaging protocol with Python and Rust implementations

https://github.com/MY20-PHEV/yakr
1•MY10-PHEV•26m ago•0 comments

Show HN: Grinta – a local-first coding agent built for long autonomous runs

https://github.com/josephsenior/Grinta-Coding-Agent
1•JosephSenior•28m ago•0 comments

How does a Dev's job look like in a few years?

1•korrak•28m ago•1 comments

Show HN: Runeward: Sandboxing AI agents with policy gates

https://runewardd.github.io/runeward/
1•tha_infra_guy•32m ago•0 comments

Big Tech to face fines for consumer protection failures, says EU official

https://www.ft.com/content/25640be5-a5bd-4548-81f9-bd0e16f87f35
3•giuliomagnifico•33m ago•1 comments

Leaked Documents Reveal Secret Russia-China Military Plan to Disable Starlink

https://united24media.com/world/leaked-documents-reveal-possible-secret-russia-china-military-pla...
3•vrganj•35m ago•0 comments

Show HN: DPDK vs. Af_XDP Latency Benchmarks Tested on Real NICs

https://github.com/ASherjil/ABTRDA3
1•CoreCppEngineer•35m ago•1 comments

Cuelume: Interface Sound Design Kit

https://cuelume-site.pages.dev/
1•handfuloflight•36m ago•0 comments

Itanium: Market Reception

https://en.wikipedia.org/wiki/Itanium
1•tosh•36m ago•1 comments

Meta u-turns on AI feature amid privacy backlash

https://thehill.com/policy/technology/5964282-privacy-concerns-instagram-ai/
3•Alien1Being•40m ago•0 comments

Test Your Webcam and Microphone

https://webcamtester.io/en/
1•QOOBRA•40m ago•0 comments

Remembering Ken Iverson (2004)

https://web.archive.org/web/20180412035431/https://keiapl.org/rhui/remember.htm
1•tosh•50m ago•0 comments

I needed one feature for my SaaS. 6 hours later I had launched another SaaS

https://www.floatingvideo.com
1•astonfred•52m ago•1 comments

Think preprints are unreliable? Analysis of 70000 studies might change your mind

https://www.nature.com/articles/d41586-026-02167-3?linkId=62708614
2•XzetaU8•52m ago•1 comments

A proper Docker image for WebCalendar: SQLite-backed and self-contained

https://projects.rocks/blog/webcalendar-docker.html
1•mysterhawk•56m ago•0 comments

Jiki – Learn to Code the Fun Way

https://jiki.io
1•phil-pickering•57m ago•1 comments

The Hard-Line Activists Ramping Up for the War with AI

https://www.wsj.com/tech/ai/anti-ai-activists-disappearance-sam-kirchner-6872879f
3•thm•59m ago•0 comments

The Gen X Career Meltdown (2025)

https://www.nytimes.com/interactive/2025/03/28/style/gen-x-creative-work.html
2•Michelangelo11•1h ago•0 comments

In Praise of Exhaustive Destructuring

https://antoine.vandecreme.net/blog/exhaustive-destructuring-praise/
1•avandecreme•1h ago•0 comments

AST vs. Bytecode (2023) [pdf]

https://stefan-marr.de/downloads/oopsla23-larose-et-al-ast-vs-bytecode-interpreters-in-the-age-of...
1•tosh•1h ago•0 comments