|
From: <sv...@va...> - 2015-08-17 19:13:19
|
Author: iraisr
Date: Mon Aug 17 20:13:12 2015
New Revision: 15562
Log:
Runtime linker ld.so.1 can be now run under Valgrind on Solaris.
Fixes BZ#351386.
Modified:
trunk/NEWS
trunk/coregrind/m_initimg/initimg-solaris.c
trunk/coregrind/m_ume/elf.c
trunk/coregrind/pub_core_ume.h
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Mon Aug 17 20:13:12 2015
@@ -306,6 +306,7 @@
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.
Modified: trunk/coregrind/m_initimg/initimg-solaris.c
==============================================================================
--- trunk/coregrind/m_initimg/initimg-solaris.c (original)
+++ trunk/coregrind/m_initimg/initimg-solaris.c Mon Aug 17 20:13:12 2015
@@ -367,7 +367,7 @@
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
@@ -538,7 +538,7 @@
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++;
Modified: trunk/coregrind/m_ume/elf.c
==============================================================================
--- trunk/coregrind/m_ume/elf.c (original)
+++ trunk/coregrind/m_ume/elf.c Mon Aug 17 20:13:12 2015
@@ -350,6 +350,11 @@
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;
@@ -363,6 +368,9 @@
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:
Modified: trunk/coregrind/pub_core_ume.h
==============================================================================
--- trunk/coregrind/pub_core_ume.h (original)
+++ trunk/coregrind/pub_core_ume.h Mon Aug 17 20:13:12 2015
@@ -65,7 +65,8 @@
#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
|