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

"Remaining Awake Through a Great Revolution" Commencement Address (1959)

https://kinginstitute.stanford.edu/king-papers/documents/remaining-awake-through-great-revolution...
2•mooreds•5m ago•0 comments

SNAP's New Rules Make Eligible Families Go Hungry [audio]

https://omny.fm/shows/platypus-economics/how-snaps-new-rules-make-eligible-families-go-hungry-the...
1•mooreds•6m ago•0 comments

The Beer Drinker's Guide to XAA

https://thesaml.substack.com/p/the-beer-drinkers-guide-to-xaa
2•mooreds•6m ago•0 comments

Conviction

https://kennethnym.com/blog/conviction/
2•polyphilz•8m ago•0 comments

Nothing failed. That's why no one caught it.

https://miralume.dev/the-architect/nothing-failed
2•Jernesstar•9m ago•0 comments

Expected Log-Return as a Risk Control

https://win-vector.com/2026/08/10/expected-log-return-as-a-risk-control/
1•jmount•10m ago•0 comments

The UK's War on Anonymity Has Come to America

https://www.effort.news/uk-lobby
2•slowin•12m ago•0 comments

Media Offenders

https://www.whitehouse.gov/mediabias/
5•cocacola1•16m ago•0 comments

Bonestell Gallery

https://www.bonestellgallery.com/
2•rienbdj•17m ago•0 comments

People don't hate AI because of Zuck. They hate the version TechCrunch sells

https://runtimewire.com/article/people-don-t-hate-ai-because-of-zuckerberg-they-hate-the-version-...
2•ryanmerket•18m ago•1 comments

Théâtrophone: Proto-Spotify, 140 years ago

https://en.wikipedia.org/wiki/Th%C3%A9%C3%A2trophone
2•chtefi•20m ago•0 comments

Multi-agent version control with reactive feedback

https://lexifina.com/blog/adding-a-multi-agent-write-lock
1•alansaber•22m ago•0 comments

The Field Is Optional. The Death Threats Were Not

https://canartuc.medium.com/the-field-is-optional-the-death-threats-were-not-1e2f1f0ce772
2•andsoitis•24m ago•0 comments

Optimizing GEMM and Activation on CDNA4 with TLX

https://www.amd.com/en/developer/resources/technical-articles/2026/optimizing-gemm-with-tlx.html
1•matt_d•25m ago•0 comments

Show HN: Basht – A bash shell that handles multitasking better

https://github.com/samiam95124/basht
1•samiam95124•25m ago•2 comments

Show HN: The Annotated DiffusionGemma

https://mlberkeley.substack.com/p/the-annotated-diffusiongemma
1•timothygao•25m ago•0 comments

VectorGrid Core – Bare-metal C++ grid orchestration for AI data centers

https://github.com/MaximiH-86/GridPulse_Production_Server
1•Masama3•28m ago•0 comments

WebGPU for simple procedural 2D Grass Rendering

https://jarl-game.com/blog/2d-gpu-grass-rendering/
3•vladimirzaytsev•29m ago•0 comments

Show HN: Opencodex, a free open-source coding agent for VSCode

https://github.com/matonhp5108/Opencodex
1•thephantomhider•29m ago•0 comments

Human Approval Is a Privilege Escalation Path

https://corebasehq.com/blog/human-approval-is-a-privilege-escalation-path
1•y11t0•32m ago•0 comments

Nixpkgs-multiverse: every version that ever existed

https://fzakaria.com/2026/08/09/nixpkgs-multiverse-every-version-that-ever-existed
1•birdculture•35m ago•0 comments

YouTube Just Raised the Monetization Bar (Again)

https://pleasehustleresponsibly.substack.com/p/youtube-just-raised-the-monetization
2•angelahollowell•35m ago•0 comments

How safe is your sandbox when executing untrusted code?

https://twitter.com/nebusecurity/status/2086939881335607608
1•Finbarr•36m ago•0 comments

Rent and Pensions Eat Half of Your Disposable Income

https://julienreszka.com/blog/rent-and-pensions-eat-half-of-your-disposable-income/
2•julienreszka•38m ago•0 comments

Optimizing the Point Away

https://www.workbyjacob.com/thoughts/optimizing-the-point-away
1•slackpad•38m ago•0 comments

Show HN: Scroll through all 43252003274489856000 Rubik's Cube states

https://everycube.alen.is/
2•Alen123•41m ago•0 comments

Text AI watermarks will always be trivial to remove

https://www.seangoedecke.com/text-ai-watermarks/
2•gfysfm•46m ago•0 comments

Wanno – AI builder, cloud agent and infra for your apps

https://wanno.dev/
1•federiconbo•46m ago•0 comments

Show HN: News Aggregator for Science and Technology

https://paperrun.news/popular
1•fingerz17•47m ago•0 comments

Xbox PC and Game Pass titles coming to Linux through 'Xodus' open-source project

https://www.tomshardware.com/software/linux/xbox-pc-and-game-pass-titles-are-coming-to-linux-thro...
1•sbulaev•51m ago•1 comments