On 2018-06-04 8:13 AM, Damyan Ivanov wrote:
Another way would be to change src/common/os/posix/mod_loader.cpp
around line 120 to dump sought symbol names to stderr and compare that
to the actual symbol name.
I finally got time to look at this problem. The above suggestion was an
excellent clue.
The problem is dlsym returns a function pointer on hppa when passed the
name of a
function symbol. It points at a function descriptor for the function
when the plabel bit
is set in the pointer. The descriptor has an entry which points at the
function after it
has been bound. Otherwise, it points at trampoline code to fix up the
descriptor.
In any case, dladdr doesn't do the expected thing when passed a function
pointer. It
needs the actual address of the function.
The attached patch fixes the build on hppa-linux. Another option would
be to adjust
the configure check.
Thanks,
Dave
--
John David Anglin [email protected]
--- ./src/common/os/posix/mod_loader.cpp.save 2018-02-02 06:00:35.000000000
-0500
+++ ./src/common/os/posix/mod_loader.cpp 2018-07-07 18:13:19.976129060
-0400
@@ -125,7 +125,7 @@
result = dlsym(module, newSym.c_str());
}
-#ifdef HAVE_DLADDR
+#if defined(HAVE_DLADDR) && !defined(__hppa__)
if (!PathUtils::isRelative(fileName))
{
Dl_info info;