[lld] r263039 - [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:01:46 PST 2016
Author: grimar
Date: Wed Mar 9 12:01:45 2016
New Revision: 263039
URL: http://llvm.org/viewvc/llvm-project?rev=263039&view=rev
Log:
[ELF] - Issue an error if trying to link object that uses splitstacks.
Each object file compiled in split stack mode will have an empty
section with a special name: .note.GNU-split-stack
We don't support this in linker now, so patch just adds an error out for that.
Differential revision: http://reviews.llvm.org/D17918
Added:
lld/trunk/test/ELF/splitstacks.s
Modified:
lld/trunk/ELF/InputFiles.cpp
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=263039&r1=263038&r2=263039&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Wed Mar 9 12:01:45 2016
@@ -245,6 +245,9 @@ elf::ObjectFile<ELFT>::createInputSectio
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") {
Added: lld/trunk/test/ELF/splitstacks.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/splitstacks.s?rev=263039&view=auto
==============================================================================
--- lld/trunk/test/ELF/splitstacks.s (added)
+++ lld/trunk/test/ELF/splitstacks.s Wed Mar 9 12:01:45 2016
@@ -0,0 +1,11 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o
+
+# 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
More information about the llvm-commits
mailing list