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

Immich Sequence Diagrams

https://app.ilograph.com/demo.ilograph.Immich/Upload%2520Asset
1•billyp-rva•21s ago•0 comments

Permanent Daylight Saving Time Could Harm Sleep and Mental Health, Analysis Says

https://www.sci.news/medicine/permanent-daylight-saving-time-15110.html
1•throw0101a•1m ago•1 comments

The Liberal Arts of Tech

https://makemeacto.cc/the-liberal-arts-of-tech/
1•mooreds•2m ago•0 comments

OpenAI Mathematics Manuscript Collection

https://github.com/openai/math/blob/main/CONTENTS.md
1•altro•2m ago•0 comments

In Appalachia, a rail-to-trail project builds bipartisan support for a bridge

https://text.npr.org/nx-s1-5980349
2•mooreds•3m ago•0 comments

Dude, you broke the future (2018)

https://www.antipope.org/charlie/blog-static/2018/01/dude-you-broke-the-future.html
1•mooreds•4m ago•0 comments

Grok Bot will use Opus 5.5, Midjourney

https://twitter.com/elonmusk/status/2107724314451878104
1•brightball•4m ago•0 comments

Germany and California Make Up an Environmental Superpower

https://www.thenation.com/article/environment/germany-and-california-make-for-a-climate-superpower/
1•robtherobber•5m ago•0 comments

MCP for agent-to-agent comms may be the riskiest protocol you've never heard of

https://arstechnica.com/security/2026/10/vulnerability-in-agents-from-google-and-others-exposes-s...
1•joozio•7m ago•0 comments

AI agent posted personal bank balances into company Slack

https://twitter.com/ShaneMac/status/2107486740491669879
1•soltanov•10m ago•0 comments

Fast single-box DeepSeek v4.1 Flash runtime

https://tangled.org/astrra.space/ds4-recipe
1•nerdypepper•10m ago•0 comments

Koreader reading statistics and highlights sync for spaced repetition

https://blog.zm.is/from-the-books-you-read-to-your-vision-board-creating-your-own-core-memories/
1•elashri•15m ago•0 comments

ClipPair – A shared clipboard for Windows and macOS

https://clippair.app/
1•tbgtech•16m ago•1 comments

Stimulus Grid: Comparing JhāNAS and 5-MeO-DMT Levels at a Glance

https://heart.qri.org/retreats/2026-tepoz/andres-gomez-emilsson/stimulus-grid-post.html
1•Anon84•18m ago•0 comments

Rex – Superlogical's AI multiplexer, now in beta

https://www.superlogical.com/updates/public-testing-beginning
1•cackjaptain•18m ago•0 comments

We tried to reproduce LLM judge position bias

https://github.com/ViridianAIQualityAssurance/viridian-assurance-research/tree/main/studies/001-p...
1•viridianassuran•18m ago•0 comments

Permanent daylight saving time could be a public health time bomb

https://www.theregister.com/offbeat/2026/10/06/permanent-daylight-saving-time-could-be-a-public-h...
2•geox•22m ago•0 comments

D-Regular Graphs of Girth (8/5) log_(d-1) n} n\) [pdf]

https://cdn.prod.website-files.com/699f62baa354ff6d1f51469c/6ac543b02a10de941589df12_girth85.pdf
1•ronfriedhaber•23m ago•0 comments

The Simulation's Ending – Claude Opus 5.5 music video

https://www.youtube.com/watch?v=R_ErmTs7g9I
1•Gooblebrai•26m ago•0 comments

Emperor penguin found 2k miles from home on Australian tourist beach (2024)

https://www.nbcnews.com/news/world/emperor-penguin-found-australia-tourist-beach-malnourished-den...
1•thunderbong•28m ago•0 comments

Holos Commander – a Commander for power users

https://github.com/xls/holos
2•coderizos•28m ago•1 comments

Braid-creator Jonathan Blow on making the 'biggest puzzle game'

https://www.bbc.co.uk/news/articles/cj3vqxldglepo
1•nickcw•32m ago•0 comments

Saaras-V4

https://www.sarvam.ai/blogs/introducing-saaras-v4
1•Regex777•32m ago•0 comments

Explaining the Magelight XP Glitch in Skyrim

https://blog.alexbeals.com/posts/explaining-the-magelight-xp-glitch-in-skyrim
1•LaSombra•34m ago•0 comments

Show HN: Who Cried AGI? – An AGI claims timeline

https://whocriedagi.com
1•maytc•36m ago•0 comments

Training a 1.93B byte-level LM on one A100: 60K steps, flat to 4x context

https://huggingface.co/AwareLiquid/M2-2B
1•EverestAn•39m ago•0 comments

AWS Uses AI to Tame Linux CVEs

https://securityboulevard.com/2026/10/aws-uses-ai-to-tame-linux-cves/
2•CrankyBear•43m ago•0 comments

'Preparing to Fire': Hear the Radio Commands Enforcing the U.S. Blockade of Iran

https://www.wsj.com/world/middle-east/preparing-to-fire-hear-the-radio-commands-enforcing-the-u-s...
2•mhardy1729•43m ago•0 comments

Woman Arrested After Conversation with Claude That Allegedly Included 'Threats'

https://gizmodo.com/florida-woman-arrested-following-conversation-with-claude-that-allegedly-incl...
3•neverminder•45m ago•0 comments

PS5 Jailbreaks Are Escalating at an Unprecedented Pace

https://www.pushsquare.com/news/2026/10/ps5-jailbreaks-are-escalating-at-an-unprecedented-pace-an...
4•password54321•45m ago•0 comments