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

Flock: A Flock of Birds in the Browser

https://nicobrenner.github.io/flock/
1•nico•4m ago•0 comments

Are you preparing them to be replaced?

https://ghuntley.com/replaced/
1•santiago-pl•8m ago•0 comments

X Is Bad, Though

https://lexontech.org/x-is-bad-though
2•ayaros•8m ago•0 comments

He Went Out on an Epic Wilderness Adventure. Only His Dogs Came Back

https://www.nytimes.com/interactive/2026/10/10/magazine/steffen-skjottelvik-canada-journey-death....
2•anarbadalov•18m ago•0 comments

Crest – an Arc-inspired open-source browser for Mac

https://crestbrowser.com/
1•cobychapple•21m ago•0 comments

Two Hills: Weights and Harnesses

https://rlafuente.com/posts/2026-10-11-agent-evals-1-two-hills.html
2•andes314•31m ago•0 comments

So why not?

https://grammarphobia.com/blog/2009/06/so-why-not.html
1•gjvc•31m ago•0 comments

Glassmarchy – I Built an Omarchy Sea Glass Theme

https://github.com/amazedsaint/glassmarchy
1•amazedsaint•33m ago•0 comments

SpeedyIndex

https://en.speedyindex.com/
1•victordobroff•35m ago•0 comments

What a swordfish washing up on British Columbia's coast says changing oceans

https://phys.org/news/2026-10-swordfish-british-columbia-coast-oceans.html
2•neom•38m ago•0 comments

Xerox PARC chip shatters on command

https://techxplore.com/news/2015-09-xerox-parc-chip-shatters-shards.html
6•gurjeet•41m ago•1 comments

Finding "hidden" Blizzard news feeds

https://vildravn.eu/posts/wow-forever-news-api/
1•rdmuser•48m ago•0 comments

Solving "who said what" across conversations (IEEE SLT 2026)

https://arxiv.org/abs/2609.39344
2•siddsax•48m ago•1 comments

Gh-pull – A local GitHub PR dashboard using your existing CLI login

https://github.com/shiqicao/gh-pull
2•shiqicao•54m ago•0 comments

Pizza in North Korea

https://en.wikipedia.org/wiki/Pizza_in_North_Korea
6•axbac•56m ago•0 comments

Kev

https://jaredpalmer.com/blog/introducing-kev
3•gmays•57m ago•0 comments

Sorry we made you grind LeetCode

https://www.hackerrank.com/writing/why-were-sorry
19•ishanz•1h ago•22 comments

Show HN: Make Okular safer with a sandboxed MuPDF backend

https://github.com/l4rzy/okular-mupdf-ng
3•rzy•1h ago•0 comments

Show HN: Skills Hub, a desktop app for managing AI agent skills

https://github.com/qufei1993/skills-hub
5•qufei1993•1h ago•1 comments

Flow state, the dinner rush and AI brain fry

https://jamespember.substack.com/p/flow-state-the-dinner-rush-and-ai
1•jep888•1h ago•0 comments

Can Decision Models (Like Jev) Plan Ahead?

https://www.lesswrong.com/posts/kE4pbmwzdgmFx2RFo/can-decision-models-like-jev-plan-ahead
3•kp1197•1h ago•0 comments

Show HN: Writing a Game in C

https://podule.com.au/posts/building-in-c/
3•gt0•1h ago•0 comments

Website uses AI to generate northern Indigenous news 'correspondents'

https://www.cbc.ca/news/canada/north/artificial-intelligence-indigenous-journalists-9.7345554
4•Teever•1h ago•0 comments

Show HN: Seal one sentence into a 3D star-sea,permanently anchored on Arweave

https://memlife.me
2•woailuo•1h ago•0 comments

Console market craters: Xbox sales drop 33%, PS5 sales drop 25%

https://www.tomshardware.com/video-games/console-gaming/console-market-craters-as-xbox-sales-cras...
4•Gaishan•1h ago•3 comments

Timekeepers to vote on ditching the leap second

https://www.abc.net.au/news/science/2026-10-12/we-may-be-about-to-lose-the-leap-second-for-good/1...
5•Gaishan•1h ago•0 comments

Rightwing/Pro Trump bot traffic stop after Ukraine strikes on Russia datacenters

https://www.tomshardware.com/tech-industry/data-centers/russian-disinformation-bot-traffic-nearly...
15•fullstacking•1h ago•0 comments

Lotus Improv on the NeXT

https://stonetools.ghost.io/lotusimprov-next/
6•ChristopherDrum•1h ago•1 comments

Orion2 Redone: A Master of Orion II Restoration Project

https://github.com/orion2re/orion2re
1•joecarpenter•1h ago•0 comments

Do dentists know what they're doing?

https://mapwriting.substack.com/p/dentists
5•doitLP•1h ago•0 comments