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

Seventy-five years of game AI, and every system plays a handful of games

https://kallin.github.io/blog/game-ai-one-machine-any-game/
1•kal9000•1m ago•0 comments

The new leverage of software engineering

https://edparry.com/the-new-leverage-of-software-engineering
1•edparry•2m ago•0 comments

Show HN: Ctx.traits · Agent Traits and Workflows typed, versioned and in-sync

https://ctx.company/blog/introducing-ctx-traits/
1•rpunkfu•3m ago•0 comments

The Canvas Breach Exposed the Risk of One-Platform Education

https://teachers-blog.com/the-canvas-breach-exposed-the-risk-of-one-platform-education/
1•behindai•3m ago•0 comments

Zero-Risk Bias

https://en.wikipedia.org/wiki/Zero-risk_bias
1•fsflover•3m ago•0 comments

Reaction wheel failures leave Swift rescue mission spinning in orbit

https://arstechnica.com/space/2026/07/reaction-wheel-failures-leave-swift-rescue-mission-spinning...
1•world2vec•5m ago•0 comments

AI-enabled jobs in the Philippines: an in-depth report

https://www.ccm.pm/posts/ph-ai-jobs-demand-2026-07
1•char8•6m ago•0 comments

Show HN: Nix Flakes Dotfiles

https://github.com/nooneknowspeter/dotfiles
1•nooneknowspeter•7m ago•0 comments

I Crunched the Numbers Behind FIFA's Plan to Sell Shares in the World Cup

https://www.sportsandcrime.com/p/i-crunched-the-numbers-behind-fifas
1•FinnLobsien•7m ago•0 comments

OpenAI's rogue models roamed the internet for 4 days and staged a second attack

https://www.politico.com/news/2026/07/28/openai-rogue-models-hugging-face-breach-01014572
1•cc62cf4a4f20•7m ago•0 comments

Can We Lower Construction Costs with Cheaper Labor or Materials?

https://www.construction-physics.com/p/can-we-lower-construction-costs-with
2•surprisetalk•8m ago•0 comments

Does Your Home or Classroom Need an Air Purifier? Make a Corsi-Rosenthal Box

https://www.npr.org/sections/back-to-school-live-updates/2021/08/26/1031018250/does-your-kids-cla...
2•ck2•8m ago•1 comments

Show HN: Multi-agent LLM editor with local inference via WebSockets

https://x-agent.sascha10k.biz
1•sascha10000•9m ago•0 comments

The Y2K Comeback: Why Retro UI Is Trending Again

https://palettevault.github.io/blog/y2k-renaissance/
1•eustoria•10m ago•0 comments

Science Corporation's vision-restoring chip wins EU approval

https://techcrunch.com/2026/07/22/science-corporations-vision-restoring-chip-wins-eu-approval/
2•gmays•11m ago•0 comments

Validation Is the New Bottleneck (Also, the Old One)

https://pawelbrodzinski.substack.com/p/validation-is-the-new-bottleneck
2•flail•11m ago•0 comments

Emoji QR Code Generator

https://planqr.com/emoji-qr-code
1•eustoria•12m ago•0 comments

Benchmarking Kimi K3, Opus 5, Grok 4.5, and Gemini 3.6 Flash on Baba Is You

https://quesma.com/blog/baba-kimi-k3-opus-5/
1•stared•14m ago•0 comments

Cavdo AI – Fast, minimal AI assistant with modern UI cleek and for professional

1•Cavdo-Ai•14m ago•0 comments

Life and Death on a Tower

https://www.datacenterdynamics.com/en/analysis/life-and-death-on-a-tower/
1•herbertl•14m ago•0 comments

Queen's Gambit

https://en.wikipedia.org/wiki/Queen%27s_Gambit
1•tosh•14m ago•0 comments

Show HN: ShellTeam – web app to steer coding agents on your VPS

https://github.com/sebderhy/shellteam
1•sebderhy•14m ago•1 comments

French DJ Kavinsky known for Drive soundtrack Nightcall found dead in Paris home

https://www.thejournal.ie/dj-kavinsky-dies-7116639-Jul2026/
1•austinallegro•14m ago•0 comments

All living things emit a faint glow. Could this light be useful?

https://www.nature.com/articles/d41586-026-02311-z
1•bookofjoe•15m ago•0 comments

Money, Bitcoin, and AI

https://aisocratic.org/money-bitcoin-ai
1•feulf•15m ago•0 comments

Show HN: Kiyeovo Now Supports Windows

https://github.com/Realman78/Kiyeovo/releases/tag/kiyeovo-1.1.0
3•Realman78•15m ago•0 comments

Cavdo AI – Fast, minimal AI assistant with no signup or login

1•Cavdo-Ai•16m ago•0 comments

Sam Altman is ready to decelerate

https://techcrunch.com/2026/07/28/sam-altman-is-ready-to-decelerate/
1•benwerd•16m ago•0 comments

Gambit Scheme

https://gambitscheme.org/
1•tosh•17m ago•0 comments

Cooking for Engineers

https://www.cookingforengineers.com/
2•simonpure•17m ago•0 comments