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

Strands Decider Decision Model

https://strandsagents.com/blog/introducing-strands-decider/
1•xendo•58s ago•0 comments

Decode-Latency Feedback Prefill: A Model-Free Controller

https://arxiv.org/abs/2609.38386
1•gauravapiscean•2m ago•1 comments

Giving friends custom text buzzes based on Morse code

https://liquidbrain.net/blog/giving-friends-custom-text-buzzes-based-on-morse-code/
1•evakhoury•2m ago•0 comments

Sources: US tells France, Germany to release diesel stocks or face US export ban

https://www.reuters.com/business/energy/us-tells-france-germany-release-diesel-stocks-or-face-us-...
2•mikhael•4m ago•0 comments

OpenAI Elevated Issues – ChatGPT Down

https://status.openai.com
2•robeym•4m ago•0 comments

US judge dismisses Chegg, Penske antitrust suits over Google AI Overviews

https://reuters.com/legal/litigation/google-wins-dismissal-chegg-penske-media-lawsuits-over-ai-ov...
2•utiiiD•5m ago•0 comments

Anatomy of a Lean Proof for Software Engineers

https://agostbiro.net/posts/2026-10-anatomy-of-a-lean-proof/
1•abiro•5m ago•0 comments

Ovarian Biology: Revisiting the rete ovarii (2025)

https://elifesciences.org/articles/106648
1•Tomte•6m ago•0 comments

Show HN: D-Engine – deterministic LLM code edits, 42× fewer tokens than an agent

https://github.com/corruchaga/D-Engine
1•sergiocorruchag•6m ago•0 comments

Star Hop: Endless Galaxy

https://www.star-hop.app/
1•dschnelly•8m ago•0 comments

MTV Didn't Die of Bad Taste: It Died the Day the Doors Multiplied

https://comuniq.xyz/Music/post?t=1716
1•01-_-•9m ago•0 comments

First enhanced geothermal power plant completed in just 23 months

https://techcrunch.com/2026/10/01/worlds-first-enhanced-geothermal-power-plant-completed-in-just-...
1•speckx•9m ago•0 comments

I rebuilt Claude Code's terminal UI in Rust. Then I deleted 12,000 lines of it

https://medium.com/@simonrothgang/i-rebuilt-claude-codes-terminal-ui-in-rust-then-i-deleted-12-00...
1•srothgan•11m ago•0 comments

An in-the-wild iOS bug with a possible WhatsApp zero-click path

https://calif.io/research/the-great-glyph-grift
1•metrofun•11m ago•0 comments

Tell HN: Get the app to keep using Reddit

4•sippingabonedry•12m ago•1 comments

Postgres DELETE can actually scale

https://www.dbos.dev/blog/scaling-deletions-in-postgres
1•KraftyOne•16m ago•0 comments

The Programming Language That Referees Mathematics – Leo de Moura [video]

https://www.youtube.com/watch?v=ZpQFebTK75A
1•digital55•17m ago•0 comments

Fieldwork Icon Design Benchmark

https://fieldwork.software/eval/icon-design
2•jeffpersonified•19m ago•1 comments

Terminal Email: terminal email clients for every system

https://terminalemail.com/
2•shaunatfe•20m ago•0 comments

Show HN: Large Print Maker – large-print PDFs generated in the browser

https://largeprintmaker.com/
1•xmasdong•20m ago•0 comments

Show HN: Mutually beneficial agentic Common Law

https://www.peregrini.ai
1•AKalyk•20m ago•0 comments

Binance Founder's Life After Prison

https://www.nytimes.com/2026/10/01/business/changpeng-zhao-binance.html
2•igonvalue•23m ago•1 comments

PAPod 617 – The Case Against Immediate Improvement

https://preaccident-investigation-podcast.onpodium.com/episodes/papod-617-rome-wasnt-built-at-8-a...
1•rglover•23m ago•0 comments

New Hands for Atlas – Boston Dynamics [video]

https://www.youtube.com/watch?v=4whgw2gLBS8
1•twalichiewicz•24m ago•0 comments

Analyzing the known universe of Silicon Valley characters and companies

https://twitter.com/johnsillings/status/2105726380004491388
2•johnsillings•24m ago•0 comments

SaSh: Ahead-of-time Analysis of Shell Program Effects

https://github.com/atlas-brown/sash
1•matt_d•25m ago•1 comments

Anthropic Said to Target Mega-IPO Before Thanksgiving Holiday

https://www.bloomberg.com/news/articles/2026-10-01/anthropic-said-to-target-mega-ipo-before-thank...
2•mfiguiere•26m ago•0 comments

Stock trading by US senators alongside the S&P 500 in 2026

https://www.kadoa.com/congress/insights/weekly-trading
2•hubraumhugo•27m ago•1 comments

Apedia

https://apedia.study
1•agustinzago•30m ago•0 comments

Show HN: Android closed testing badge split in two

1•cs1996•32m ago•0 comments