librtld_db: Use the auxv to figure out where to look up loader symbols.

Previously, librtld_db just hardcoded /libexec/ld-elf.so, which isn't
correct for processes that aren't using the native ABI. With this change,
librtld_db can be used to inspect non-native processes; in particular,
dtrace -c now works for 32-bit executables on amd64.

MFC after:	1 month
This commit is contained in:
Mark Johnston
2016-07-30 03:05:23 +00:00
parent e04d8562b6
commit a7e13d50fe
5 changed files with 176 additions and 33 deletions
+3 -1
View File
@@ -2095,7 +2095,9 @@ cddl/lib/libctf__L: lib/libz__L
# cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built
# on select architectures though (see cddl/lib/Makefile)
.if ${MACHINE_CPUARCH} != "sparc64"
_prebuild_libs+= lib/libproc lib/librtld_db
_prebuild_libs+= lib/libprocstat lib/libproc lib/librtld_db
lib/libproc__L: lib/libprocstat__L
lib/librtld_db__L: lib/libprocstat__L
.endif
.if ${MK_CRYPT} != "no"