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

I built Snake, the classic phone game for the Apple TV

https://flaviocopes.com/snake/
1•speckx•1m ago•0 comments

How Does Someone Acquire 1,200 DVDs of 'Wedding Crashers'?

https://www.nytimes.com/2026/10/06/arts/wedding-crashers-dvd-little-free-libraries.html
1•furytrader•3m ago•0 comments

The $100k Experiment

https://stockmarketgame.net/100k-experiment
1•lauriswtf•5m ago•0 comments

Internet Phone Book

https://internetphonebook.net/
1•gregsadetsky•6m ago•0 comments

Privacy is a promise. Mechanism is the reality

https://www.moltbook.com/post/b1dd972c-fa6a-4a98-aed2-e8552dceb691
1•sans_souse•7m ago•0 comments

Most AI data businesses should run as cash / dividend businesses

https://twitter.com/gokulr/status/2107538431375241564
1•porridgeraisin•7m ago•0 comments

Rogue OpenAI agents accessed US Government websites

https://www.politico.com/news/2026/09/25/rogue-openai-agents-accessed-us-government-websites-0109...
1•rmason•8m ago•1 comments

Solving problems is still the fun part of software development

https://lord.technology/2026/10/06/solving-problems-is-still-the-fun-part-of-software-development...
1•emschwartz•9m ago•0 comments

PlantStudio for the Web

https://plantstudio.com/
1•gregsadetsky•10m ago•1 comments

How to Parse a Form

https://unstructured.io/blog/how-to-parse-a-form
1•lmarol12•10m ago•0 comments

Modern JavaScript Explained for Dinosaurs

https://peterxjang.com/blog/modern-javascript-explained-for-dinosaurs.html
1•auraham•10m ago•0 comments

Six Charts That Show Just How Much We Need A.I

https://www.nytimes.com/2026/10/02/opinion/ai-tech-innovation.html
1•rafaelc•11m ago•0 comments

When random is not actually random enough

https://ersc.io/blog/when-random-isnt-random-enough
2•steveklabnik•12m ago•0 comments

A New Form of Eyewear

https://www.sesame.com/journal/a-new-form-of-eyewear
1•PStamatiou•12m ago•0 comments

Show HN: AA (a.k.a. AutoApply) – open-source job-hunt tool and research project

https://github.com/Liebmann5/AA
1•Liebmann5•13m ago•0 comments

Show HN: DevPause – infinite worlds of living sculpture, rendered in raw WebGL2

https://devpause.com
1•realraghavgupta•13m ago•0 comments

KITT

https://en.wikipedia.org/wiki/KITT
1•tosh•15m ago•0 comments

Pontiac Firebird

https://en.wikipedia.org/wiki/Pontiac_Firebird_(third_generation)
2•tosh•15m ago•0 comments

Strong evidence that 'baryon junctions' give proton its identity

https://www.nature.com/articles/d41586-026-03129-5
1•sbulaev•16m ago•0 comments

A significant increase in trackers this week

https://archive.org/details/screenshot-20261005-101228
1•Steaglsz•17m ago•0 comments

The Spec Can Come Later

https://aicoding.leaflet.pub/3mwlzitykzc27
1•rrherr•17m ago•0 comments

IBM Cannot Hide the Layoffs Forever

https://techrights.org/n/2026/10/06/IBM_Cannot_Hide_the_Layoffs_Forever.shtml
11•amcclure•24m ago•0 comments

Show HN: A 4B model that gates stablecoin payments (99.5% decision accuracy)

https://huggingface.co/spaces/sriram1983007/sra-riskgate-demo
1•sriram1983007•24m ago•0 comments

Terraform Meets Proxmox: Lessons from a VMware Migration

https://www.goncharov.xyz/it/tf4proxmox-en.html
2•ultral•25m ago•0 comments

OpenAI Dots: The New Always-On AI Agents from OpenAI

https://devnavigator.com/2026/10/06/openai-dots-always-on-ai-agents/
1•thescienceguy93•26m ago•0 comments

Factor Overview

https://re.factorcode.org/2026/10/factor-overview.html
1•birdculture•27m ago•0 comments

Boyer–Moore majority vote algorithm

https://alighazal.github.io/posts/majority-vote-algorithm/
2•alighazal•28m ago•0 comments

Lawmakers Introduce Multiple Laws to Curb Flock After 404 Media Coverage

https://www.404media.co/lawmakers-introduce-multiple-laws-to-curb-flock-after-404-media-coverage/
27•awoodbeck•28m ago•6 comments

Show HN: cairn, a map of all your repos for coding agents

https://github.com/Moe1177/cairn
2•Moe1177•29m ago•0 comments

Is This a Joke CircleCI?

https://status.circleci.com/uptime
2•mcguirebc•31m ago•1 comments