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

Generative AI scandal has come to one of Nikon's competitions

https://www.dpreview.com/news/generative-ai-scandal-has-come-to-one-of-nikons-competitions/
1•DASD•23s ago•0 comments

WallHop – 12ft.io is gone, so I built a replacement

https://wallhop.io/
1•TheWaffleHax•1m ago•0 comments

PSPi 6 – Raspberry Pi in a PSP

https://github.com/othermod/PSPi-Version-6
1•therepanic•2m ago•0 comments

Consistency is not a localized property

https://n-the-loop.com/blog/consistency-is-not-a-localized-property/
1•b-man•3m ago•0 comments

TypeScript-Native Frontend Framework

https://github.com/PureStackStudio/PureStack
1•koculu•4m ago•0 comments

Ask HN: Are iPhones the Handheld Version of Flock?

2•dfps•5m ago•0 comments

LLM Pareto Frontier over time [video]

https://www.youtube.com/watch?v=I01v36VIrno
1•ponyous•6m ago•1 comments

Stop Reaching for WebSockets by Default: WebSockets vs. SSE vs. Long Polling

https://medium.com/@anirbansingha20/websockets-vs-long-polling-vs-server-sent-events-fa9bc1644cb8
1•birdculture•17m ago•0 comments

Show HN: Free LED pixel-pitch and display-size calculators (open source)

https://boardsy.co.uk/free-exhibition-display-tools/
2•Boardsy•21m ago•0 comments

Supreme Court: 401(k) case over private funds and underperformance

https://www.cnbc.com/2026/10/10/supreme-court-case-401k-private-funds-intel.html
1•cramer4next•23m ago•0 comments

Pulp Cover Treatments of Classic Works of Literature

https://lithub.com/50-pulp-cover-treatments-of-classic-works-of-literature/
3•ohjeez•23m ago•0 comments

Veda: The First Agentic Hobby Operating System

https://github.com/vahmoh25/Veda
2•vahmohh•25m ago•0 comments

Microsoft Launches Surface Laptop Ultra, Surface RTX Spark Dev Box

https://www.servethehome.com/microsoft-launches-surface-laptop-ultra-surface-rtx-spark-dev-box/
1•teleforce•27m ago•0 comments

Ask HN: Why aren't Americans rising up against tipping?

2•bjourne•27m ago•1 comments

'We cannot accept foxes in our landscape': the plan to save Australia's wildlife

https://www.theguardian.com/australia-news/2026/oct/11/fox-australia-threatened-native-species-wi...
1•cisc•29m ago•0 comments

A minimal Rust TUI for managing GitHub repos and branches

https://github.com/jorgeandrecastro/github-workflow
2•drew0670•30m ago•0 comments

The 'black box' wastewater trade that rakes in millions for UK utility companies

https://www.theguardian.com/environment/2026/oct/09/uk-water-companies-industrial-commercial-wast...
3•cisc•34m ago•0 comments

Autonomous Delivery Skill

https://gist.github.com/EvanBoyle/8c1a97f682d92dab8c09d0e1ea73f4a0
2•gfortaine•38m ago•0 comments

Anthropic Bans Cruelty to Claude, Still Won't Say What It Protects

https://rews.cc/a/anthropic-bans-cruelty-to-claude-still-won-t-say-what-it-pro-bd99f6
37•ojosilva•39m ago•46 comments

Will We Ever Understand Dementia?

https://www.nytimes.com/2026/10/10/science/will-we-ever-understand-dementia.html
2•bookofjoe•39m ago•1 comments

Show HN: ISA Workbench – Classify and explore binaries in the browser

https://zr.ax/
5•19h•40m ago•0 comments

Microsoft CEO Nadella Calls for 'Emergency Brake' on Advanced AI

https://www.bloomberg.com/news/articles/2026-10-10/microsoft-ceo-nadella-calls-for-emergency-brak...
6•sbulaev•40m ago•0 comments

Show HN: TruthBeacon – Open-source Discord moderation app in Tauri and Rust

https://github.com/boredpolymath/truth-beacon
2•boredpolymath•50m ago•0 comments

Personal agents are not aligned with consumer long-term interests

https://twitter.com/BrendanFalk/status/2109068824293351774
2•brendanfalk•57m ago•0 comments

Vision for New Autonomous Warfare Command Laid Out by Pentagon

https://www.twz.com/news-features/vision-for-new-autonomous-warfare-command-laid-out-by-pentagon
4•cisc•58m ago•0 comments

How to Recover Your Yahoo! Groups from the Internet Archive (2021)

https://datahorde.org/how-to-recover-your-yahoo-groups-from-the-internet-archive/
2•turtleyacht•1h ago•0 comments

Show HN: Dewey: a connectome-driven fruit fly for your macOS menu bar

https://github.com/JorenSix/Dewey
3•joren-•1h ago•0 comments

This Website Is Now Made in Swift

https://sindresorhus.com/blog/swift-website
2•ingve•1h ago•0 comments

Eye Cells May Have Been Rejuvenated for the First Time in People

https://time.com/article/2026/10/08/eye-cells-rejuvenated-for-the-first-time-in-people/
3•davidrjones1977•1h ago•1 comments

Show HN: Aporium – A UMAP galaxy of 5800 philosophy excerpts in conversation

https://www.aporium.app/explore
3•kevinjacobh•1h ago•0 comments