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

Swarm Scaling

https://www.tobyord.com/writing/swarm-scaling
1•louiereederson•49s ago•0 comments

Cracking VFPU math functions using Claude (Sony PSP)

https://www.ppsspp.org/blog/vfpu-math-re/
1•hrydgard•2m ago•1 comments

ZeroDrift – A small model that finds and fixes compliance violations

https://zerodrift.com/model/anchor-3-benchmark
2•chobberoni•3m ago•0 comments

Show HN: Dunara

https://dunara-studio.com/
1•grebmann•3m ago•0 comments

Flux 3 Action Tops RoboLab, but Large Companies Can't Use It in a Product

https://topicqueue.substack.com/p/flux-3-action-tops-robolab-but-larger
1•DISCURSIVE•4m ago•0 comments

Astronomers capture an unprecedented view of gas giant formation in action

https://phys.org/news/2026-09-astronomers-capture-unprecedented-view-gas.html
3•PeterCorless•5m ago•0 comments

China Holds Sensitive F-35 Parts Diverted to Hong Kong from Australia

https://www.bloomberg.com/news/articles/2026-09-23/china-is-holding-sensitive-f-35-parts-diverted...
2•rbanffy•7m ago•0 comments

The "C" Word

https://blog.coredump.cx/p/the-c-word
1•zdw•7m ago•0 comments

Restaurants Are Using AI to Advertise Their Food and It's Making People Sick

https://www.wsj.com/tech/ai/restaurants-ai-food-image-generators-advertisements-efb787a9
1•victor106•8m ago•0 comments

Topcoat is pushing the boundary of server applications with Rust

https://tokio.rs/blog/2026-09-24-topcoat-server-applications
1•carllerche•9m ago•0 comments

Global Chat

https://global-chat.jojoban842.workers.dev/
1•theredpainter•9m ago•0 comments

Show HN: Offline recorder and transcriber on your MacBook's notch

https://memorynotch.app/
4•choyiny•10m ago•0 comments

Dailies: Daily games with friends and family, in your texts

https://www.dailies.world/
1•dvdhutch•11m ago•1 comments

Quanta's Thomas Lin Trusts the Public Can Handle Complex Ideas

https://www.insidehighered.com/opinion/columns/public-scholar/2026/09/08/quantas-thomas-lin-trust...
2•digital55•12m ago•0 comments

Sourcehut account takeover via build logs (XSS in ansi2html)

https://blog.arusekk.pl/posts/srht-account-takeover/
3•arusekk•17m ago•0 comments

A new data layer for robot learning

https://rerun.io/blog/data-layer-for-robot-learning
1•intrepidsoldier•18m ago•0 comments

How to stay smart in the age of AI: the science of critical thinking

https://www.nature.com/articles/d41586-026-02930-6
3•digital55•18m ago•0 comments

Why AI companies don't need new laws

https://twitter.com/Paul__Walsh/status/2102801667657748720
2•MrBuddyCasino•19m ago•0 comments

Alexandr Wang Is Meta's Not-So-Secret Weapon in the AI Agent Promo War

https://www.businessinsider.com/alexandr-wang-meta-muse-social-media-posts-pr-strategy-2026-9
2•Anon84•20m ago•0 comments

Tech leaders to UN: For sake of humanity, please control the AI tech we created

https://apnews.com/article/ai-artificial-intelligence-un-security-council-64519ea66b38e2600026f44...
4•ChrisArchitect•23m ago•2 comments

Anwar Gargash: Caught in the Middle of the Iran War, Foreign Affairs [video]

https://www.youtube.com/watch?v=zd4kPmPGgDk
1•verdverm•23m ago•0 comments

Show HN: XYVEL Trip – plan a trip in one sentence, with prices

https://xyvel.ch/en/trip
1•gladia92soussa•25m ago•0 comments

August 27 TCRF DDoS Attack Postmortem

https://blog.xkeeper.net/the-cutting-room-floor/tcrf-2026-ddos-postmortem/
2•panic•25m ago•0 comments

Embracing Dark Mode: A User's Perspective on Accessibility

https://blog.master.dev/dark-mode-very-much-matters-to-me/
1•ibobev•25m ago•0 comments

Opus 5.5 refuses basic molecular biology questions

https://bede.im/2026/09/24/open-models-biology.html
2•bede•27m ago•1 comments

Steppy Fox – Free Game

https://steppyfox.com/
1•fadilbeg•27m ago•1 comments

Tiny-Vedas: RISC-V Infrastructure for AI Accelerator Design [pdf]

https://siliscale.com/papers/tiny-vedas.pdf
1•marcux95•27m ago•0 comments

Eli's Software Encyclopedia

https://elisoftware.org/wiki/Main_Page
1•baal80spam•28m ago•0 comments

Any nerds out there who've read a lot of research papers?

3•shriy-singh•28m ago•1 comments

GizmoSQL changes the unit economics for AI analyst companies

https://emms21.github.io/gizmosql-followup/
1•emms21•33m ago•1 comments