aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/lib
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2020-05-21 22:24:23 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2020-05-21 22:24:23 +0000
commitd0ca9a7fe4450aaa19ad281a9cef37f413bd9e5c (patch)
tree3157709def91a36554b53c9e0dcc29a742579887 /cddl/contrib/opensolaris/lib
parente68cde59c392635d615971c61a1fa26abcc66754 (diff)
downloadsrc-d0ca9a7fe4450aaa19ad281a9cef37f413bd9e5c.tar.gz
src-d0ca9a7fe4450aaa19ad281a9cef37f413bd9e5c.zip
Restore the binary compatibility for link_map l_addr.
Keep link_map l_addr binary layout compatible, rename l_addr to l_base where rtld returns map base. Provide relocbase in newly added l_addr. This effectively reverts the patch to the initial version of D24918. Reported by: antoine (portmgr) Reviewed by: jhb, markj Tested by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24946
Notes
Notes: svn path=/head/; revision=361349
Diffstat (limited to 'cddl/contrib/opensolaris/lib')
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/drti.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c b/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
index cd9294998454..836eeccb8274 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
@@ -143,12 +143,18 @@ dtrace_dof_init(void)
return;
}
+#ifdef __FreeBSD__
+ elf = (void *)lmp->l_base;
+#else
elf = (void *)lmp->l_addr;
+#endif
dh.dofhp_dof = (uintptr_t)dof;
- dh.dofhp_addr = elf->e_type == ET_DYN ? (uintptr_t) lmp->l_addr : 0;
#ifdef __FreeBSD__
+ dh.dofhp_addr = elf->e_type == ET_DYN ? (uintptr_t) lmp->l_base : 0;
dh.dofhp_pid = getpid();
+#else
+ dh.dofhp_addr = elf->e_type == ET_DYN ? (uintptr_t) lmp->l_addr : 0;
#endif
if (lmid == 0) {