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

The Mullet Stack: Syncing Types Between FastAPI/Pydantic and TypeScript

https://seanhelvey.com/mullet-stack/guide/
1•Lambda11•1m ago•0 comments

Soaring Diesel Prices Rip Across US Economy

https://www.ft.com/content/8a5cd515-191d-42f9-9b0c-1b817a1bc044
1•karakoram•1m ago•1 comments

Selective Applicative Functors

https://blog.veritates.love/selective-applicatives-theoretical-basis
1•birdculture•4m ago•0 comments

Running Ultrix 4.5 (2019)

https://astr0baby.wordpress.com/2019/03/16/running-vax-ultrix-4-5-on-simh/
1•walrus01•5m ago•0 comments

The 400-Ton Linchpin of American Electrical Power

https://www.nytimes.com/interactive/2026/08/17/magazine/transformers-power-electric-grid.html
1•jdnier•6m ago•0 comments

Children with More Screen Time Score Better on Cognitive Tests, Not Worse

https://www.inc.com/lucia-auerbach/children-with-more-screen-time-did-not-score-worse-on-cognitiv...
1•MitPitt•7m ago•0 comments

Cursor capitalizes on GitHub frustration, launches rival hosting platform

https://techcrunch.com/2026/08/18/cursor-capitalizes-on-github-frustration-launches-rival-hosting...
2•jnord•8m ago•1 comments

Stanford's deterministic CUDA kernel verifier

https://2026.splashcon.org/details/oopsla-2026/96/Equivalence-Checking-of-ML-GPU-Kernels
2•ggboimoney•9m ago•1 comments

Spot X with Bluetooth

https://www.rei.com/product/172306/spot-x-with-bluetooth
1•Bondi_Blue•10m ago•0 comments

Inference Engineering by Philip Kiely – Digital Download

https://www.baseten.co/inference-engineering/
1•ajhai•11m ago•0 comments

An inside look at Hetzner's Datacenters [video]

https://www.youtube.com/watch?v=MQeJYEN_lrg
1•lwhsiao•13m ago•0 comments

Ask HN: How should I price an AI infrastructure platform?

1•aqibkhan026•13m ago•0 comments

Unitree Robotics IPO: "Embodied AI" Valuation Bubble?

https://www.cnn.com/2026/08/18/tech/china-unitree-ipo-intl-hnk
1•dvk13•14m ago•0 comments

Software Engineering Humble Book Bundle

https://www.humblebundle.com/books/software-engineering-manning-books
2•teleforce•14m ago•1 comments

Show HN: Particle – Extract and save articles in a clean, self-hosted reader

https://particle.crnst8.com/try/
1•flowerpil•18m ago•0 comments

Phoenix Species Project Announces Funds for Imperiled Wildlife

https://www.nytimes.com/2026/08/04/climate/phoenix-species-project-bezos-dicaprio-rewild.html
1•gmays•19m ago•0 comments

Pointer Chasing in Modern Systems: Why it hurts, When it helps

https://sourav-k-paul.medium.com/pointer-chasing-in-modern-systems-why-it-hurts-when-it-helps-and...
1•compiler-guy•19m ago•0 comments

Lying in Therapy

https://proud2bme.substack.com/p/lying-in-therapy
6•mohmdsad•21m ago•2 comments

Show HN: ResumeSkip – automatically tailor your resume to jobs

https://resumeskip.com/
2•ghosts_•24m ago•0 comments

My AI Agents Ship Code While I Sleep. Nobody Reviews It

https://goatsquadstudios.com/blog/how-i-work-with-ai-agents-autonomously
2•csgod•26m ago•0 comments

Building in the Cloud with Codex, Safely

https://www.ivan.codes/blog/building-in-the-cloud-with-codex
4•deeshee•27m ago•0 comments

Too much Chinese science is ignored by the West

https://www.economist.com/science-and-technology/2026/06/10/too-much-chinese-science-is-ignored-b...
2•ViktorRay•29m ago•1 comments

Show HN: Maritime, a platform for running AI agents for $1 a month

https://maritime.sh
4•mariagorskikh1•30m ago•0 comments

Threepp: Cross-platform C++20 3D library with the high-level API of Three.js

https://github.com/markaren/threepp
2•klaussilveira•30m ago•0 comments

AI-drafted bills are swamping the House office that writes US laws

https://gizmodo.com/its-absolutely-terrifying-ai-is-reportedly-slopping-up-the-bills-in-congress-...
2•fintuner•31m ago•0 comments

Which universities pay their faculty the most?

https://insurancedimes.com/2026/08/17/20-us-universities-where-professors-earn-over-200k-a-year/
2•crookedroad44•32m ago•0 comments

Why packaging is moving from 1D to 2D barcodes

https://www.packaging-gateway.com/features/why-packaging-is-moving-from-1d-to-2d-barcodes/
3•jawns•33m ago•0 comments

The Book of Bots

https://whatever.scalzi.com/2026/08/18/the-big-idea-james-patrick-kelly-2/
2•MattSayar•34m ago•0 comments

To Build a Data Center – Intro to Diesel Generation

https://power2026.ai/diesel
2•nsomani•34m ago•1 comments

Show HN: A sample dataset of computer-use tasks on professional software

https://cua.graderlabs.com/
14•parthmah•37m ago•2 comments