frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•7mo 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•7mo 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•7mo 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).

How to Avoid IaC Drift

https://newsletter.masterpoint.io/p/how-to-avoid-iac-drift
1•mooreds•3m ago•0 comments

Show HN: A Grafana you can share with anyone

https://github.com/towlabs/dashfrog
1•mehdig10•3m ago•0 comments

GitHub in 2025

https://redmonk.com/sogrady/2025/11/07/github-2025/
1•mooreds•4m ago•0 comments

Stronger Normalization-Free Transformers

https://arxiv.org/abs/2512.10938
1•mfiguiere•4m ago•0 comments

Interpreters everywhere! – Lindsey Kuper [video]

https://www.youtube.com/watch?v=q8398PMcuTc
1•matt_d•6m ago•0 comments

Figr

https://docs.figr.design
1•handfuloflight•6m ago•0 comments

Show HN: DoD CAC Authentication with Cloudflare Workers

https://github.com/willswire/dod-cac-auth-cloudflare-workers
1•willswire•13m ago•0 comments

The Power of Creative Destruction – Philippe Aghion Nobel Laureate Lecture Notes

https://liza.io/the-power-of-creative-destruction-philippe-aghion-nobel-laureate-lecture-notes/
1•drakonka•14m ago•0 comments

African athlete lured to Russia for work, ends up on front lines of Ukraine war

https://www.abc.net.au/news/2025-12-14/athlete-says-russia-lured-him-for-work-then-sent-him-to-wa...
3•testrun•15m ago•0 comments

Recovering Anthony Bourdain's (really) lost Li.st's

https://sandyuraz.com/blogs/bourdain/
2•thecsw•15m ago•1 comments

Mental Shortcuts and Sensible Defaults

https://rojoroboto.com/newsletter/weekly-reflection-002
1•mooreds•22m ago•0 comments

The Era of Visual Studio Code (2020)

https://blog.robenkleene.com/2020/09/21/the-era-of-visual-studio-code/
2•handfuloflight•25m ago•1 comments

Workday project at Washington University hits $266M

https://www.theregister.com/2025/12/12/washington_university_workday_costs_revealed/
15•sebastian_z•34m ago•4 comments

Myna v2.0: contextual variants, more weights (and even supports APL)

https://github.com/sayyadirfanali/Myna/releases/tag/v2.0.0
2•todsacerdoti•36m ago•0 comments

Safari 26.2 Release Notes

https://developer.apple.com/documentation/safari-release-notes/safari-26_2-release-notes
1•ksec•37m ago•0 comments

Chrome Extension Manager

https://chromewebstore.google.com/detail/extension-manager-extensi/jafcieombbedhpdkjlhcggagepcgaihp
1•kaporalix•37m ago•1 comments

China's trade surplus tops record US$1T, defying trade war uncertainty

https://www.scmp.com/economy/economic-indicators/article/3335551/chinas-exports-rebound-november-...
5•ksec•38m ago•0 comments

Purdue University Approves New AI Requirement for All Undergrads

https://www.forbes.com/sites/michaeltnietzel/2025/12/13/purdue-university-approves-new-ai-require...
7•rmason•39m ago•3 comments

The rise and fall of Subway: The $11 billion empire that crumbled

https://www.youtube.com/watch?v=LeF6DG7xfpA
1•paulpauper•40m ago•0 comments

Human Agency: Protect your documents with hidden Anti AI directives

https://www.human-agency.xyz/
1•merinid•40m ago•1 comments

Sovereignty by Disruption: The Rise of Corporate Quasi-States

https://www.vinniefalco.com/p/synthetic-agency-displacement-disorder
2•hakilebara•40m ago•1 comments

PaperTrails: Your Personal Research Library

https://www.papertrailshq.com/
1•mhb•42m ago•1 comments

Ancient lake that vanished 100k years ago returns to California

https://www.dailymail.co.uk/sciencetech/article-15380617/lake-vanished-RETURNS-California-record-...
2•Bender•45m ago•0 comments

Want to sway an election? Here’s how much fake online accounts cost

https://www.science.org/content/article/want-sway-election-here-s-how-much-fake-online-accounts-cost
30•rbanffy•45m ago•2 comments

Reproducibility Test-Time Training on Nearest Neighbors for LLMs

https://arxiv.org/abs/2511.16691
1•PaulHoule•51m ago•0 comments

Australian teens were kicked off social media this week. Some are back already

https://www.cnn.com/2025/12/12/australia/australia-social-media-kids-intl-hnk-dst
4•Bender•53m ago•0 comments

RAMageddon is finally coming for your smartphones and laptops

https://www.tomsguide.com/computing/laptops/worsening-ram-crisis-starting-to-impact-smartphones-a...
4•elorant•54m ago•0 comments

More atmospheric rivers coming for flooded Washington and the West Coast

https://www.cnn.com/2025/12/12/weather/washington-west-coast-flooding-atmospheric-rivers-climate
2•Bender•55m ago•0 comments

Before You Cite That Study

https://eleganthack.com/before-you-cite-that-study/
2•adrianhoward•55m ago•1 comments

What happens when the coding becomes the least interesting part of the work

https://obie.medium.com/what-happens-when-the-coding-becomes-the-least-interesting-part-of-the-wo...
1•enraged_camel•58m ago•0 comments