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

How Fresh Are Your Blueberries? And What Would You Do If You Knew?

https://oliverevans.dev/blog/blueberries-voi/
1•oliverevans96•1m ago•0 comments

Ok, but Does It Scale?

https://spacetimedb.com/blog/how-does-spacetime-scale
1•sbysb•4m ago•0 comments

SEO vs. AEO vs. Geo vs. AIO

https://canonry.ai/blog/seo-vs-aeo-vs-geo-vs-aio
1•arberx•8m ago•0 comments

Why Air Batteries Are Finally Beating Lithium [video]

https://www.youtube.com/watch?v=GoiECSXOvQE
2•thelastgallon•9m ago•0 comments

MauroPello/stop-the-slop: Spot AI-generated YouTube scripts

https://github.com/MauroPello/stop-the-slop
2•rdmuser•10m ago•0 comments

Exploiting food embeddings for ingredient substitution

https://github.com/ChantalMP/Exploiting-Food-Embeddings-for-Ingredient-Substitution
1•rickcarlino•12m ago•0 comments

Chinese Espionage Threat: Suspected Spy Drone Caught over Sensitive U.S. Missile

https://www.theyeshivaworld.com/news/general/2592346/chinese-espionage-threat-suspected-spy-drone...
3•pir8life4me•12m ago•1 comments

Mouse tops FrontierHarness at 24/30 with Kimi K3 using completion loops

https://mouse.dev/blog/mouse-on-frontierharness/
2•Aeroi•15m ago•1 comments

Catalan's Constant Is Irrational

https://arxiv.org/abs/2609.04176
3•bananaflag•23m ago•1 comments

High Oil Prices Speed Up China's Shift Away from Crude

https://oilprice.com/Latest-Energy-News/World-News/High-Oil-Prices-Speed-Up-Chinas-Shift-Away-Fro...
2•thelastgallon•25m ago•0 comments

Switcher

https://www.folklore.org/Switcher.html
4•tambourine_man•26m ago•0 comments

Hugging Face open-sources Funes, a local-first memory layer for coding agents

https://huggingface.co/blog/funes
6•fourfire•31m ago•1 comments

After OpenAI's Bots Went Rogue, Watchdogs Were Kept on a Short Leash

https://www.nytimes.com/2026/09/03/technology/openai-hugging-face-hack.html
2•jaredwiener•32m ago•0 comments

Confronting Risks of Mirror Life

https://www.science.org/doi/10.1126/science.ads9158
2•mhb•34m ago•0 comments

Grep beats LSP? Why coding agents ignore your fancier tools

https://www.agentconnect.md/blog/grep-beat-lsp-harness/
10•kaonashi-tyc-01•36m ago•1 comments

Inside Gabe Newell’s 111m superyacht Leviathan

https://www.boatinternational.com/yachts/reports/gabe-newell-111m-superyacht-leviathan-oceanco
4•papa-whisky•36m ago•0 comments

Gemini 3.8 Flash

https://deepmind.google/models/model-cards/gemini-3-8-flash/
3•KinetiNode•37m ago•0 comments

Making LEDs from an Epiwafer

https://www.semiconductor.diy/guides/making-leds/
3•quantumwannabe•39m ago•0 comments

Show HN: JarPeek – Online JAR viewer, decompile classes locally (no upload)

https://jarpeek.com/
2•xooch_95•45m ago•0 comments

Rust 1.98.1

https://blog.rust-lang.org/2026/09/03/Rust-1.98.1/
3•theemathas•47m ago•0 comments

The 1990s Web vs. today's AI

https://arnoldkling.substack.com/p/the-1990s-web-vs-todays-ai
4•paulpauper•50m ago•0 comments

Ask HN: Why do many websites use a sign-in code instead of a password?

4•bariumbitmap•50m ago•2 comments

Is controllability becoming the real bottleneck for computer-use agents?

https://twitter.com/markchen90/status/2095597534412673109
2•oliviayii•53m ago•0 comments

Agentic Search

https://mistral.ai/news/agentic-search/
6•gmays•58m ago•0 comments

An 'Exercise Pill' Just Cleared Its First Human Test

https://gizmodo.com/an-exercise-pill-just-cleared-its-first-human-test-2000800380
5•tempestn•1h ago•1 comments

Tesla opens search for Cybercab fleet sales, but FSD owners are still left out

https://electrek.co/2026/09/03/tesla-opens-search-for-cybercab-fleet-sales-but-fsd-owners-are-sti...
3•jijojv•1h ago•0 comments

Nvidia Acquiring HuggingFace

https://blogs.nvidia.com/blog/nvidia-to-acquire-hugging-face/
4•zezaggering•1h ago•1 comments

The Impact of AI-Generated Text on the Internet

https://ai-on-the-internet.github.io
5•alphabetatango•1h ago•0 comments

How Much of the Internet Is Written with AI?

https://www.pewresearch.org/data-labs/2026/08/20/how-much-of-the-internet-is-written-with-ai/
4•alphabetatango•1h ago•0 comments

Post-Training Language Models for Gold-Medal Performance in Coding Competitions

https://arxiv.org/abs/2609.02849
2•sbulaev•1h ago•0 comments