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

Fast Linux bootstrapping by Frans Faase – HackFest 2026 [video]

https://www.youtube.com/watch?v=lPIF_nfqM_g&list=PLE9uuQqRXw6w&index=4
1•lioeters•45s ago•0 comments

2TI LMailer – Native Linux email and groupware (Rust, Tauri v2, local Ollama)

https://2tinteractive.com/apps/lmailer/
1•LebToki•1m ago•0 comments

Glimpse: Visual thinking that stays grounded

https://elorian.ai/blog/introducing-glimpse
1•tibbar•2m ago•0 comments

What We Learned Building a Chatbot for La Silla Vacía's Newsroom Archive

https://gijn.org/stories/building-chatbot-la-silla-vacia-newsroom-archive/
1•runningmike•6m ago•0 comments

Roboto 01: Full-stack Open-source humanoid robot

https://roboparty.com/products/RP1
1•num42•7m ago•2 comments

Scientists Detect Rare Type of Wood Alcohol in Space

https://www.universetoday.com/articles/scientists-detect-rare-type-of-wood-alcohol-in-space
1•runningmike•8m ago•0 comments

How to Run Untrusted Python Code Without Getting Hacked

https://nocomplexity.com/python_security_cheatsheet/
1•runningmike•12m ago•0 comments

EU negotiates sanctions swap with China to rescue critical ASML supplier

https://www.tomshardware.com/tech-industry/semiconductors/eu-negotiates-sanction-swap-with-china-...
2•anigbrowl•16m ago•0 comments

Decomp.dev Shuts Down Because AI Has Made It Too Easy to Decompile Games

https://www.404media.co/video-game-reverse-engineering-community-shuts-down-because-ai-has-made-i...
2•dmitrygr•22m ago•0 comments

What We Talk to When We Talk to Language Models (David J. Chalmers) [pdf]

https://philpapers.org/archive/CHAWWT-8.pdf
1•networked•25m ago•0 comments

Show HN: Calcy – unit-aware, uncertainty-propagating math

https://habitathq.github.io/calcy/
2•themantri•25m ago•0 comments

What has happened to Clipper2 development?

https://github.com/AngusJohnson/Clipper2/discussions/1118
1•abetusk•26m ago•0 comments

Show HN: I built a free collection of browser-based 3D tools

https://3dvalley.com
2•lucak5s•37m ago•0 comments

The Case Against Canadian Nuclear Weapons

https://ras-nsa.ca/en/the-case-against-canadian-nuclear-weapons/
1•JumpCrisscross•40m ago•0 comments

Rival Radar

https://rivalradar.me
1•pork1977•45m ago•0 comments

Why Math Dumped OpenAI

https://raymyers.org/post/math-dumped-openai/
3•xeonmc•46m ago•0 comments

OpenAI outperforms Chinese models in cost per task

https://nikvdp.com/notes/cost-per-task-is-the-number-to-watch/
1•crazyphoton•48m ago•0 comments

Fired Georgia officer gave Flock surveillance camera access to ICE agent husband

https://www.wbrc.com/2026/10/16/police-officer-fired-sharing-flock-login-with-husband-who-works-ice/
2•chirau•53m ago•0 comments

'I'm Not Going to Have Blood on My Hands'

https://www.cjr.org/the-interview/nicole-noren-espn-producer-quit-protest-sports-betting-gambling...
1•Michelangelo11•53m ago•0 comments

Dha Best

http://kitchencooking.42web.io/
1•agasto•58m ago•0 comments

Ask HN: What is the most useful thing AI has done for you?

3•yitchelle•59m ago•3 comments

Show HN: Cwist; a hobby-grade C17 web framework that keeps your app simple

https://github.com/c4punks/cwist
1•gg582•1h ago•0 comments

Letters with 'suspicious substances' sent to US senators and election offices

https://www.bbc.com/news/articles/cmq8n513x523o
1•geox•1h ago•0 comments

Veda: An Operating System with Soul

https://github.com/vahmoh25/Veda/blob/main/documentation/images/paint.png
1•saeedmh100•1h ago•0 comments

Wernelo – Discover Communities, Creators and Projects

https://www.wernelo.com
1•koleemendov•1h ago•0 comments

Ukraine's data centre strikes have thrown Russia into turmoil

https://www.ft.com/content/dc21da0b-25b7-402e-8dbe-e7d9f7431b93
2•uxhacker•1h ago•0 comments

How an agentic chat interface can break

https://astralbeam.ai/blog/ten-agentic-chat-interface-failures
2•aakashns•1h ago•0 comments

Dependently Sorted Syntax and its Semantics – Carlo Angiuli [video]

https://www.youtube.com/watch?v=tTZFKkyJEtw
1•matt_d•1h ago•0 comments

Existential Risk from AI: An Exposition for Mathematicians

https://alkjash.github.io/ai-risk/
2•reasonableklout•1h ago•0 comments

The 39 pictures that changed the way we see men (for good and for bad)

https://www.theguardian.com/society/2026/oct/17/39-pictures-that-changed-the-way-we-see-men-for-g...
1•mellosouls•1h ago•0 comments