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

A small, self-hosted HTTP API that turns HTML, URLs and JSON into PDF/A-3a

https://pdf-ua-api.bambamboole.com/
1•robin_reala•48s ago•0 comments

Show HN: Meadow Mind – a 7B diffusion LLM plays Gym games with zero training

https://github.com/Hey-Meadow/meadow-mind
1•akaiHuang•59s ago•0 comments

Flock Blocks Itself from Wayback Machine: How Companies Can Erase Their History

https://ipvm.com/reports/flock-wayback
1•jhonovich•1m ago•0 comments

SplitShot

https://splitshot.co/
1•kolachalama•2m ago•0 comments

GeoLibre 1.0

https://geolibre.app/
1•jonbaer•3m ago•0 comments

Using biotelemetry to assess drone effects on whale sharks

https://esajournals.onlinelibrary.wiley.com/doi/10.1002/ecs2.70575
1•PaulHoule•3m ago•0 comments

CC-Ledger: Cost Controls for Claude Code

https://ccledger.dev
1•tejpalv•3m ago•1 comments

Beware the Benedict Bot

https://firstthings.com/beware-the-benedict-bot/
1•cratermoon•4m ago•0 comments

Insurers aren't the main villain of the U.S. health care system

https://www.noahpinion.blog/p/insurers-arent-the-main-villain-of
3•paulpauper•5m ago•0 comments

The $20 fix that solved traffic deaths

https://www.youtube.com/watch?v=tMBR3ur1egk
1•amai•5m ago•0 comments

The Progressive Movement, 1898-1914

https://arnoldkling.substack.com/p/the-progressive-movement-1898-1914
1•paulpauper•6m ago•0 comments

Show HN: SlopGuard, a GitHub App that quarantines AI slop PRs and issues

https://slopguard.app
1•blue-b•7m ago•0 comments

You can't fix a broken process by bolting AI on top of it

https://roganov.me/blog/token-irresponsibility/
2•IFC_LLC•7m ago•0 comments

Immigration Laws Are Made to Be Broken

https://www.betonit.ai/p/immigration-laws-are-made-to-be-broken
1•paulpauper•8m ago•0 comments

Following acquisition by OpenAI, Tart is still proprietary software

https://github.com/openai/tart/pull/1238
1•whimblepop•9m ago•0 comments

Every breaking change in the July MCP spec, and how to migrate

https://mcpmigrate.dev/blog/mcp-spec-2026-07-28-migration-guide
1•dougwalseth•11m ago•0 comments

How JPL Keeps the 13-Year-Old Curiosity Rover Doing Science

https://spectrum.ieee.org/curiosity-rover-jpl-mars-science
3•pseudolus•12m ago•0 comments

The Fifth Shift: Saronic's autonomous vessels are a revolution in naval warfare

https://arenamag.com/articles/the-fifth-shift
1•crescit_eundo•13m ago•0 comments

Anthropic Bulks Up Its Enterprise Partner Program Amid IPO Plans

https://www.wsj.com/cio-journal/anthropic-bulks-up-its-enterprise-partner-program-amid-ipo-plans-...
1•gmays•14m ago•0 comments

A key remapping daemon for Linux

https://github.com/rvaiya/keyd
1•joooscha•14m ago•1 comments

Twenty Year Old Unicorn Goes AI-First Without Mass AI Layoffs

https://shiftmag.dev/ai-first-izabel-jelenic-infobip-10156/
2•dxs•15m ago•0 comments

WWDC26: Run local agentic AI on the Mac using MLX [video]

https://www.youtube.com/watch?v=wykPErJ8M-8
3•jorisw•17m ago•1 comments

Reddit's home screen now forces a "for you" feed that cannot be turned off

https://old.reddit.com/r/bugs/comments/1u26ydd/comment/oqvhjvc/
4•jazzypants•17m ago•1 comments

Show HN: Tiny project memory for coding agents

https://github.com/Seven128/project-tiny-context-harness
1•SevenQin•17m ago•0 comments

WWDC 2026: Five Things That Matter

https://systemhyperlink.com/wwdc-2026-five-things-that-actually-matter/
2•timothybsmith•18m ago•0 comments

Improved Tracking of Brownian Milk Globules

https://chillphysicsenjoyer.substack.com/p/improved-tracking-of-brownian-milk
1•crescit_eundo•19m ago•0 comments

Nordstjernen Web Browser 1.0.3

https://github.com/nordstjernen-web/nordstjernen/releases/tag/1.0.3
2•andreasrosdal•20m ago•0 comments

Microsoft restricts Claude Fable for employees over data retention concerns

https://www.theverge.com/report/947575/microsoft-claude-fable-5-restricted-internally
5•speckx•20m ago•0 comments

Elixir for a Bluesky DataPlane: the choice we didn't expect

https://bitcrowd.dev/why-elixir-bluesky-dataplane/
2•s3cur3•21m ago•0 comments

Language Models Need Sleep: Learning to Self-Modify and Consolidate Memories

https://arxiv.org/abs/2606.03979
1•gmays•21m ago•0 comments