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

My Opinion on RL

1•umjunsik132•3m ago•0 comments

The Art of Kite Flying (1430–1929)

https://publicdomainreview.org/collection/art-of-kite-flying/
1•benbreen•6m ago•0 comments

Show HN: Woltspace – a lodge for your coding agents

https://www.woltspace.com/
1•jerpint•10m ago•0 comments

GitHub Banned All CI for Our (OSS) Org Because of Bad Drive-By Contributors

2•BlueMatt•10m ago•0 comments

Americans and AI 2026: Chatbots, Smart Devices and Views on Impact

https://www.pewresearch.org/internet/2026/06/17/americans-and-ai-2026-chatbots-smart-devices-and-...
2•toomuchtodo•16m ago•1 comments

Rightwing populist 'El Tigre' wins Colombia election

https://www.ft.com/content/49294716-56be-40a4-ba31-b4e376ccb47f
1•petethomas•16m ago•0 comments

Zombie unicorns are haunting Silicon Valley

https://www.economist.com/business/2026/06/21/zombie-unicorns-are-haunting-silicon-valley
4•andsoitis•19m ago•1 comments

Crossary – AI-assisted field mapping that outputs signed Excel files

https://www.crossary.com
1•migueljpalmeida•20m ago•0 comments

Japan's Toto to invest $495M in chip materials, targeting 1-nm era

https://asia.nikkei.com/business/tech/semiconductors/japan-s-toto-to-invest-495m-in-chip-material...
1•Nrbelex•23m ago•0 comments

Never Too Late

https://stephengbarr.substack.com/p/its-never-too-late-practical-tips
1•SGBmedia•24m ago•0 comments

Remaking BBC test cards to teach you video processing

https://www.youtube.com/watch?v=U_6HxPkrgcg
1•unleaded•25m ago•0 comments

Job application asked for my SAT scores

https://mrmarket.lol/job-application-asked-for-my-sat-scores/
2•mrmarket•25m ago•0 comments

2k retired Google Pixel phones get a second life as a private cloud

https://www.theregister.com/on-prem/2026/06/18/2000-retired-google-pixel-phones-get-a-second-life...
2•joebuckwilliams•27m ago•0 comments

Early prototype of Stonehenge unearthed 3 miles from prehistoric landmark

https://www.nbcnews.com/world/united-kingdom/stonehenge-united-kingdom-prehistoric-prototype-summ...
2•gmays•33m ago•1 comments

Keogram: The Sky in 2025

https://apod.nasa.gov/apod/ap260621.html
1•mef51•33m ago•0 comments

Entity Core Protocol

https://github.com/EntityChurch/entity-core-protocol/blob/master/specs/ENTITY-CORE-PROTOCOL.md
1•billatbillslab•36m ago•1 comments

You're probably using Agent Skills wrong

https://notes.ansonbiggs.com/youre-probably-using-agent-skills-wrong/
2•MisterBiggs•43m ago•0 comments

Hacking their bodies for a longer life: is there science behind their methods?

https://www.nature.com/articles/d41586-026-01884-z
2•olalonde•47m ago•0 comments

World-first catch: new shark species

https://www.eurekalert.org/news-releases/1132305
2•gmays•51m ago•0 comments

Show HN: Baserates.dev, memorize programmer napkin math

https://www.baserates.dev/
1•stopachka•55m ago•0 comments

The Doom Justifies the Valuation

https://geohot.github.io//blog/jekyll/update/2026/06/21/the-doom-justifies-the-valuation.html
32•inatreecrown2•1h ago•17 comments

The Next Black President

https://www.vanityfair.com/story/the-next-black-president
7•Kapura•1h ago•0 comments

Ask HN: Are you being "529 Overloaded" by Anthropic too?

4•hmokiguess•1h ago•1 comments

QEMU with Espressif

https://github.com/espressif/qemu
2•arbayi•1h ago•0 comments

Older iPhones are vulnerable to a flaw Apple likely can't fix

https://mashable.com/tech/older-iphones-vulnerable-to-a-flaw-apple-cant-fix
3•gnabgib•1h ago•0 comments

Claude: Elevated Error Rates for Opus 4.8, Opus 4.7, Opus 4.6, and Sonnet 4.6

https://status.claude.com/incidents/lv35v0q9nsj2
32•forks•1h ago•35 comments

(Reverse Engineering) Apple Internals: Swift in the Kernel

https://blog.calif.io/p/apple-internals-swift-in-the-kernel
3•dnw•1h ago•0 comments

1983 Northern Telecom Commodore Phone

https://www.oldtelephoneroom.ca/1983-northern-telecom-commodore-phone/
12•arexxbifs•1h ago•2 comments

Give your sandboxed agents API keys they can't read

https://www.superserve.ai/blog/introducing-secrets/
2•Amit_Patil_010•1h ago•0 comments

Better Grammar – Grammar Practice for Adults

https://benkaiser.github.io/better-grammar/
3•benkaiser•1h ago•0 comments