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 Pneumatic Tube Mail System in New York City

https://www.untappedcities.com/pneumatic-tube-mail-new-york-city/
1•thunderbong•1m ago•0 comments

The 100k Whys of AI

https://lcamtuf.substack.com/p/the-100000-whys-of-ai
1•surprisetalk•1m ago•0 comments

Show HN: Image Tools Hub – A Curated Directory of AI Image Tools

https://imgtoolshub.com
1•jtnt101•4m ago•0 comments

Systemd v261 Released

https://github.com/systemd/systemd/releases/tag/v261
1•zdkaster•4m ago•1 comments

SUV buyers undeterred by warnings of risk to pedestrians

https://www.theguardian.com/world/2026/jun/20/suv-risks-warnings-road-safety-buyers-uk-study
1•lambdaone•5m ago•1 comments

Lo and Behold, Reveries of the Connected World (Werner Herzog) [video]

https://www.youtube.com/watch?v=q3g3hqNJqpQ
1•david_shi•5m ago•0 comments

Proof of AGI is the impossibility of evals

https://thewatershed.markpesce.com/quacks-ergo-duck/
1•mpesce•7m ago•1 comments

Mark-of-the-web and pinning installers to sites

https://blog.randomoracle.io/2026/06/20/mark-of-the-web-and-pinning-installers-to-sites/
1•jandeboevrie•11m ago•0 comments

The videogame market is as big as ever, with PC leading growth [pdf]

https://resources.newzoo.com/hubfs/Newzoo%20-%20GMRF%20Q2%202026%20Analyst%20Update.pdf
1•HelloUsername•16m ago•0 comments

Earthquake gate stopping a San Andreas disaster under highest stress in 1K years

https://www.cnn.com/2026/06/19/weather/san-andreas-fault-record-stress-in-1000-years-earthquake-l...
1•mikhael•17m ago•0 comments

OCaml 5.5 Released

https://discuss.ocaml.org/t/ocaml-5-5-0-released/18265
1•azhenley•17m ago•0 comments

FFmpegKit NDK r26c patch and maintained Android fork

https://github.com/ffmpegkit-maintained/ffmpeg-kit
1•FFmpegKit•18m ago•0 comments

How do we prevent Bitrot?

https://notgull.net/bitrot/
1•dmit•21m ago•0 comments

Show HN: Shelve – Native macOS menu bar app that auto-organizes your Downloads

https://github.com/DanielZ1-tech/shelve
1•danielzx1•25m ago•0 comments

Ask HN: Would you let your AI coding agent profile and optimize autonomously?

1•connollystr•25m ago•0 comments

He made your free video player run smoothly. Now he's doing that for robots

https://techcrunch.com/2026/06/19/he-made-your-free-video-player-run-smoothly-now-hes-doing-that-...
1•XzetaU8•26m ago•0 comments

Principles and Practice of Deep Representation Learning [pdf]

https://ma-lab-berkeley.github.io/deep-representation-learning-book/assets/book-main.pdf
2•t_serpico•29m ago•0 comments

The Lost Story of Alan Turing's "Delilah" Project

https://spectrum.ieee.org/alan-turings-delilah
2•asdefghyk•31m ago•1 comments

Explaining Kerberos from A-Z

https://thattotallyrealmyth.gitbook.io/kerberos-explained
1•MeowMeowBinks•32m ago•0 comments

The Midjourney Scanner

https://twitter.com/midjourney/status/2067422898407837797
1•MrBuddyCasino•34m ago•0 comments

Show HN: I made an AI video of alexpotato's comment about his stockbroker dad

https://getartcraft.com/media/m_xtdewkcnz1ghvsnr5st2sted99p2nr
1•sexy_seedbox•35m ago•1 comments

Show HN: FloatDeck, a floating quick-actions menu for Chrome

https://chromewebstore.google.com/detail/floatdeck-floating-button/fanagpncolgnoglmhamngmcnadkffmlo
1•tapdot•38m ago•0 comments

Student Cheating Is Becoming Impossible to Detect in an A.I. Era

https://www.nytimes.com/2026/06/18/us/ai-apps-students-cheat.html
6•thm•49m ago•3 comments

Effective Use-Cases for LLMs

https://aggressivelyparaphrasing.me/2026/06/21/effective-use-cases-for-llms/
2•tcbrah•51m ago•0 comments

What are your Favorite Lobste.rs Comments?

https://lobste.rs/s/crl4fj/what_are_your_favorite_lobste_rs_comments
2•Curiositry•52m ago•0 comments

The terrifying world of the 'TikTok Farlands'

https://www.bbc.com/future/article/20260618-the-terrifying-world-of-the-tiktok-farlands
2•saikatsg•53m ago•0 comments

Warsh brings a skinny Fed approach to a complex, information-hungry world

https://www.reuters.com/business/warsh-brings-skinny-fed-approach-complex-information-hungry-worl...
3•kaycebasques•53m ago•0 comments

Public Service Announcement: Don't Say You Use AI for Writing

https://www.satisfice.com/blog/archives/488148
2•satisfice•56m ago•0 comments

Polymarket Paid Dozens to Post Videos of Themselves 'Winning' with Fake Bets

https://m.slashdot.org/story/455718
8•ilreb•1h ago•2 comments

Is anyone still using Emacs?

https://blogsystem5.substack.com/p/is-anyone-still-using-emacs
4•signa11•1h ago•1 comments