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 darker side of being a doctor

https://drericlevi.pages.dev/the-darker-side-of-being-doctor/
2•face2sunny•15s ago•0 comments

Has Jevons paradox broken down?

https://martinalderson.com/posts/has-jevons-paradox-broken-down/
1•subaelyo•59s ago•0 comments

Geodesic Dome

https://en.wikipedia.org/wiki/Geodesic_dome
1•tosh•7m ago•0 comments

Let AI fix the mess it created

https://aronbijl.com/blog/the-ghost-in-the-bibliography
1•aronaxe•10m ago•0 comments

Estonia's court overrules decision to allow voting via mobile device

https://news.err.ee/1610208910/estonia-s-top-court-overturns-decision-to-allow-mobile-device-voti...
2•hendotee•11m ago•0 comments

I made an interactive map of every every ski resort in the world

https://www.boarderspeak.com/map/resorts
2•TasselHat•11m ago•2 comments

James Shore: Measuring AI's Impact on Delivery Speed

https://www.jamesshore.com/v2/blog/2026/measuring-ais-impact-on-delivery-speed
1•fagnerbrack•13m ago•0 comments

Why I won’t leave mathematics, despite AI solving centuries-old problems

https://www.theguardian.com/commentisfree/2026/nov/22/why-i-wont-leave-mathematics-despite-ai-sol...
3•face2sunny•22m ago•2 comments

Gaussian process regression with symbolic kernels

https://muoperator.com/articles/gaussian-process-regression-symbolic-kernels/
2•auggierose•22m ago•1 comments

Why Wordpress.org Moved Its Support Inboxes to Self-Hosted FreeScout

https://www.portotheme.com/why-wordpress-org-moved-its-support-inboxes-to-self-hosted-freescout/
2•silving•23m ago•0 comments

Pimalaya goes stable: Himalaya v3 and the pimdir standard

https://blog.pimalaya.org/pimalaya-goes-stable/
1•joshcsimmons•24m ago•0 comments

One screen is better than >1 screens

https://wgx.gemlogger.com/one-screen-is-better-than-more-than-1-screens
1•wgx•25m ago•0 comments

EU Sovereign Tech Fund Pilot

https://www.sovereign.tech/programs/eu-sovereign-tech-fund
2•vogu66•26m ago•0 comments

How AI coding tools are changing software engineering

https://www.cnbc.com/2026/11/20/ai-coding-tools-software-engineers.html
3•madihaa•27m ago•0 comments

'Cyber incident' forces UK Gov to take some services offline

https://www.bbc.co.uk/news/live/c6rrg94lgjrjt
4•thorin•29m ago•2 comments

Spotify Clone with Claude

https://medium.com/@anthony.cherbuin/i-built-my-family-their-own-spotify-style-app-in-5-days-with...
1•darktoto•31m ago•0 comments

Show HN: Slash commands and AI snippets that work everywhere you type

https://slashanywhere.com
2•appetizersnack•33m ago•0 comments

Mount Fuji – Mapterhorn Contours (Sound Map)

https://mapsmania.github.io/mapchallenge/contours.html
3•FiderHi•33m ago•0 comments

Using AI as a tool, not a replacement for your doctor

https://www.kidneyfund.org/article/using-ai-tool-not-replacement-your-doctor
2•Danhale93•34m ago•0 comments

Show HN: Moonlight – which medicines are approved or in trials for any disease

https://moonlight-1038733794937.asia-south1.run.app/
1•shreshthdugar•35m ago•0 comments

Why Claude's Riemann proof comes down to a coin toss

https://www.youtube.com/watch?v=-z0RKi30iSY
1•nyc111•35m ago•1 comments

Black Weekend – Reduced Prices on Evil

https://medium.com/luminasticity/black-weekend-reduced-prices-on-evil-b84039e03361
1•bryanrasmussen•36m ago•1 comments

What people build with Lovable: a visualisation of 66k websites

https://startups.novumsignals.com/reports/lovable-november
1•walterschnitzel•36m ago•0 comments

Prnet, Winlink, and the story of email over radio

https://buttondown.com/blog/email-over-radio
2•maguay•37m ago•0 comments

Cost of Thanksgiving dinner went up 6% from last year

https://iowacapitaldispatch.com/2026/11/26/cost-of-thanksgiving-dinner-went-up-6-from-last-year/
2•madihaa•37m ago•0 comments

The Beauty of CSS Mixins

https://patrickbrosset.com/articles/2026-11-25-the-beauty-of-css-mixins/
2•birdculture•37m ago•0 comments

Do Programmers Have a Future?

https://lernerpython.com/2026/11/26/do-programmers-have-a-future/
1•lumpa•39m ago•1 comments

Show HN: Europe Instead – find the European version of the tools you use

https://europeinstead.com
4•RafaelRoman•41m ago•0 comments

Google alternative Kagi launches an email service

https://www.theverge.com/tech/1041000/kagi-mail-email-google-gmail-alternative
2•thunderbong•41m ago•0 comments

Show HN: Pure-Python Docx to PDF Converter, No Word or LibreOffice Needed

https://github.com/rahulkhairnarr/docx-to-pdf-converter
4•rahulkhairnarr•42m ago•0 comments