]> granicus.if.org Git - gc/commitdiff
Register dynamic libraries via dl_iterate_phdr on OpenBSD
authorKurt Miller <kurt@intricatesoftware.com>
Sun, 2 Jun 2013 14:24:36 +0000 (18:24 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 2 Jun 2013 14:24:36 +0000 (18:24 +0400)
* dyn_load.c (HAVE_DL_ITERATE_PHDR): Define for OpenBSD (with release
date 2005.19 or later).

dyn_load.c

index 246195d9b10b49e63fa6725cf5f8abdc48e32f33..5e077b5b61fdb6e56bfd4a801b7aff68202d51fa 100644 (file)
@@ -80,12 +80,19 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0;
 #   define ELFSIZE ARCH_ELFSIZE
 #endif
 
+#if defined(OPENBSD)
+# include <sys/param.h>
+# if OpenBSD >= 200519
+#   define HAVE_DL_ITERATE_PHDR
+# endif
+#endif /* OPENBSD */
+
 #if defined(SCO_ELF) || defined(DGUX) || defined(HURD) \
     || (defined(__ELF__) && (defined(LINUX) || defined(FREEBSD) \
                              || defined(NETBSD) || defined(OPENBSD)))
 # include <stddef.h>
 # if !defined(OPENBSD) && !defined(PLATFORM_ANDROID)
-    /* FIXME: Why we exclude it for OpenBSD? */
+    /* OpenBSD does not have elf.h file; link.h below is sufficient.    */
     /* Exclude Android because linker.h below includes its own version. */
 #   include <elf.h>
 # endif