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

Fare Inspection Is Suspended on NYC Buses After Passenger Is Tackled

https://www.nytimes.com/2026/10/22/nyregion/mta-suspends-bus-fare-nyc-kyle-taylor.html
1•dataflow•2m ago•0 comments

Slack's Migration to a Cellular Architecture

https://slack.engineering/slacks-migration-to-a-cellular-architecture/
1•theanonymousone•3m ago•0 comments

Intel's long-lost Larrabee GPU turns up in self-storage with working drivers

https://www.techspot.com/news/114416-intel-long-lost-larrabee-gpu-turns-up-storage.html
1•walterbell•4m ago•0 comments

Language Models Suck at Real-Time Control

https://lucrbvi.com/blog/celestebench/
1•lucrbvi•7m ago•0 comments

Even Grand Theft Auto's original creators haven't been able to play GTA 6

https://www.bbc.com/news/articles/c6jd7k5ryl1mo
1•tosh•7m ago•0 comments

Musical composition based on Nobel Prize winner Anne L'Huillier's physics

https://www.youtube.com/watch?v=pBsI1eJqqQ8
1•fjalarhl•16m ago•0 comments

Jensen Huang allegedly manufactured the GPU shortage

https://wccftech.com/jensen-huang-financed-ai-startups-absorb-excess-silicon/
2•bobsoap•17m ago•1 comments

Why one broken pod sends you fifty alerts

https://blog.kwatch.dev/one-failure-fifty-alerts
1•abahmed•20m ago•0 comments

Writing a DSL for high performance parallel programming in OxCaml

https://blog.janestreet.com/writing-a-dsl-for-high-performance-parallel-programming-in-oxcaml/
1•birdculture•20m ago•0 comments

Show HN: Zero-RNG algebraic audit of codon syntax across 141M codons in RefSeq

https://github.com/Dr-Logvinovich/codon-torus-syntax
2•DRLogvinovich•27m ago•0 comments

I bricked my smart ceiling fan, then reverse-engineered it back to life

https://ahmedmassoud.me/blog/reverse-engineering-my-smart-ceiling-fan/?ref=hn
3•ahmedwalid05•30m ago•0 comments

The cmake.org certificate expired again

https://cmake.org/
2•debugnik•33m ago•0 comments

Some old bit.ly links get redirected

https://twitter.com/stabilitytheory/status/2121895502560055496
3•taubek•33m ago•0 comments

Taking AI Seriously

https://borretti.me/article/taking-ai-seriously
2•bananaflag•35m ago•0 comments

Thoughts on memory layers like mem0

2•anshmalik2002•45m ago•0 comments

Codex is deprecating plan mode

https://github.com/openai/codex/issues/18490#issuecomment-6890525683
1•EnnioEvo•46m ago•0 comments

Hacker News Daily

https://lopespm.com/hackernews-daily/
1•lopespm•47m ago•0 comments

TingLongWu – local, offline meeting translation (listen and speak)

https://github.com/sunososobro-hub/tinglongwu
1•sosobro•52m ago•0 comments

Show HN: Diagnosed with diabetes at 16, I built Diabic for World Diabetes Day

https://diabic.com
2•shahriarpshuvo•52m ago•0 comments

Terence Tao and Peter L.: Live Math with Open Math OS [video]

https://www.youtube.com/watch?v=rCZFomL5WBg
1•vismit2000•54m ago•0 comments

Blog on Multiagent Interaction Protocols

https://masr.gitlab.io/blog/
1•ioper•58m ago•1 comments

Show HN: Kasa, simplest budgeting app you can find

https://kasafinance.online/
1•emirhanozsoy•1h ago•0 comments

Open Source Motorcycle Infotainment

https://gitlab.com/FalkF/hackasaki-spinbridge
2•usernam33•1h ago•1 comments

Most of AI moats are just fuel

https://adlrocha.substack.com/p/adlrocha-most-of-ai-moats-are-just
1•iLuddite•1h ago•0 comments

Gitly: lightweight, self-hosted GitHub/GitLab alternative written in V

https://github.com/vlang/gitly
2•modinfo•1h ago•0 comments

A Pile of MCP Connectors Is Not a Context Engine

https://getunblocked.com/blog/mcp-connectors-are-not-a-context-engine/
1•fagnerbrack•1h ago•0 comments

Leo gets a birthday bash, 75 years after clocking in

https://www.theregister.com/offbeat/2026/11/15/leo-gets-a-birthday-bash-75-years-after-clocking-i...
1•defrost•1h ago•0 comments

Turn any image into emoji art, in the browser

https://www.thousandtools.com/image-to-emoji/
1•vaibhavvudayagi•1h ago•0 comments

Show HN: Vantage-V-AI – 2-bit ternary KV-cache with attention sinks

https://github.com/khoadev-vn/VANTAGE-V-AI
1•Anh_khoa•1h ago•0 comments

Periodic-Oriented Programming for First Robotics

https://bvisness.me/periodic-oriented-programming/
1•joshcsimmons•1h ago•0 comments