aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-05-08 18:13:33 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-05-08 18:13:33 -0400
commitd8a55d096037ca3ed16b81d1caaff4b2b1623777 (patch)
tree74f01f414f5c161c6b80c9478e8a8333e484aa41
parent1125706fe491a34a72905b8ec38dc810e0c52d6f (diff)
downloadgcc-d8a55d096037ca3ed16b81d1caaff4b2b1623777.zip
gcc-d8a55d096037ca3ed16b81d1caaff4b2b1623777.tar.gz
gcc-d8a55d096037ca3ed16b81d1caaff4b2b1623777.tar.bz2
(_objc_load_callback): Add declaration.
(__objc_exec_class): Call _objc_load_callback after every Class or Category is added. From-SVN: r9592
-rw-r--r--gcc/objc/init.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/objc/init.c b/gcc/objc/init.c
index 52efeb0..eb0e288 100644
--- a/gcc/objc/init.c
+++ b/gcc/objc/init.c
@@ -48,6 +48,12 @@ static void __objc_init_protocols (struct objc_protocol_list* protos);
/* Add protocol to class */
static void __objc_class_add_protocols (Class, struct objc_protocol_list*);
+/* This is a hook which is called by __objc_exec_class every time a class
+ or a category is loaded into the runtime. This may e.g. help a
+ dynamic loader determine the classes that have been loaded when
+ an object file is dynamically linked in */
+void (*_objc_load_callback)(Class class, Category* category) = 0;
+
/* Is all categories/classes resolved? */
BOOL __objc_dangling_categories = NO;
@@ -190,6 +196,9 @@ __objc_exec_class (Module_t module)
if (class->protocols)
__objc_init_protocols (class->protocols);
+
+ if (_objc_load_callback)
+ _objc_load_callback(class, 0);
}
/* Process category information from the module. */
@@ -221,6 +230,8 @@ __objc_exec_class (Module_t module)
__objc_class_add_protocols (class, category->protocols);
}
+ if (_objc_load_callback)
+ _objc_load_callback(class, category);
}
else
{
@@ -264,6 +275,8 @@ __objc_exec_class (Module_t module)
__objc_class_add_protocols (class, category->protocols);
}
+ if (_objc_load_callback)
+ _objc_load_callback(class, category);
}
}