[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 05:53:03 PST 2016
grimar retitled this revision from "[ELF] - Issue an error if trying to generate relocatable from objects having mixed splitstacks." to "[ELF] - Issue an error if trying to link object that uses splitstacks.".
grimar updated the summary for this revision.
grimar updated this revision to Diff 50128.
grimar added a comment.
- Removed most of logic, lld should just produce error if splitstacks are used.
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,13 @@
+# 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 | \
+# RUN: FileCheck --check-prefix=ERR %s
+# ERR: 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
@@ -175,6 +175,8 @@
unsigned I = -1;
const ELFFile<ELFT> &Obj = this->ELFObj;
for (const Elf_Shdr &Sec : Obj.sections()) {
+ if (HasError)
+ return;
++I;
if (Sections[I] == InputSection<ELFT>::Discarded)
continue;
@@ -245,6 +247,10 @@
if (Name == ".note.GNU-stack")
return InputSection<ELFT>::Discarded;
+ // .note.GNU-split-stack is a marker we don't support currently.
+ 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.50128.patch
Type: text/x-patch
Size: 1381 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160309/701325fd/attachment.bin>
More information about the llvm-commits
mailing list