summaryrefslogtreecommitdiff
path: root/dyn_load.c
diff options
context:
space:
mode:
Diffstat (limited to 'dyn_load.c')
-rw-r--r--dyn_load.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/dyn_load.c b/dyn_load.c
index 5db3503a..963f6e95 100644
--- a/dyn_load.c
+++ b/dyn_load.c
@@ -59,7 +59,7 @@
!(defined(FREEBSD) && defined(__ELF__)) && \
!(defined(OPENBSD) && (defined(__ELF__) || defined(M68K))) && \
!(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) && \
- !defined(DARWIN)
+ !defined(DARWIN) && !defined(HAIKU)
--> We only know how to find data segments of dynamic libraries for the
--> above. Additional SVR4 variants might not be too
--> hard to add.
@@ -1258,6 +1258,23 @@ GC_bool GC_register_main_static_data()
#endif /* DARWIN */
+#if defined(HAIKU)
+
+#include <kernel/image.h>
+
+void GC_register_dynamic_libraries()
+{
+ image_info info;
+ int32 cookie = 0;
+ while (get_next_image_info(0, &cookie, &info) == B_OK)
+ {
+ void *data = info.data;
+ GC_add_roots_inner(data, data + info.data_size, TRUE);
+ }
+}
+
+#endif /* HAIKU */
+
#else /* !DYNAMIC_LOADING */
#ifdef PCR