changeset 11978:ed6386375068

8080538: hprof does not work well with multiple agents on non-Solaris platforms Summary: Never take the address of Agent_OnLoad. Reviewed-by: sla, martin
author jmanson
date Mon, 18 May 2015 13:34:56 -0700
parents f717a1d287b0
children c9ffd40e80b9
files src/jdk.hprof.agent/unix/native/libhprof/hprof_md.c
diffstat 1 files changed, 1 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.hprof.agent/unix/native/libhprof/hprof_md.c	Mon May 18 19:26:48 2015 +0300
+++ b/src/jdk.hprof.agent/unix/native/libhprof/hprof_md.c	Mon May 18 13:34:56 2015 -0700
@@ -290,19 +290,7 @@
     Dl_info dlinfo;
 
     libdir[0] = 0;
-#if defined(LINUX) || defined(_ALLBSD_SOURCE) || defined(AIX)
-    addr = (void*)&Agent_OnLoad;
-#else
-    /* Just using &Agent_OnLoad will get the first external symbol with
-     *   this name in the first .so, which may not be libhprof.so.
-     *   On Solaris we can actually ask for the address of our Agent_OnLoad.
-     */
-    addr = dlsym(RTLD_SELF, "Agent_OnLoad");
-    /* Just in case the above didn't work (missing linker patch?). */
-    if ( addr == NULL ) {
-        addr = (void*)&Agent_OnLoad;
-    }
-#endif
+    addr = (void*)&md_get_prelude_path;
 
     /* Use dladdr() to get the full path to libhprof.so, which we use to find
      *  the prelude file.