]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Enable remote debugging for position independent executables
authorIvo Raisr <ivosh@ivosh.net>
Tue, 23 Feb 2016 21:48:13 +0000 (21:48 +0000)
committerIvo Raisr <ivosh@ivosh.net>
Tue, 23 Feb 2016 21:48:13 +0000 (21:48 +0000)
on Solaris. With gcc 5.3, PIEs can be produced on Solaris 12.

gdb on Solaris requires AT_ENTRY to correctly work with those.
See very long comment before function svr4_exec_displacement().
n-i-bz

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15810

coregrind/m_initimg/initimg-solaris.c
include/vki/vki-solaris.h

index df913da641d93c92d3a1bf9839d09aebac4e8c24..d872072148dabdf0ea78fa615aaae67e4af4a321 100644 (file)
@@ -442,6 +442,7 @@ static Addr setup_client_stack(Addr init_sp,
       AT_SUN_EXECNAME
       AT_PHDR            (not for elfs with no PT_PHDR, such as ld.so.1)
       AT_BASE
+      AT_ENTRY
       AT_FLAGS
       AT_PAGESZ
       AT_SUN_AUXFLAFGS
@@ -450,9 +451,9 @@ static Addr setup_client_stack(Addr init_sp,
       AT_SUN_SYSSTAT_ZONE_ADDR (if supported)
       AT_NULL
 
-      It would be possible to also add AT_PHENT, AT_PHNUM, AT_ENTRY,
-      AT_SUN_LDDATA, but they don't seem to be so important. */
-   auxsize = 9 * sizeof(*auxv);
+      It would be possible to also add AT_PHENT, AT_PHNUM, AT_SUN_LDDATA,
+      but they don't seem to be so important. */
+   auxsize = 10 * sizeof(*auxv);
 #  if defined(SOLARIS_RESERVE_SYSSTAT_ADDR)
    auxsize += sizeof(*auxv);
 #  endif
@@ -631,6 +632,11 @@ static Addr setup_client_stack(Addr init_sp,
    auxv->a_un.a_val = info->interp_offset;
    auxv++;
 
+   /* AT_ENTRY */
+   auxv->a_type = VKI_AT_ENTRY;
+   auxv->a_un.a_val = info->entry;
+   auxv++;
+
    /* AT_FLAGS */
    auxv->a_type = VKI_AT_FLAGS;
 #  if defined(VGA_x86) || defined(VGA_amd64)
index babc1f2dd350470053e8d4836f3b4d9da0314003..76e83d461548d68ae86c8f0700beb4ba59f54378 100644 (file)
@@ -257,6 +257,7 @@ typedef struct {
 #define VKI_AT_PAGESZ AT_PAGESZ
 #define VKI_AT_BASE AT_BASE
 #define VKI_AT_FLAGS AT_FLAGS
+#define VKI_AT_ENTRY AT_ENTRY
 #define VKI_AT_SUN_PLATFORM AT_SUN_PLATFORM
 #define VKI_AT_SUN_HWCAP AT_SUN_HWCAP
 #define VKI_AT_SUN_EXECNAME AT_SUN_EXECNAME