hotspot/src/os/bsd/vm/os_bsd.cpp
changeset 22528 bd3821442010
parent 21213 6290e790c312
child 22533 76088853a2eb
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Thu Jan 23 08:12:12 2014 +0100
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Thu Jan 23 09:06:21 2014 +0100
@@ -1557,6 +1557,17 @@
 }
 #endif /* !__APPLE__ */
 
+void* os::get_default_process_handle() {
+#ifdef __APPLE__
+  // MacOS X needs to use RTLD_FIRST instead of RTLD_LAZY
+  // to avoid finding unexpected symbols on second (or later)
+  // loads of a library.
+  return (void*)::dlopen(NULL, RTLD_FIRST);
+#else
+  return (void*)::dlopen(NULL, RTLD_LAZY);
+#endif
+}
+
 // XXX: Do we need a lock around this as per Linux?
 void* os::dll_lookup(void* handle, const char* name) {
   return dlsym(handle, name);