2009-09-03 Hans Boehm <Hans.Boehm@hp.com> (really Loren J. Rittle)
authorhboehm <hboehm>
Thu, 3 Sep 2009 17:52:22 +0000 (17:52 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:46 +0000 (21:06 +0400)
* dyn_load.c (HAVE_DL_ITERATE_PHDR): Break definition from use.
Define for FreeBSD 7.0+.

ChangeLog
dyn_load.c

index 07cf19f3b6de7e6d24127047aa8c459554b2af8a..091408d75cb5361e2b412028e6c1911c7d1cbb51 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-03  Hans Boehm <Hans.Boehm@hp.com> (really Loren J. Rittle)
+
+       * dyn_load.c (HAVE_DL_ITERATE_PHDR): Break definition from use.
+       Define for FreeBSD 7.0+.
+       
 2009-09-02  Hans Boehm <Hans.Boehm@hp.com> (with help from Victor Ivrii and
                                            others)     
 
index f84311d6830b1332ef59dc54a87dbefd811a8612..b46ba0401e644c82a4dc55e2b169972ce9b4facc 100644 (file)
@@ -374,6 +374,20 @@ GC_bool GC_register_main_static_data(void)
 # if (defined(LINUX) || defined (__GLIBC__)) /* Are others OK here, too? */ \
      && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
          || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) 
+/* We have the header files for a glibc that includes dl_iterate_phdr. */
+/* It may still not be available in the library on the target system.   */
+/* Thus we also treat it as a weak symbol.                             */
+#define HAVE_DL_ITERATE_PHDR
+#pragma weak dl_iterate_phdr
+#endif
+
+# if (defined(FREEBSD) && __FreeBSD__ >= 7)
+/* On the FreeBSD system, any target system at major version 7 shall    */
+/* have dl_iterate_phdr; therefore, we need not make it weak as above.  */
+#define HAVE_DL_ITERATE_PHDR
+#endif
+
+#if defined(HAVE_DL_ITERATE_PHDR)
 
 # ifdef PT_GNU_RELRO
 
@@ -399,11 +413,6 @@ static int n_load_segs;
 
 # endif /* PT_GNU_RELRO */
 
-/* We have the header files for a glibc that includes dl_iterate_phdr. */
-/* It may still not be available in the library on the target system.   */
-/* Thus we also treat it as a weak symbol.                             */
-#define HAVE_DL_ITERATE_PHDR
-
 /* A user-supplied routine that is called to determine if a DSO must
    be scanned by the gc.  */
 static int (GC_CALLBACK * GC_has_static_roots)(const char *, void *, size_t);
@@ -489,8 +498,6 @@ static int GC_register_dynlib_callback(info, size, ptr)
 
 /* Return TRUE if we succeed, FALSE if dl_iterate_phdr wasn't there. */
 
-#pragma weak dl_iterate_phdr
-
 GC_bool GC_register_dynamic_libraries_dl_iterate_phdr(void)
 {
   if (dl_iterate_phdr) {