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

Show HN: SearchJack – 23 extensions, 758K users, 8 search monetization brokers

https://malext.io/reports/SearchJack/
1•toborrm9•18s ago•0 comments

Wall Street Is Rushing to Fund the AI Bonanza in Every Conceivable Way

https://www.wsj.com/finance/investing/global-stocks-markets-dow-news-06-08-2026-aac7c547
1•thm•3m ago•0 comments

Linux latency measurements and compositor tuning

https://farnoy.dev/posts/linux-latency
1•GalaxySnail•6m ago•0 comments

GentleOS – Classic operating system with a lovely retro GUI

https://github.com/luke8086/gentleos32
1•tekkertje•7m ago•0 comments

Stop pasting files into agent prompts

https://julienreszka.com/blog/stop-pasting-files-into-agent-prompts/
1•julienreszka•7m ago•0 comments

Pockemon Go data used as landmarks to train military drones

https://www.trouw.nl/redactie/PokemonGo/
1•piskov•8m ago•0 comments

How disinformation in Congo is worsening Ebola epidemic

https://www.dw.com/en/how-disinformation-in-congo-is-worsening-ebola-epidemic/a-77434273
2•wslh•8m ago•0 comments

Show HN: ΦASIS and Atmos, zero and BIOS layers beneath a breathwork app

https://shiihaa.app/atmos/
1•felixzeller•8m ago•1 comments

Full Text of Strategic Bitcoin Reserve Bill (H.R. 8957) Published

https://bitcoinmagazine.com/news/full-of-strategic-bitcoin-reserve-bill
1•giuliomagnifico•10m ago•0 comments

Europe Needs to Come Together. This Man Has Some Ideas

https://www.nytimes.com/2026/06/09/opinion/europe-defense-van-middelaar.html
2•wslh•12m ago•1 comments

Lessons for Reusable Web Components

https://dan-webnotes.com/posts/2026-06-07-lessons-reusable-web-components/
1•dandep•13m ago•0 comments

Samsung's SSD warranty policy scammed me so I'm taking them to court [video]

https://www.youtube.com/watch?v=WpPIW4aeeag
1•sschueller•13m ago•0 comments

SDL 2.0 Future Support

https://discourse.libsdl.org/t/sdl-2-0-future-support/68372
1•tosh•14m ago•0 comments

Affiliate Marketing Software for AI video generator businesses

https://www.rewardful.com/use-cases/ai-video-generators
1•avanticc•14m ago•1 comments

Psiloscoby

https://www.psiloscoby.com/
1•the-mitr•15m ago•0 comments

Graph eigencentrality FIFA world cup predictions

https://cambridge-intelligence.com/blog/fifa-world-cup-predicting-winner-using-graph-theory/
1•dan_ci•16m ago•0 comments

Show HN: I built a simple web data extraction tool for founders and researchers

https://sensecollect.com
1•chrislxy•16m ago•0 comments

Supabase Series F

https://supabase.com/blog/supabase-series-f
1•rdrishabh312•17m ago•0 comments

Show HN: Hacker News waterfall

https://trizuliak.com/experiments/hacker-news-waterfall
5•trizoza•17m ago•2 comments

A tool to find companies similar to your best customers

https://www.vincary.com/
1•bajero•17m ago•0 comments

White House urges UK not to ban social media for under-16s

https://www.theguardian.com/uk-news/2026/jun/09/white-house-urges-uk-not-ban-social-media-under-16s
2•piqufoh•19m ago•2 comments

Determinism Routine Online

https://sozialsoziokrat.substack.com/p/the-beta-is-over-the-universal-operating
1•Daniel_Bauer•32m ago•0 comments

Would a Submarine Work as a Spaceship? [video]

https://www.youtube.com/watch?v=EsUBRd1O2dU
1•doener•34m ago•0 comments

Izakaya Economics

https://www.theguardian.com/world/2026/jun/09/japan-traditional-izakaya-struggling-economic-hard-...
3•tosh•35m ago•0 comments

Growing Pains of Starting a Secret Society

https://mrmarket.bearblog.dev/growing-pains-of-starting-a-secret-society/
2•mrmarket•36m ago•0 comments

Eagle Computer: The rise and fall of an early PC clone

https://dfarq.homeip.net/eagle-computer-the-rise-and-fall-of-an-early-pc-clone/
6•giuliomagnifico•40m ago•1 comments

TokenTamer A proxy that reduces LLM token usage through context compression

https://github.com/borhen68/TokenTamer
1•borhensaidi•40m ago•1 comments

A Botched Master Thesis Proposal and Idea for a Decentralized VPN

https://blog.t1m.me/blog/designing-a-decentral-vpn-protocol-w-libp2p
1•rickcarlino•42m ago•0 comments

Ask HN: Thoughts on Siri AI?

2•akashwadhwani35•47m ago•0 comments

Cleaning up after AI rockstar developers

https://www.codingwithjesse.com/blog/rockstar-developers/
1•BrunoBernardino•47m ago•0 comments