[PATCH] D14571: [ELF2] - Implemented PT_GNU_STACK support, -z execstack option.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 14 09:29:06 PST 2015


grimar added inline comments.

================
Comment at: ELF/Driver.cpp:177
@@ -176,2 +176,3 @@
   Config->ZOrigin = hasZOption(Args, "origin");
+  Config->ZExecStack = hasZOption(Args, "execstack");
 
----------------
ruiu wrote:
> Sort
Done

================
Comment at: ELF/Writer.cpp:545-546
@@ -538,2 +544,4 @@
         continue;
+      if (!shouldOutputSection(C))
+        continue;
       const Elf_Shdr *H = C->getSectionHdr();
----------------
grimar wrote:
> ruiu wrote:
> > We don't use input files' .note.GNU-stack sections at all. Maybe we should ignore them in .note.GNU-stack?
> Do you mean ignore them in initializeSections ? Something like next ?
> 
> 
> ```
> switch (Sec.sh_type) {
> ...
>  default:
>     if (NameOrErr == ".note.GNU-stack")
>       Sections[I] = &InputSection<ELFT>::Discarded;
> ```
Done

================
Comment at: ELF/Writer.cpp:898
@@ -884,3 +897,3 @@
   bool Tls = false;
   int I = 2; // 2 for PT_PHDR and the first PT_LOAD
   if (needsInterpSection())
----------------
ruiu wrote:
>   // 3 for PT_PHDR, first PT_LOAD and PT_GNU_STACK
Done


http://reviews.llvm.org/D14571





More information about the llvm-commits mailing list