[PATCH] D17918: [ELF] - Issue an error if trying to link object that uses splitstacks.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 9 10:02:14 PST 2016


grimar updated this revision to Diff 50154.
grimar added a comment.

- Addressed review comments.


http://reviews.llvm.org/D17918

Files:
  ELF/InputFiles.cpp
  test/ELF/splitstacks.s

Index: test/ELF/splitstacks.s
===================================================================
--- test/ELF/splitstacks.s
+++ test/ELF/splitstacks.s
@@ -0,0 +1,12 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o
+
+## Check that splitstacks objects are not allowed.
+# RUN: not ld.lld %t1.o -o %t 2>&1 | FileCheck %s
+# CHECK: Objects using splitstacks are not supported
+
+.globl _start
+_start:
+ nop
+
+.section .note.GNU-split-stack,"", at progbits
Index: ELF/InputFiles.cpp
===================================================================
--- ELF/InputFiles.cpp
+++ ELF/InputFiles.cpp
@@ -245,6 +245,9 @@
   if (Name == ".note.GNU-stack")
     return InputSection<ELFT>::Discarded;
 
+  if (Name == ".note.GNU-split-stack")
+    error("Objects using splitstacks are not supported");
+
   // A MIPS object file has a special section that contains register
   // usage info, which needs to be handled by the linker specially.
   if (Config->EMachine == EM_MIPS && Name == ".reginfo") {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17918.50154.patch
Type: text/x-patch
Size: 1034 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160309/c16103f2/attachment.bin>


More information about the llvm-commits mailing list