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

In the product end game, every change carries significant risk

https://devblogs.microsoft.com/oldnewthing/20091104-01/?p=16143
1•anitil•15s ago•1 comments

About legal tech, because I can't sleep

https://patent.dev/about-legal-tech-because-i-cant-sleep/
1•funktionslust•50s ago•0 comments

Recording shows Alabama Power lobbyist discussing bill to appoint utility regula

https://www.wbrc.com/2026/02/16/recording-shows-alabama-power-lobbyist-discussing-bill-appoint-ut...
2•newsomix9xl•5m ago•1 comments

A Turning Point in AI Writing

https://www.theatlantic.com/technology/2026/08/wall-street-journal-ai-op-ed/688433/
1•petethomas•12m ago•0 comments

In a divided America, left and right unite to oppose AI data centers

https://apnews.com/article/data-centers-bipartisan-opposition-trump-democrats-a419be82fb6b32a8fc0...
1•1vuio0pswjnm7•16m ago•0 comments

MI: Measure Price Calculator – AI Pricing for Shopify

https://apps.shopify.com/mi-measure-price-calculator
1•motion-hero•18m ago•0 comments

Leibniz's Philosophy of Physics

https://plato.stanford.edu/archives/fall2024/entries/leibniz-physics/
1•andsoitis•20m ago•0 comments

Show HN: My fast TUI Finnish-English dictionary is now in the browser via WASM

https://taskusanakirja.com/
1•hiAndrewQuinn•22m ago•0 comments

£50k needed to purchase church with Maxwell's grave

https://www.bbc.com/news/articles/cjw5d121x9lo
1•dboreham•23m ago•0 comments

Entropy – Mental Model

https://read.perspectiveship.com/p/entropy
1•fagnerbrack•31m ago•0 comments

WAFT: Warping-Alone Field Transforms for Optical Flow (2025)

https://arxiv.org/abs/2506.21526
1•peter_d_sherman•37m ago•1 comments

Claude diagnosed problematic RTX 4090 with faulty vram then wrote a software fix

https://www.reddit.com/r/ClaudeAI/comments/1vzy4cg/claude_figured_out_what_was_wrong_with_my_4090/
1•JMiao•37m ago•0 comments

Show HN: Understudy: Scenario Testing for AI Agents

https://github.com/gojiplus/understudy
1•neehao•40m ago•0 comments

Please stop flooding our projects with AI slop to furnish your CV

https://neilalexander.dev/2026/06/30/flooding-contributions
6•signa11•43m ago•0 comments

A New Framework for How the Brain Compresses Our Noisy World

https://www.quantamagazine.org/a-new-framework-for-how-the-brain-compresses-our-noisy-world-20260...
2•pykello•43m ago•0 comments

128-Bit page tables for Arm

https://lwn.net/Articles/1088125/
1•pykello•44m ago•0 comments

Amdahl's Law: The Speedup You Cannot Exceed

https://infinitelimit.ai/posts/2026-08-27-amdahls-law/
2•gilad•44m ago•0 comments

ChatGPT may be changing how you're writing

https://www.sfgate.com/tech/article/chatgpt-change-writing-22404681.php
1•TMWNN•45m ago•1 comments

A call for collective action on cyber defense

https://openai.com/collective-cyberdefense/
1•mellosouls•57m ago•0 comments

12 Small Steps for Man [video]

https://www.youtube.com/watch?v=aL2TYHegE2M
1•mzomnir•57m ago•0 comments

Nord-5 – A 32-bit minicomputer from 1972

https://en.wikipedia.org/wiki/Nord-5
3•peter_d_sherman•1h ago•0 comments

US Military funding propelled China's robot dogs

https://www.militarytimes.com/industry/techwatch/2026/08/18/how-us-military-funding-propelled-chi...
2•o4c•1h ago•1 comments

Where Are You Going?

https://mapwriting.com/blog/where-are-you-going/
1•doitLP•1h ago•0 comments

The swarm had no grants

https://www.asticouisland.com/governance/essays/the-swarm-had-no-grants
1•gregschueman•1h ago•0 comments

CSV merger that lines up mismatched columns by header, browser-only

https://usefiletools.com/data/merge-csv/
3•builderbuild•1h ago•0 comments

How the Heck Do Record Players Work?

https://perthirtysix.com/how-the-heck-do-record-players-work
2•bobbiechen•1h ago•0 comments

The Mini Cheetah Robot(2019)

https://robot-daycare.com/posts/2019-12-16-the-mini-cheetah-robot/
1•o4c•1h ago•0 comments

Show HN: A focused workspace for creating short AI videos with H3 Max

https://h3max.app/
1•Evanmo888•1h ago•0 comments

Group size effects and collective misalignment in LLM multi-agent systems – PNAS

https://www.pnas.org/doi/10.1073/pnas.2531697123
1•Anon84•1h ago•0 comments

Making fast, pressure-sealed thermocouple probes

https://robot-daycare.com/posts/thermocouple/
1•o4c•1h ago•0 comments