summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-02-23 21:16:02 +0000
committerjhb <jhb@FreeBSD.org>2015-02-23 21:16:02 +0000
commit7b2a7d1b7b661046fd05b9271b6692a87f4ddeab (patch)
tree251d622c1ad62e070195a6a1abe5b8feafe0e045 /libexec/rtld-elf
parent4ee9c49971462598e86cded5dec28bd933b91fc9 (diff)
downloadFreeBSD-src-7b2a7d1b7b661046fd05b9271b6692a87f4ddeab.zip
FreeBSD-src-7b2a7d1b7b661046fd05b9271b6692a87f4ddeab.tar.gz
MFC 275412:
The runtime linker needs to include a path to itself in the link map it exports to the debugger. It currently has two choices: it can use a compiled-in path (/libexec/ld-elf.so.1) or it can use the path stored in the interpreter path in the binary being executed. The runtime linker currently prefers the second. However, this is usually wrong for compat32 binaries since the binary specifies the path of rtld on a 32-bit system (/libexec/ld-elf.so.1) instead of the actual path (/libexec/ld-elf32.so.1). For now, always assume the compiled in path (/libexec/ld-elf32.so.1) as the rtld path and ignore the path in the binary for the 32-bit runtime linker.
Diffstat (limited to 'libexec/rtld-elf')
-rw-r--r--libexec/rtld-elf/rtld.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index b129193..0d1a738 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -496,6 +496,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
aux_info[AT_STACKPROT]->a_un.a_val != 0)
stack_prot = aux_info[AT_STACKPROT]->a_un.a_val;
+#ifndef COMPAT_32BIT
/*
* Get the actual dynamic linker pathname from the executable if
* possible. (It should always be possible.) That ensures that
@@ -508,6 +509,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
obj_rtld.path = xstrdup(obj_main->interp);
__progname = obj_rtld.path;
}
+#endif
digest_dynamic(obj_main, 0);
dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d",
OpenPOWER on IntegriCloud