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

Gary Fisketjon Has Died. He Edited Ellis, Tartt, McInerney, and McCarthy

https://www.nytimes.com/2026/11/09/obituaries/gary-fisketjon-dead.html
1•georgex7•32s ago•0 comments

Terence Tao on AI in mathematics (and beyond)

https://teorth.github.io/tao-web/ai-views.html
1•nothing_is_real•3m ago•0 comments

Nanotern – Ternary LLM training on consumer hardware

https://github.com/comalice/nanotern-public/blob/master/REPLICATION_REPORT.md
1•all2•4m ago•1 comments

Anthropic unveils Office tools ahead of IPO

https://www.bloomberg.com/news/articles/2026-11-10/anthropic-unveils-office-tools-ahead-of-ipo-ta...
2•azhenley•6m ago•0 comments

'Citizen Kim' explains Kim Kardashian to her haters. It almost worked on me

https://www.washingtonpost.com/style/2026/10/30/citizen-kim-reminds-me-why-i-hate-kim-kardashian-...
1•landonxi•7m ago•1 comments

A Maintainer's Advice on Contributing to Open Source in 2026

https://wasp.sh/blog/2026/08/13/advice-for-contributing-in-2026
1•pranitha_m•7m ago•0 comments

High oil prices have led to a dip in global carbon emissions

https://arstechnica.com/science/2026/11/carbon-emissions-are-down-this-year-but-that-probably-won...
3•PaulHoule•8m ago•0 comments

Val Town is winding down

https://blog.val.town/winding-down
5•tosh•8m ago•1 comments

Gemini for Healthcare

https://cloud.google.com/blog/products/ai-machine-learning/gemini-for-healthcare
3•Garbage•11m ago•0 comments

Geoguessr For Birds

https://playaviarium.com/
1•Fawz•12m ago•0 comments

Incident with Git Operations and Pull Requests

https://www.githubstatus.com/incidents/hnf21m9jkl3c
2•dorianmariewo•14m ago•0 comments

Easy: Yoo, new app is launched

https://play.google.com/store/apps/details?id=com.ashtech.easytracker&hl=en_US
3•alihackera•14m ago•0 comments

Hollywood Has Flipped on GenAI, 'If You Don't Have an AI Strategy, Don't Bother'

https://variety.com/2026/film/markets-festivals/hollywood-flipped-genai-avatar-vfx-house-weta-fx-...
1•Michelangelo11•15m ago•0 comments

Classifying images with a 2B decision model instead of a vision LLM

https://builder.aws.com/content/3GJlg7QPWdrYGQbeZVaowHNSTeo/classifying-images-with-strands-decid...
2•burningman1949•15m ago•0 comments

Could Ice Cream Have a Health Benefit?

https://mymodernmet.com/ice-cream-study-harvard/
2•bilsbie•17m ago•0 comments

A rare glimpse inside the high-risk, high-reward Hormuz trade

https://www.lloydslist.com/LL1158922/A-rare-glimpse-inside-the-highrisk-highreward-Hormuz-trade
1•everybodyknows•18m ago•0 comments

What a read-only Postgres role does and doesn't stop when an AI agent connects

https://vericto.com/blog-post-postgres-read-only-role-ai-agents
1•donkan168•18m ago•0 comments

MDZip (.mdz) File Format – Portable Markdown Package

https://mdzip.org/
1•vanburen•18m ago•0 comments

Grok Bot secrets extraction vulnerability

https://profero.io/blog/the-rootkit-built-into-grok-bot
2•kevin_nisbet•19m ago•1 comments

U.S. highways have 878 stretches of 50+ miles with no fast EV charger (map)

https://chargingnear.me/nevi-charging-gaps
2•parkgraph•19m ago•0 comments

Exploring Exponentially Many Programs at Once with E-Graphs

https://stng.substack.com/p/exploring-exponentially-many-programs
1•matt_d•20m ago•0 comments

Singularity Gate: Benchmark for AI-driven paradigm-shifting scientific discovery

https://singularitygate.org/
2•leumon•21m ago•0 comments

How Do Building Codes Affect the Price of Housing?

https://www.construction-physics.com/p/how-do-building-codes-affect-the
2•aray07•21m ago•0 comments

TimeNet: Open-source data infrastructure for temporal foundation models

https://github.com/OpenTSLM/TimeNet
2•rjakob•23m ago•0 comments

Show HN: Asm Lens – See the assembly of each function in VS Code

https://github.com/IdanShalom/asm-lens
1•idansoccer4•24m ago•0 comments

CSS Sundial Clock

https://imjasonh.github.io/playground/sundial/
1•ImJasonH•24m ago•0 comments

Memory Safety Bugs in Rust Standard Library

https://forge-blog.github.io/posts/rust-std-memory-safety/
2•matt_d•25m ago•0 comments

Testing AI image watermarks: C2PA and SynthID

https://nabraj.com/blog/testing-ai-watermarks
1•coffeecoders•27m ago•0 comments

Greenfield – a short film about the last engineers who write code by hand [video]

https://www.youtube.com/watch?v=_9wf9YdeqPE
3•mhsmith•27m ago•0 comments

Salmon Farmers Deploy Lasers, Robots to Meet Booming Demand

https://www.wsj.com/business/salmon-farmers-deploy-lasers-robots-to-meet-booming-demand-2cad3925
3•sbmthakur•28m ago•0 comments