OSDN Git Service

* boehm.cc (_Jv_InitGC): Check both HAVE_DLFCN_H and HAVE_DLADDR
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 May 2006 16:28:42 +0000 (16:28 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 May 2006 16:28:42 +0000 (16:28 +0000)
before calling GC_register_has_static_roots_callback.
(_Jv_RegisterLibForGc): Likewise, test for both HAVE_DLFCN_H and
HAVE_DLADDR before calling dladdr.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113417 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/boehm.cc

index ce5d6a4..61d096a 100644 (file)
@@ -1,3 +1,11 @@
+2006-05-01  Roger Sayle  <roger@eyesopen.com>
+           Andrew Haley  <aph@redhat.com>
+
+       * boehm.cc (_Jv_InitGC): Check both HAVE_DLFCN_H and HAVE_DLADDR
+       before calling GC_register_has_static_roots_callback.
+       (_Jv_RegisterLibForGc): Likewise, test for both HAVE_DLFCN_H and
+       HAVE_DLADDR before calling dladdr.
+
 2006-04-28  Bryce McKinlay  <mckinlay@redhat.com>
 
        * link.cc (_Jv_Linker::resolve_pool_entry): Don't pass vtable_index
index d939f41..a6f7fdf 100644 (file)
@@ -486,7 +486,7 @@ _Jv_InitGC (void)
   // Ignore pointers that do not point to the start of an object.
   GC_all_interior_pointers = 0;
 
-#ifdef HAVE_DLFCN_H
+#if defined (HAVE_DLFCN_H) && defined (HAVE_DLADDR)
   // Tell the collector to ask us before scanning DSOs.
   GC_register_has_static_roots_callback (_Jv_GC_has_static_roots);
 #endif
@@ -581,7 +581,7 @@ _Jv_GCCanReclaimSoftReference (jobject)
 
 \f
 
-#ifdef HAVE_DLFCN_H
+#if defined (HAVE_DLFCN_H) && defined (HAVE_DLADDR)
 
 // We keep a store of the filenames of DSOs that need to be
 // conservatively scanned by the garbage collector.  During collection
@@ -661,7 +661,7 @@ _Jv_GC_has_static_roots (const char *filename, void *, size_t)
 void
 _Jv_RegisterLibForGc (const void *p __attribute__ ((__unused__)))
 {
-#ifdef HAVE_DLFCN_H
+#if defined (HAVE_DLFCN_H) && defined (HAVE_DLADDR)
   Dl_info info;
 
   if (dladdr (const_cast<void *>(p), &info) != 0)