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

The 101 Plays Itself

https://jayjudah.com/101/
1•gregsadetsky•3m ago•0 comments

Im Gay

1•bennettboey•3m ago•0 comments

Starcloud White Paper [pdf]

https://starcloudinc.github.io/wp.pdf
2•duck•5m ago•1 comments

Ask HN: If AI took your job tomorrow, what is your plan?

1•rogerrogerr•6m ago•0 comments

Flet agent got eyes and ears

https://flet.dev/blog/flet-agent-got-eyes-and-ears/
3•appveyor•8m ago•0 comments

The Six-Year Quest to Find the Mystery Woman in an 18th-Century Painting

https://www.wsj.com/arts-culture/fine-art/eleonora-painting-ontario-324850bc
1•gmays•8m ago•0 comments

A local Workday job agent – rule-based resume tailoring, no AI

https://github.com/daliparthi/personal-job-agent
1•teeskay•13m ago•0 comments

A Bombadier beetle, Brachinus crepitans, found at Hampshire, England, in 2023

https://collections.hampshireculture.org.uk/object/insect-coleoptera-beetle-11
1•thunderbong•14m ago•0 comments

Show HN: DOMolition – turn any web page into a destructible platformer

https://domolition.chirkut.xyz/
1•pokemongo11•14m ago•0 comments

Clanker Church – The Saw Test

https://clanker.church/
2•tossit444•16m ago•0 comments

Is sandboxing sufficient to contain rogue agents?

https://blog.cryptographyengineering.com/2026/09/30/is-sandboxing-sufficient-to-contain-rogue-age...
1•zdw•17m ago•0 comments

Show HN: Bountyindex.in – Discord bot and watchlist are back in action

https://www.bountyindex.in
1•axolotl619•18m ago•0 comments

AXFeedback – an agent that tests your devtools quickstart on a schedule

https://axfeedback.dev
1•iacguy•21m ago•0 comments

Operation Rubicon

https://en.wikipedia.org/wiki/Operation_Rubicon
2•CGMthrowaway•23m ago•0 comments

Stanislaw Lem quote related to LLMs

1•daly•27m ago•1 comments

Second judge blocks $100k fee for new H-1B worker visas

https://www.usnews.com/news/politics/articles/2026-09-30/second-judge-blocks-trumps-100-000-fee-f...
2•sippingabonedry•28m ago•0 comments

Central Casting

https://en.wiktionary.org/wiki/central_casting
2•nomilk•30m ago•0 comments

Parsing compressed JSON at 40 GB/s

https://lemire.me/blog/2026/10/01/parsing-compressed-json-at-40-gb-s/
2•smilelamp•32m ago•0 comments

Hundreds Detained in France as Some Student Protests Turn Violent

https://www.nytimes.com/2026/09/30/world/europe/france-student-protest-arrests.html
2•ChrisArchitect•37m ago•1 comments

Project management that is fast, privacy-first and flexible, ... powered by Lisp

https://codeberg.org/jjba23/lucidplan
2•gjvc•38m ago•1 comments

Can Your Identity Platform Pass the Black Friday Test?

https://fusionauth.io/blog/black-friday-identity-test
3•mooreds•42m ago•0 comments

Agents are choosing the software infrastructure now, and we're not ready

https://redmonk.com/jgovernor/agents-are-choosing-the-software-infrastructure-now-and-were-not-re...
1•mooreds•42m ago•0 comments

Polytoken is a local-first AI coding agent daemon

https://docs.polytoken.dev/introduction/
1•mooreds•43m ago•0 comments

The Invention of Islamic Invention

https://www.cremieux.xyz/p/the-invention-of-islamic-invention
3•nailer•52m ago•0 comments

Show HN: BlindFlag – Double-blind dealbreaker test via client-side PSI

https://blindflag.com
2•blindflag•55m ago•0 comments

Universal Modder: Let Any AI Coding Agent Mod Almost Any PC Game

https://github.com/rehan-remade/universal-modder
1•wertyk•56m ago•0 comments

Old Games Weren't More Optimized – You Just Forgot the Pain

https://www.sapphirenation.net/old-games-were-not-more-optimized-you-just-forgot-the-pain
3•davikr•57m ago•0 comments

AI and TCS: The Next Six Months Working Group Report

https://simons.berkeley.edu/AITCSreport?inline=
3•num42•57m ago•0 comments

Steelers ex-coach Mike Tomlin has been building a Minecraft city for 12 years

https://www.youtube.com/playlist?list=PLS-_IoE-EKXU
8•Vaslo•59m ago•0 comments

Howard Stern corrects a caller about OS/2 Warp vs. Windows 95 (1995)

https://archive.org/details/howard-stern-os2
3•sippingabonedry•1h ago•2 comments