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

Nix Koans

https://rgbcu.be/blog/nix-koans/
1•RGBCube•1m ago•0 comments

Kryptos: Paradigm Puzzles

https://paradigm.xyz/kryptos-ctf/pk1
1•nycdatasci•2m ago•0 comments

Four Programming Languages You've Probably Never Heard of [video]

https://www.youtube.com/watch?v=_rHoHLanuQg
1•marvinborner•4m ago•0 comments

Sodium Bicarbonate for In-Hospital Cardiac Arrest – A Randomized Clinical Trial

https://jamanetwork.com/journals/jama/fullarticle/2850405
1•bookofjoe•10m ago•0 comments

Solid-state batteries are now powering EVs in the real world

https://electrek.co/2026/06/11/solid-state-batteries-now-powering-evs-in-real-world/
1•breve•11m ago•0 comments

How to prepare for interview in the new AI era

https://medium.com/@amney.mounir/data-analyst-interviews-are-changing-with-ai-and-you-better-be-r...
2•amnito•11m ago•2 comments

The social consequences of AI delegation

https://arxiv.org/abs/2606.11058
1•Anon84•11m ago•0 comments

No-One Is Going to Buy Your Videogame

https://illomens.itch.io/no-one-is-going-to-buy-your-game
1•generichuman•12m ago•0 comments

We recommend Highway over std:SIMD

https://github.com/google/highway/blob/master/g3doc/std_simd_comparison.md
1•ndiddy•13m ago•0 comments

Oracle and the AI Boom's Hidden Debt Bomb

https://www.inc.com/fast-company-2/oracle-ai-boom-hidden-debt-nvidia-jensen-huang/91357055
2•PessimalDecimal•14m ago•0 comments

Socratic Spiral Learning with LLMs

https://abhichavali.com/posts/socratic-spiral-learning-with-llms/
2•chabi•28m ago•1 comments

Show HN: Spin up MCU simulations like VMs

https://simulator86.com/blog/simulator86-sdk/
1•grog_6•37m ago•0 comments

Trump admin blocks foreign access to Anthropic's most powerful AI models

https://www.axios.com/2026/06/12/anthropic-trump-mythos-fable-national-security
18•some-guy•54m ago•4 comments

Show HN: Full-self browsing - agents can drive any web task using this CLI Skill

https://www.webcli.sh/?hn
1•keepamovin•55m ago•0 comments

Humans in the Way [video]

https://www.youtube.com/watch?v=ruzZ5UDm-MM&list=PLyfdekfVUs1zBkdxO99rhEJ695mMzGso6
1•satisfice•59m ago•1 comments

Quantum Field Screensaver

https://rogmash.neocities.org/quantumfield
2•rogmash•1h ago•0 comments

Ask HN: What will be the next big memory management system for AI Agents?

1•AlanAAG•1h ago•1 comments

Mexico's president meeting with Ben Horowitz, from a16z

https://twitter.com/Claudiashein/status/2065497274893905938
2•aylmao•1h ago•1 comments

UnpredictaBench: A Benchmark for Evaluating Distributional Randomness in LLMs

https://arxiv.org/abs/2606.06622
1•matt_d•1h ago•0 comments

Show HN: Pilang – A scripting language and VM written in C

https://github.com/rolandbrake/pilang
1•rolandbrake•1h ago•0 comments

The Mysterious Woman Behind the Nord Stream Explosion

https://www.wsj.com/world/europe/nord-stream-explosion-pipeline-9a109da9
2•nradov•1h ago•0 comments

Glacial Valley

https://github.com/deedy/glacial-valley
1•tanelpoder•1h ago•0 comments

Linear Algebra Kernels for the Age of Research

https://www.gpumode.com/news/linear-algebra-kernels-age-of-research
1•matt_d•1h ago•0 comments

Russia builds up infrastructure near Europe's border to deploy over 100k troops

https://www.pravda.com.ua/eng/news/2026/06/10/8038671/
2•Bender•1h ago•0 comments

From a Single File to an MCP Server: Six Rewrites of My Own Harness

https://pub.towardsai.net/from-a-single-file-to-an-mcp-server-six-rewrites-of-my-own-harness-74b4...
3•tacoda•1h ago•0 comments

Agentifying Agent Assessment for Openness, Standardization, and Reproducibility

https://arxiv.org/abs/2606.13608
1•tcp_handshaker•1h ago•0 comments

Pink Cosmo Blueberries

https://www.baldorfood.com/product/blueberries/be3p-pink-cosmo-blueberries
1•mooreds•1h ago•0 comments

Why Tomatoes Are the Most Expensive They've Been in Four Decades [audio] [video]

https://www.youtube.com/watch?v=pUrIlUAo0kM
1•mooreds•1h ago•0 comments

What Do Engineers Mean When We Say "Taste"?

https://davegriffith.substack.com/p/what-do-engineers-mean-when-we-say
1•mikez302•1h ago•0 comments

Latent learning: episodic memory complements parametric learning

https://openreview.net/forum?id=RuWGeX5ZiB
2•matt_d•1h ago•0 comments