aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc/dyn_load.c
diff options
context:
space:
mode:
Diffstat (limited to 'boehm-gc/dyn_load.c')
-rw-r--r--boehm-gc/dyn_load.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/boehm-gc/dyn_load.c b/boehm-gc/dyn_load.c
index 4f4ef51..508fd24 100644
--- a/boehm-gc/dyn_load.c
+++ b/boehm-gc/dyn_load.c
@@ -53,7 +53,7 @@
!(defined(ALPHA) && defined(OSF1)) && \
!defined(HPUX) && !(defined(LINUX) && defined(__ELF__)) && \
!defined(RS6000) && !defined(SCO_ELF) && \
- !(defined(NETBSD) && defined(__ELF__))
+ !(defined(NETBSD) && defined(__ELF__)) && !defined(HURD)
--> We only know how to find data segments of dynamic libraries for the
--> above. Additional SVR4 variants might not be too
--> hard to add.
@@ -243,7 +243,7 @@ void GC_register_dynamic_libraries()
# endif /* SUNOS */
#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
- (defined(NETBSD) && defined(__ELF__))
+ (defined(NETBSD) && defined(__ELF__)) || defined(HURD)
#ifdef USE_PROC_FOR_LIBRARIES
@@ -514,6 +514,10 @@ void GC_register_dynamic_libraries()
#include <fcntl.h>
#include <elf.h>
#include <errno.h>
+#include <signal.h> /* Only for the following test. */
+#ifndef _sigargs
+# define IRIX6
+#endif
extern void * GC_roots_present();
/* The type is a lie, since the real type doesn't make sense here, */
@@ -574,7 +578,8 @@ void GC_register_dynamic_libraries()
if ((flags & (MA_BREAK | MA_STACK | MA_PHYS)) != 0) goto irrelevant;
if ((flags & (MA_READ | MA_WRITE)) != (MA_READ | MA_WRITE))
goto irrelevant;
- /* The latter test is empirically useless. Other than the */
+ /* The latter test is empirically useless in very old Irix */
+ /* versions. Other than the */
/* main data and stack segments, everything appears to be */
/* mapped readable, writable, executable, and shared(!!). */
/* This makes no sense to me. - HB */
@@ -587,7 +592,11 @@ void GC_register_dynamic_libraries()
# endif /* MMAP_STACKS */
limit = start + addr_map[i].pr_size;
- if (addr_map[i].pr_off == 0 && strncmp(start, ELFMAG, 4) == 0) {
+ /* The following seemed to be necessary for very old versions */
+ /* of Irix, but it has been reported to discard relevant */
+ /* segments under Irix 6.5. */
+# ifndef IRIX6
+ if (addr_map[i].pr_off == 0 && strncmp(start, ELFMAG, 4) == 0) {
/* Discard text segments, i.e. 0-offset mappings against */
/* executable files which appear to have ELF headers. */
caddr_t arg;
@@ -614,7 +623,8 @@ void GC_register_dynamic_libraries()
goto irrelevant;
}
}
- }
+ }
+# endif /* !IRIX6 */
GC_add_roots_inner(start, limit, TRUE);
irrelevant: ;
}