frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•8mo 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•8mo 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•8mo 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).

Cecil Kelley Criticality Accident

https://en.wikipedia.org/wiki/Cecil_Kelley_criticality_accident
1•toomuchtodo•6m ago•0 comments

Millennium Prize Problem Bench

https://mppbench.com/
2•a_tartaruga•8m ago•0 comments

eBook: Wall Street Sold Out Main Street

https://www.founderstowne.com/
1•i_have_to_speak•13m ago•0 comments

My Home Fibre Network Disintegrated

https://alienchow.dev/post/fibre_disintegration/
1•alienchow•13m ago•0 comments

I Use Jujutsu

https://abhinavsarkar.net/posts/jj-usage/
2•vinhnx•14m ago•0 comments

AI Predicts Disease from One Night of Sleep

https://www.sciencedaily.com/releases/2026/01/260109023114.htm
1•phyzix5761•20m ago•1 comments

Best Practices for Reducing Dependabot Noise

https://nesbitt.io/2026/01/10/16-best-practices-for-reducing-dependabot-noise.html
1•todsacerdoti•21m ago•0 comments

SoundSlab: How It Started

https://craigjb.com/2026/01/10/soundslab-beginning/
1•ahlCVA•21m ago•0 comments

AI Consciousness: A Biological Perspective

https://substack.com/@cocakoala/note/p-184178209
1•imranmk•26m ago•1 comments

The Stranger You Can Trust

https://www.thefp.com/p/the-stranger-you-can-trust
1•gmays•30m ago•0 comments

Judging Books by Their Covers, Empirically

https://yakshed.com/books/
1•abound•33m ago•0 comments

Show HN: PrintReadyBook

https://printreadybook.com/
1•cboulio•36m ago•0 comments

I Built a 1 Petabyte Server from Scratch [video]

https://www.youtube.com/watch?v=vVI7atoAeoo
1•zdw•36m ago•0 comments

Q Source

https://en.wikipedia.org/wiki/Q_source
1•vinnyglennon•38m ago•0 comments

Lord's Prayer

https://en.wikipedia.org/wiki/Lord%27s_Prayer
1•vinnyglennon•38m ago•0 comments

Subagents, Commands and Skills Are Converging

https://vivekhaldar.com/articles/claude-code-subagents-commands-skills-converging/
1•gandalfgeek•38m ago•0 comments

Musk's X to open source new algorithm in seven days

https://www.reuters.com/business/media-telecom/musks-x-open-source-new-algorithm-seven-days-2026-...
1•maxloh•38m ago•0 comments

Show HN: UI testing using multimodal LLMs

https://kodefreeze.com
1•kodefreeze•43m ago•0 comments

San Jose Mayor: CA's proposed wealth tax push burden onto middle class families [video]

https://www.youtube.com/watch?v=muVVOjJsLG8
1•donsupreme•43m ago•0 comments

Max Payne – two decades later – Graphics Critique

https://darkcephas.blogspot.com/2021/07/max-payne-two-decades-later-graphics.html
2•davikr•49m ago•0 comments

Show HN: Just published a hard-SF novel Voyager1 returns with a quantum palantir

https://www.amazon.com/dp/B0GFSMP572
1•dufbugderopa•54m ago•0 comments

Orca: A New Architecture for Efficient AGI Through Parent-Teacher Learning

https://x.com/EricOmnigenius/article/2009656779945451932
2•ericspecullaas•55m ago•0 comments

A curated list of awesome explorable explanations

https://github.com/blob42/awesome-explorables
3•vitalnodo•59m ago•0 comments

The Declining Value of Personal Advice

https://www.gojiberries.io/the-declining-value-of-interpersonal-advice/
2•neehao•59m ago•1 comments

Show HN: Artdots: The benefits of creating a side project

https://artdots.co/blog/artdots-the-benefits-of-creating-a-side-project
1•veliona•1h ago•0 comments

Nvidia Announces Alpamayo Open-Source AI Models to Accelerate Reasoning-Based AV

https://nvidianews.nvidia.com/news/alpamayo-autonomous-vehicle-development
2•lateforwork•1h ago•0 comments

Ask HN: Before codebase review, replace all vars containing simple with complex?

1•gitprolinux•1h ago•0 comments

Show HN: Umaro – An interactive music theory suite for guitarists

https://www.umaro.app/
2•SnowingXIV•1h ago•0 comments

Zluda run unmodified CUDA on non Nvidia hw

https://www.phoronix.com/news/ZLUDA-CUDA-13.1-Compatibility
2•gigatexal•1h ago•0 comments

"About a decade ago... I developed an automated theorem-proving framework"

https://twitter.com/getjonwithit/status/2009602836997505255
2•Ariarule•1h ago•0 comments