aboutsummaryrefslogtreecommitdiff
path: root/libjava/boehm.cc
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2006-05-01 16:28:42 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2006-05-01 16:28:42 +0000
commitf0913ab8d6b3990d68fc498fd2f9d6407fd10536 (patch)
tree7c0899b1a6808cf8991f60413da35668ed2c6eee /libjava/boehm.cc
parentea6431202d7e3c472f6c039bbfc0c22f2e8e9a52 (diff)
downloadgcc-f0913ab8d6b3990d68fc498fd2f9d6407fd10536.zip
gcc-f0913ab8d6b3990d68fc498fd2f9d6407fd10536.tar.gz
gcc-f0913ab8d6b3990d68fc498fd2f9d6407fd10536.tar.bz2
boehm.cc (_Jv_InitGC): Check both HAVE_DLFCN_H and HAVE_DLADDR before calling...
* 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. Co-Authored-By: Andrew Haley <aph@redhat.com> From-SVN: r113417
Diffstat (limited to 'libjava/boehm.cc')
-rw-r--r--libjava/boehm.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/libjava/boehm.cc b/libjava/boehm.cc
index d939f41..a6f7fdf 100644
--- a/libjava/boehm.cc
+++ b/libjava/boehm.cc
@@ -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)
-#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)