summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Cantrill <bryan@joyent.com>2014-10-28 05:19:48 +0000
committerBryan Cantrill <bryan@joyent.com>2014-10-28 05:19:48 +0000
commit2ed0a4ca564eaed362a0372a13944a293168193c (patch)
treea959158a98b90dc25f664bbd0b0fbecd32407ea4
parent95112a55ac4632d0f173f0137fb1cfe68d4f7af0 (diff)
downloadillumos-joyent-2ed0a4ca564eaed362a0372a13944a293168193c.tar.gz
OS-3477 lx brand: mdb(1) doesn't find branded symbols
-rw-r--r--usr/src/cmd/sgs/librtld_db/common/librtld_db.msg2
-rw-r--r--usr/src/cmd/sgs/librtld_db/common/rd_elf.c16
2 files changed, 10 insertions, 8 deletions
diff --git a/usr/src/cmd/sgs/librtld_db/common/librtld_db.msg b/usr/src/cmd/sgs/librtld_db/common/librtld_db.msg
index da9e500783..5b0ad9533a 100644
--- a/usr/src/cmd/sgs/librtld_db/common/librtld_db.msg
+++ b/usr/src/cmd/sgs/librtld_db/common/librtld_db.msg
@@ -107,7 +107,7 @@
state=%d)"
@ MSG_DB_RDOBJPADE "rtld_db: rd_objpad_enable(padsize=0x%llx)"
@ MSG_DB_64BIT_PREFIX "64/"
-@ MSG_DB_BRAND_HELPERPATH_PREFIX "%s/%s/%s/%s/%s%s_librtld_db.so.1"
+@ MSG_DB_BRAND_HELPERPATH_PREFIX "%s/%s/%s/%s%s_librtld_db.so.1"
@ MSG_DB_BRAND_HELPERPATH "%s/%s/%s/%s%s_librtld_db.so.1"
@ MSG_DB_HELPERNOOPS "rtld_db: helper lib loaded but ops not preset"
@ MSG_DB_HELPERLOADED "rtld_db: helper library loaded for brand \"%s\""
diff --git a/usr/src/cmd/sgs/librtld_db/common/rd_elf.c b/usr/src/cmd/sgs/librtld_db/common/rd_elf.c
index c68d9f8fb4..b3de685b81 100644
--- a/usr/src/cmd/sgs/librtld_db/common/rd_elf.c
+++ b/usr/src/cmd/sgs/librtld_db/common/rd_elf.c
@@ -303,26 +303,28 @@ _rd_reset32(struct rd_agent *rap)
while ((ps_pbrandname != NULL) &&
(ps_pbrandname(php, brandname, MAXPATHLEN) == PS_OK)) {
const char *isa = "";
- const char *nroot = zone_get_nroot();
#ifdef _LP64
isa = MSG_ORIG(MSG_DB_64BIT_PREFIX);
#endif /* _LP64 */
- if (nroot == NULL)
- nroot = "";
-
- if (rtld_db_helper_path[0] != '\0')
+ if (rtld_db_helper_path[0] != '\0') {
(void) snprintf(brandlib, MAXPATHLEN,
MSG_ORIG(MSG_DB_BRAND_HELPERPATH_PREFIX),
- nroot, rtld_db_helper_path,
+ rtld_db_helper_path,
MSG_ORIG(MSG_DB_HELPER_PREFIX), brandname, isa,
brandname);
- else
+ } else {
+ const char *nroot = zone_get_nroot();
+
+ if (nroot == NULL)
+ nroot = "";
+
(void) snprintf(brandlib, MAXPATHLEN,
MSG_ORIG(MSG_DB_BRAND_HELPERPATH), nroot,
MSG_ORIG(MSG_DB_HELPER_PREFIX), brandname, isa,
brandname);
+ }
rap->rd_helper.rh_dlhandle = dlopen(brandlib,
RTLD_LAZY | RTLD_LOCAL);