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

Multi-region data and service mesh operated by a Makefile

https://github.com/neospe/autoops
1•renk•41s ago•0 comments

Some Thoughts on AI and Art

https://insertchaos.bearblog.dev/thoughts-on-ai-and-art/
1•snorbleck•44s ago•0 comments

A multipurpose, private personal AI on a dedicated AWS instance

https://purposemapped.com
1•BuddyPerry•59s ago•0 comments

Document intelligence platform – share files, track views, collect signatures

https://tinidrop.com
1•santosh_premi•59s ago•0 comments

V1 of OpenTelemetry Go Compile-Time Instrumentation

https://opentelemetry.io/blog/2026/go-compile-time-instrumentation-v1/
1•svrnm•1m ago•0 comments

Glider Classic Returns

https://www.softdorothy.com/gliderclassic/gliderclassic.html
1•gregsadetsky•2m ago•0 comments

Regular expression speed and error rates

https://www.johndcook.com/blog/2026/07/17/regex-speed-error/
1•ibobev•2m ago•0 comments

Egerton MS 1995

https://quuxplusone.github.io/blog/2026/07/16/egerton-ms-1995/
1•ibobev•3m ago•0 comments

Why Org Social is the ethical Fediverse alternative

https://en.andros.dev/blog/734c56f2/why-org-social-is-the-ethical-fediverse-alternative/
1•ibobev•3m ago•0 comments

Unigent SDK – universal cross-harness, cross-session agent workflow scripting

https://github.com/gintasz/unigent
1•gintasz•5m ago•0 comments

Curry-Howard Correspondence – How proof assistants work [pdf]

https://cklixx.people.wm.edu/teaching/math400/Wesley-P1.pdf
1•max-amb•8m ago•0 comments

The Auditor's Opinion

https://www.cringely.com/2026/07/16/the-auditors-opinion/
1•mhb•8m ago•0 comments

Lenovo announces first laptop with inkjet-printed OLED

https://www.tomshardware.com/monitors/lenovo-announces-worlds-first-laptop-with-inkjet-printed-ol...
1•HardwareLust•10m ago•1 comments

The troubling Russian connections of a 'European' password manager

https://www.lemonde.fr/en/pixels/article/2026/07/17/the-troubling-russian-connections-of-a-europe...
1•Sami_Lehtinen•12m ago•0 comments

The State of the Markets (July 2026)

https://bilello.blog/2026/the-state-of-the-markets-july-2026
1•latentframe•16m ago•0 comments

Country Draw: Draw the country

https://country-draw.vercel.app/
1•jonjomckay•17m ago•0 comments

Show HN: Typst-WASM – Compile Typst in browsers, Node, and serverless runtimes

https://typst-wasm-playground-cloudflare.will-bradshaw50.workers.dev/
1•will-bradshaw•17m ago•0 comments

Smart Stock Agent

https://smartstockagent.com
1•maherdosoqi•20m ago•0 comments

The Discoverable Evidence of AI-Assisted Software Porting

https://williamcotton.com/articles/the-discoverable-evidence-of-ai-assisted-software-porting
1•williamcotton•21m ago•0 comments

Psychedelia syndrome: book-length exploration of the assembly code of the game

https://psychedelia.homemade.systems/
1•ingve•22m ago•0 comments

Retok: Token-efficiency analyzer for Claude Code and Codex CLI (zero deps)

https://github.com/d-date/retok
2•opwizardx•23m ago•0 comments

NASA unsure Boeing Starliner will ever be certified for human flight

https://www.theregister.com/offbeat/2026/07/01/nasa-unsure-boeing-starliner-will-ever-be-certifie...
1•mooreds•24m ago•0 comments

Gen Z is pushing back against AI – a reminder that the future isn't written

https://www.channelnewsasia.com/commentary/gen-z-pushback-against-ai-6258016
2•Markoff•27m ago•0 comments

Multi-Primary Color Display Emerges as Next-Gen Color Reproduction Technology

https://en.ubiresearchnet.com/multi-primary-color-display-technology-2026/
2•ksec•28m ago•0 comments

Rivers Cuomo GitHub Profile

https://github.com/riverscuomo
2•mooreds•28m ago•1 comments

Requential Coding <1 bit compression with better generalization

https://github.com/shikaiqiu/requential-coding
2•pavelai•28m ago•2 comments

US Corporate Insiders Are Selling Stocks at a Near Record Pace

https://www.bloomberg.com/news/articles/2026-07-17/us-corporate-insiders-are-selling-stocks-at-a-...
2•pimienta•29m ago•0 comments

Show HN: Syntra – A terminal-first control plane for multi-model coding

https://github.com/AyushParkara/syntra
1•MANIPULAT0R0321•29m ago•0 comments

CUDA-accelerated program to search Minecraft seeds for Mooshrom Island biomes

https://github.com/MinecraftAtHome/COMMISSION
1•Tmpod•30m ago•1 comments

ProtoBot – A Robot That Grows with You

https://microbots.io/products/protobot
1•NegatioN•31m ago•0 comments