Fixes BZ#351386.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15562
350813 Use handwritten memcheck assembly helpers on x86/Solaris in addition to {arm,x86}-linux
350854 hard-to-understand code in VG_(load_ELF)()
351140 arm64 syscalls setuid (146) and setresgid (149) not implemented
+351386 Cannot run ld.so.1 under Valgrind
n-i-bz Provide implementations of certain compiler builtins to support
compilers who may not provide those
n-i-bz Old STABS code is still being compiled, but never used. Remove it.
AT_SUN_PLATFORM
AT_SUN_EXECNAME
- AT_PHDR
+ AT_PHDR (not for elfs with no PT_PHDR, such as ld.so.1)
AT_BASE
AT_FLAGS
AT_PAGESZ
auxv++;
/* AT_PHDR */
- if (info->phdr) {
+ if ((info->real_phdr_present) && (info->phdr != 0)) {
auxv->a_type = VKI_AT_PHDR;
auxv->a_un.a_val = info->phdr;
auxv++;
if (ebase < hacky_load_address)
ebase = hacky_load_address;
# endif
+
+# if defined(VGO_solaris)
+ /* Record for later use in AT_BASE. */
+ info->interp_offset = ebase;
+# endif
}
info->phnum = e->e.e_phnum;
switch(ph->p_type) {
case PT_PHDR:
info->phdr = ph->p_vaddr + ebase;
+# if defined(VGO_solaris)
+ info->real_phdr_present = True;
+# endif
break;
case PT_LOAD:
#endif
#if defined(VGO_solaris)
- Addr init_thrptr; // OUT: architecture-specific user per-thread location
+ Addr init_thrptr; // OUT: architecture-specific user per-thread location
+ Bool real_phdr_present; // OUT: PT_PHDR found, include phdr in auxv
#endif
Addr entry; // OUT: entrypoint in main executable