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

Microsoft Tgrep

https://github.com/microsoft/tgrep
1•handfuloflight•3m ago•0 comments

OpenAI hires Chuck Schumer's daughter as lead lobbyist during regulatory talks

https://www.washingtonexaminer.com/policy/technology/4715947/openai-hires-chuck-schumer-daughter-...
1•healsdata•4m ago•0 comments

Why your agent should manage it's context through SQL [video]

https://www.youtube.com/watch?v=uMudSbZ79-A
1•handfuloflight•4m ago•0 comments

Pushing R2 to its limits: stress testing Cloudflare's zero-egress object storage

https://carolinacloud.substack.com/p/pushing-r2-to-its-limits-stress-testing
2•bojangleslover•8m ago•0 comments

Britain loses third-highest taxpayer to Greece

https://www.telegraph.co.uk/business/2026/09/07/billionaire-city-tycoon-quits-britain-for-greece/
2•cramer4next•8m ago•0 comments

Wall Cladding Ideas

https://www.amaritrading.co.za/blog/blogs-13/18-wall-cladding-ideas-to-transform-any-space-in-sou...
1•doshopzone•9m ago•0 comments

Playing "Taboo" with AI Watermarking

1•loosetypewriter•9m ago•0 comments

Developer Agency in the Age of AI

https://languageops.com/blog/the-software-exists-because-of-the-developers-agency/
1•luxpir•9m ago•0 comments

I Know What You Think of Me

https://archive.nytimes.com/opinionator.blogs.nytimes.com/2013/06/15/i-know-what-you-think-of-me/
1•7777777phil•11m ago•0 comments

Losing control of AI is the plan

https://www.theargumentmag.com/p/losing-control-of-ai-is-actually
2•ForHackernews•12m ago•0 comments

I Believe in Traditional Gender Roles

https://drunkwisconsin.substack.com/p/i-believe-in-traditional-gender-roles
1•Tomte•14m ago•0 comments

We Are Not Friends

https://weare-notfriends.com/en-us
1•barrister•16m ago•0 comments

Show HN: Mu – a mouse-driven terminal code editor written in terrible Rust

https://github.com/erqeon/mu
1•erqeon•16m ago•1 comments

Singapore: Highest paid world leader Lawrence Wong to get salary increase of $1M

https://www.bbc.com/news/articles/c5y5kn143d1o
1•doppp•17m ago•0 comments

Livy, a Shopify app looking for beta testers

https://www.indiehackers.com/post/building-livy-a-shopify-loyalty-retention-app-looking-for-a-han...
1•julietalfredes•18m ago•0 comments

Fractal-BLT – Zero-allocation .NET 10 MoE runtime streaming NVMe to GPU

https://github.com/H4ZEY86/Fractal-BLT
1•Ctrl_Alt_Haze•19m ago•0 comments

Classified as terrorists by the US government: Hacker collective A/I gives up

https://www.heise.de/en/news/Classified-as-terrorists-by-the-US-government-Hacker-collective-A-I-...
1•doener•23m ago•0 comments

Docker-Boot

https://github.com/purplesyringa/docker-boot
1•thijsr•28m ago•0 comments

Demystifying Complex Configurations

https://guix.gnu.org/blog/2026/demystifying-complex-configurations//
1•birdculture•30m ago•0 comments

Thoughts on Omarchy

https://chrissy.dev/notes/thoughts-on-omarchy/
4•meetpateltech•33m ago•0 comments

No Graphics API

https://github.com/sebbbi/NoGraphicsAPI
2•sagacity•33m ago•0 comments

Gap between how your team sees you AND how you see yourself

https://highimpactengineering.substack.com/p/the-gap-between-how-i-saw-myself
3•cmpit•34m ago•0 comments

We have found stable singularity on 3D Euler

https://twitter.com/AnimaAnandkumar/status/2097216195342864528
2•YeGoblynQueenne•35m ago•0 comments

Automatically detecting AI text in my browser

https://www.seangoedecke.com/deckard/
4•swah•37m ago•1 comments

By coincidence an independent result on Euler blowup has been released

https://mathstodon.xyz/@tao/117234157753860650
2•YeGoblynQueenne•38m ago•0 comments

Ancient Egypt in 3D

https://expeditione.fun/expeditions/ancient-egypt/
3•thunderbong•39m ago•0 comments

How to export Gemini chats to pdf [video]

https://www.youtube.com/watch?v=zFdp8DUfDco
3•quysala12•39m ago•0 comments

World Model (Artificial Intelligence)

https://en.wikipedia.org/wiki/World_model_(artificial_intelligence)
3•doener•42m ago•0 comments

Project Tapestry

https://thealliance.ai/projects/tapestry
2•doener•42m ago•0 comments

Plasma Studio

https://thelibre.news/announcing-plasma-studio/
4•DeepLogin•43m ago•0 comments