Index: ELF/InputFiles.cpp =================================================================== --- ELF/InputFiles.cpp +++ ELF/InputFiles.cpp @@ -245,6 +245,9 @@ if (Name == ".note.GNU-stack") return InputSection::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") { 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,"",@progbits