summaryrefslogtreecommitdiffstats
path: root/libobjc
diff options
context:
space:
mode:
authornicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-19 17:30:30 +0000
committernicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-19 17:30:30 +0000
commit57a78cded172c8258b127f703895b55130196e5d (patch)
tree8a729455584511e4fded7e7339114081d64658f4 /libobjc
parentcda9747032e53ddaae08b325e03e19ded9b5093c (diff)
downloadppe42-gcc-57a78cded172c8258b127f703895b55130196e5d.tar.gz
ppe42-gcc-57a78cded172c8258b127f703895b55130196e5d.zip
In libobjc/:
2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com> * init.c (__objc_exec_class): Call __objc_resolve_class_links (), if appropriate, after loading the module. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168065 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libobjc')
-rw-r--r--libobjc/ChangeLog5
-rw-r--r--libobjc/init.c14
2 files changed, 14 insertions, 5 deletions
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog
index 837d24147a2..11c97ff2543 100644
--- a/libobjc/ChangeLog
+++ b/libobjc/ChangeLog
@@ -1,5 +1,10 @@
2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
+ * init.c (__objc_exec_class): Call __objc_resolve_class_links (),
+ if appropriate, after loading the module.
+
+2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
+
* sendmsg.c (method_setImplementation): Do not declare.
2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
diff --git a/libobjc/init.c b/libobjc/init.c
index a282d5ef70d..f1eb83ab1d2 100644
--- a/libobjc/init.c
+++ b/libobjc/init.c
@@ -31,7 +31,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "objc-private/hash.h"
#include "objc-private/objc-list.h"
#include "objc-private/module-abi-8.h"
-#include "objc-private/runtime.h"
+#include "objc-private/runtime.h" /* For __objc_resolve_class_links(). */
#include "objc-private/selector.h" /* For __sel_register_typed_name(). */
#include "objc-private/objc-sync.h" /* For __objc_sync_init() */
#include "objc-private/protocols.h" /* For __objc_protocols_init(),
@@ -719,11 +719,15 @@ __objc_exec_class (struct objc_module *module)
objc_send_load ();
- objc_mutex_unlock (__objc_runtime_mutex);
+ /* Check if there are no unresolved classes (ie, classes whose
+ superclass has not been loaded yet) and that the 'Object' class,
+ used as the class of classes, exist. If so, it is worth
+ "resolving the class links" at this point, which will setup all
+ the class/superclass pointers. */
+ if (!unresolved_classes && objc_getClass ("Object"))
+ __objc_resolve_class_links ();
- /* TODO: Do we need to add a call to __objc_resolve_class_links()
- here ? gnustep-base does it manually after it loads a module.
- Shouldn't we do it automatically ? */
+ objc_mutex_unlock (__objc_runtime_mutex);
}
static void
OpenPOWER on IntegriCloud