]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Android's elf.h doesn't have PT_GNU_STACK (sigh) and so r13368 broke
authorJulian Seward <jseward@acm.org>
Mon, 22 Apr 2013 09:57:01 +0000 (09:57 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 22 Apr 2013 09:57:01 +0000 (09:57 +0000)
the build.  This conditionalises that fragment on the present of
PT_GNU_STACK.

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

coregrind/m_ume/elf.c

index 03b0102d593f09bdc03dc43adbf4d183170ca3a6..89f2630db6fb720e950e7e2a6741ec4c1af097fb 100644 (file)
@@ -315,9 +315,9 @@ Int VG_(load_ELF)(Int fd, const HChar* name, /*MOD*/ExeInfo* info)
       entry point and initial tocptr (R2) value. */
    ESZ(Word) interp_offset = 0;
 
-#ifdef HAVE_PIE
+#  if defined(HAVE_PIE)
    ebase = info->exe_base;
-#endif
+#  endif
 
    e = readelf(fd, name);
 
@@ -417,11 +417,14 @@ Int VG_(load_ELF)(Int fd, const HChar* name, /*MOD*/ExeInfo* info)
          }
          break;
 
+#     if defined(PT_GNU_STACK)
+      /* Android's elf.h doesn't appear to have PT_GNU_STACK. */
       case PT_GNU_STACK:
          if ((ph->p_flags & PF_X) == 0) info->stack_prot &= ~VKI_PROT_EXEC;
          if ((ph->p_flags & PF_W) == 0) info->stack_prot &= ~VKI_PROT_WRITE;
          if ((ph->p_flags & PF_R) == 0) info->stack_prot &= ~VKI_PROT_READ;
          break;
+#     endif
 
       default:
          // do nothing