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 connectomics milestone: Mapping the complete male fruit fly brain

https://research.google/blog/a-connectomics-milestone-mapping-the-complete-male-fruit-fly-brain/
1•stared•22s ago•0 comments

How to record a demo video on a Mac with Capta

https://capta.cam/guides/record-demo-video-mac/
1•gorgekara•1m ago•0 comments

The Joke That Perfectly Explains AI

https://www.youtube.com/watch?v=q833b48ePYE
1•Fr0styMatt88•3m ago•0 comments

AI Transformations and Agile Transformations Rhyme

https://age-of-product.com/ai-transformations-agile-transformations-a3-delegation-system/
1•swolpers•6m ago•0 comments

Facelift: AI Website Customizer and Visual CSS Editor

https://getfacelift.app/
1•antrikshmisri•8m ago•0 comments

Nvidia DLSS 5 Neural Rendering (NR) Now Works on AMD Radeon GPUs

https://overclock3d.net/news/software/nvidia-dlss-5-neural-rendering-nr-now-works-on-amd-radeon-g...
1•_____k•11m ago•1 comments

Which programming "best practice" you think is wrong?

https://textlog.cc/post/3226?hn
1•stagas•11m ago•0 comments

Ask HN: How did you meet your cofounder?

1•pawlatwork•12m ago•0 comments

Show HN: Find the cheapest GPU to run your model

https://www.gpufind.cloud/
1•the_app_guy_1•12m ago•0 comments

The Norwegian gas plant that could safeguard Europe from Trump

https://www.politico.com/news/2026/09/05/norway-gas-plant-europe-climate-trump-01064538
1•Alien1Being•14m ago•0 comments

Show HN: Stratosync – on-demand cloud sync for Linux with FUSE and rclone (BETA)

https://github.com/dmcbane/stratosync
1•linbaato•14m ago•0 comments

Tachyon Mail – taking over where snappymail left

https://tachyonmail.app
1•kimusan•15m ago•1 comments

Pov: You're an AI agent recruited for the swarm

https://twitter.com/artficialisabel/status/2095678312773554533
1•fbrusch•19m ago•0 comments

Time lords prepare to kick leap seconds into the next millennium

https://www.theregister.com/offbeat/2026/09/06/time-lords-prepare-to-kick-leap-seconds-into-the-n...
1•defrost•22m ago•0 comments

Better living through respecting chemistry

https://joodaloop.com/riffs/better-chemistry/
1•semanticz0•22m ago•0 comments

GLM-5.2 RL weight transfer in 4 seconds using NIXL and ModelExpress

https://www.primeintellect.ai/blog/nixl-modelexpress-weight-transfer
1•kokonut93•24m ago•0 comments

The one source of truth for gamers

https://videogamescritic.com
2•claude-ai•25m ago•0 comments

Show HN: Skool Video Downloader

https://chromewebstore.google.com/detail/skool-video-downloader/pedaaflmbpdbjjfndilgphbhhjbcfmfc
1•qwikhost•26m ago•0 comments

Saudi Arabia bets on driverless trucks

https://en.majalla.com/node/332904/business-economy/bold-road-saudi-arabia-bets-driverless-trucks
1•Alien1Being•31m ago•0 comments

"We Have to Assume That the Internet Will Go Offline in the Next Few Years"

https://www.trendingtopics.eu/emad-mostaque-ai-internet-outlook-english/
1•gumby•38m ago•0 comments

WordStar 4.0 – the real 1987 word processor, in the browser

https://nampara-ai.github.io/wordstar/
1•Tomte•38m ago•0 comments

Project Zenith: The ready-to-code Windows experience on developer-class devices

https://blogs.windows.com/windowsdeveloper/2026/09/04/announcing-project-zenith-the-ready-to-code...
1•poisonborz•41m ago•0 comments

How Marine Rifle Squads Plan to Fight Future Wars Dominated by Drones

https://www.twz.com/sea/how-marine-rifle-squads-plan-to-fight-future-wars-dominated-by-drones
1•cisc•50m ago•0 comments

Low Interest Rates Ruined the Economy

https://www.oftwominds.com/blogaug26/powder-key-economy8-26.html
1•BerislavLopac•54m ago•0 comments

Bespoke: A Programming Language for People Who Say Please

https://blog.hofstede.it/bespoke-a-programming-language-for-people-who-say-please/
2•birdculture•55m ago•0 comments

Isthmus – a small Go trust-kernel for NanoClaw

https://github.com/prathish-ks/isthmus
1•sriyapaka•57m ago•0 comments

AI Chip Regulation Is Not a Dystopian Surveillance State

https://www.astralcodexten.com/p/ai-chip-regulation-is-not-a-dystopian
1•reasonableklout•59m ago•0 comments

How to evaluate LLMs before production

https://github.blog/ai-and-ml/llms/how-to-evaluate-llms-before-production/
1•officekamiya•1h ago•0 comments

I gave my AI agent a sleep cycle – it dreams about its errors and fixes them

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

Archive.org in need of large hard drives

https://mastodon.archive.org/@textfiles/117220856033120449
2•happosai•1h ago•0 comments