http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38307
--- Comment #6 from rfm at gnu dot org 2011-03-17 06:20:42 UTC --- I spent some hours looking at your code and I like it ... it's certainly clearer than mine. I found three problems which i've fixed on my system: 1. failure to check CLS_ISRESOLV early enough (I added a check at the very start of __objc_install_dtable_for_class, 2. I needed to add a check immediately after installing the dispatch table of the superclass ... in case the +initialize in the superclass had actually initialized the subclass too. In this case we need to return immediately from __objc_install_dtable_for_class rather than trying to install the table again. 3. The +initialize method of class can cause changes to the methods of the class, so the prepared dispatch table can need to be replaced during the executing of +initialize. I added changes for that. I've been working on an old copy of libobjc ... once I can get your patch plus my modifications workng with svn trunk, I'll post a patch against the current runtime code.