frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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

With Claude: Less Coding, More Testing

https://henrikwarne.com/2026/05/31/with-claude-less-coding-more-testing/
1•ingve•3m ago•0 comments

The 2026-07-28 MCP Specification Release Candidate

https://blog.modelcontextprotocol.io/posts/2026-07-28-release-candidate/
1•gmays•3m ago•0 comments

In Malaysia, there was the first violent reaction against age verification laws

https://old.reddit.com/r/privacy/comments/1tq9e24/in_malaysia_there_was_a_bomb_threat_incident/
1•mostcallmeyt•6m ago•0 comments

People Getting Falsely Accused of Using AI to Write

https://nymag.com/intelligencer/article/the-people-getting-falsely-accused-of-using-ai-to-write.html
1•ColinWright•9m ago•0 comments

SICP Video Lectures (1986)

https://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/
2•tosh•9m ago•0 comments

Europe versus America: A Response to the Critics

https://paulkrugman.substack.com/p/europe-versus-america-a-response
2•_tk_•12m ago•0 comments

The Impact of AI-Assisted Development on Software Security

https://arxiv.org/abs/2603.15298
1•lucamark•15m ago•1 comments

Dav2d

https://jbkempf.com/blog/2026/dav2d/
2•captain_bender•15m ago•0 comments

The weatherman crucial to D-Day victory

https://www.bbc.com/culture/article/20260528-the-crucial-decision-that-helped-win-d-day
1•mellosouls•19m ago•0 comments

Robots are redefining the war in Ukraine – and forcing Russia onto the back foot

https://www.cnn.com/2026/05/30/europe/ukraine-robots-drones-russia-war-intl
1•rustoo•21m ago•0 comments

Screwing Up

https://www.seangoedecke.com/screwing-up/
2•gfysfm•21m ago•0 comments

Show HN: The Tired Engineer

https://www.thetiredengineer.com/
2•devtanna•22m ago•1 comments

The Despair of the Professor in the Age of A.I

https://www.newyorker.com/news/fault-lines/the-despair-of-the-professor-in-the-age-of-ai
1•NewCzech•23m ago•0 comments

Unlocking the Working Memory of Large Language Models for Latent Reasoning

https://arxiv.org/abs/2605.30343
1•korbip•24m ago•0 comments

Servo 0.2 Release

https://github.com/servo/servo/releases/tag/v0.2.0
1•pimeys•28m ago•1 comments

Selling to China's Muslims

https://www.middleeastbriefing.com/news/selling-to-chinas-muslims/
1•teleforce•31m ago•0 comments

Google planning to release 32M mosquitoes across Florida and California

https://twitter.com/BullTheoryio/status/2060810332831129782
1•king_zee•31m ago•1 comments

HeartMuLa – Open-Source Music Generation Model

https://github.com/HeartMuLa/heartlib
3•modinfo•32m ago•0 comments

Curated list of AI apps for visual creation

https://gist.github.com/seinecle/689a53bceca96147a04e93bdc5f83940
2•seinecle•32m ago•0 comments

James Webb spots the most chemically primitive galaxy in the ancient universe

https://www.universetoday.com/articles/astronomers-observe-the-most-chemically-primitive-galaxy-i...
1•flaburgan•33m ago•0 comments

Scenarios That Will Not Happen

https://radekmie.dev/blog/on-scenarios-that-will-not-happen/
1•birdculture•34m ago•0 comments

Japan's 2025 census reflects steepest fall in population on record, data shows

https://www.japantimes.co.jp/news/2026/05/29/japan/japan-population-largest-decline/
3•Teever•35m ago•0 comments

(An ((Even Better) Lisp) Interpreter (In Python))

http://norvig.com/lispy2.html
1•vismit2000•43m ago•0 comments

Australia to buy three second-hand United States submarines under AUKUS shake-up

https://www.abc.net.au/news/2026-05-31/australia-to-buy-second-hand-united-states-submarines-auku...
2•Teever•45m ago•0 comments

AI Agent that at inference time updates it's harness and model weights

https://github.com/hexo-ai/sia
4•martianvoid•46m ago•0 comments

The complexity of songs – Knuth (1984)

https://dl.acm.org/doi/pdf/10.1145/358027.358042
1•__patchbit__•46m ago•0 comments

Jonathan Daly's fav books about individuals who changed the way we see the world

https://bookdna.com/best-books/individuals-who-followed-their-muse-and-changed-th
1•bwb•51m ago•1 comments

Show HN: Free cloud-based tool for managing AI agents across multiple hosts

https://nodecartel.com/
3•itrinity•51m ago•0 comments

Telnet Song – Guy L Steele, Jr

http://wonderingminstrels.blogspot.com/2004/01/telnet-song-guy-l-steele-jr.html
2•__patchbit__•53m ago•0 comments

Mark Warren's favorite novels about a child's immersion into wilderness

https://bookdna.com/best-books/childs-immersion-into-wilderness
1•bwb•53m ago•1 comments