]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Unmap the vdso as well as suppressing it by dropping the auxv
authorTom Hughes <tom@compton.nu>
Mon, 7 Sep 2009 08:58:29 +0000 (08:58 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 7 Sep 2009 08:58:29 +0000 (08:58 +0000)
entry as on some systems the vdso will be at a random address
and can conflict with things like wine that need to tightly
control where things are mapped.

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

coregrind/m_initimg/initimg-linux.c

index 7cd836e3bc7e35664efe192e46069f9e3dbd78d3..923dafc7859dd1ae69b461ec8ba903f74f5003f4 100644 (file)
@@ -608,6 +608,7 @@ Addr setup_client_stack( void*  init_sp,
 #  endif
 
    for (; orig_auxv->a_type != AT_NULL; auxv++, orig_auxv++) {
+      const NSegment *ehdrseg;
 
       /* copy the entry... */
       *auxv = *orig_auxv;
@@ -699,12 +700,19 @@ Addr setup_client_stack( void*  init_sp,
             break;
 
          case AT_SYSINFO:
+            /* Trash this, because we don't reproduce it */
+            auxv->a_type = AT_IGNORE;
+            break;
+
 #        if !defined(VGP_ppc32_linux) && !defined(VGP_ppc64_linux)
          case AT_SYSINFO_EHDR:
-#        endif
             /* Trash this, because we don't reproduce it */
+            ehdrseg = VG_(am_find_nsegment)((Addr)auxv->u.a_ptr);
+            vg_assert(ehdrseg);
+            VG_(am_munmap_valgrind)(ehdrseg->start, ehdrseg->end - ehdrseg->start);
             auxv->a_type = AT_IGNORE;
             break;
+#        endif
 
          case AT_RANDOM:
             /* points to 16 random bytes - we need to ensure this is