[PATCH] D14849: ELF: Make .note.GNU-stack handling compatible with traditional linkers.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 20 01:50:46 PST 2015


grimar added inline comments.

================
Comment at: ELF/Driver.cpp:284
@@ -278,1 +283,3 @@
+    Config->ZExecStack = false;
+
   if (Config->OutputFile.empty())
----------------
Currently with this patch logic next situation can happen:
Somebody specify -z noexecstack and have one input without gnu section. Output will have executable stack what is wrong because overriding anything looks not to work.

I would think about overriding not default value but result. So if we specify -z noexecstack then always create PT_GNU_STACK segment, if -z execstack then always dont create it.

================
Comment at: ELF/InputFiles.cpp:239
@@ -234,2 +238,3 @@
+    Config->ZExecStack = true;
 }
 
----------------
What if I have too inputs, with and without .note.GNU-stack section ?
Having logic above ZExecStack will not be set to true and PT_GNU_STACK segment will be created,
But patch description says that all inputs should have .note.GNU-stack for that.

================
Comment at: test/ELF/gnustack.s:30
@@ -46,1 +29,2 @@
 _start:
+.section .note.GNU-stack,""
----------------
Test does not check the case when 1 input has gnu stack section and other does not.


http://reviews.llvm.org/D14849





More information about the llvm-commits mailing list