[lld] r348258 - [ELF] Allow discarding of .rela.plt
Martell Malone via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 4 04:37:56 PST 2018
Author: martell
Date: Tue Dec 4 04:37:56 2018
New Revision: 348258
URL: http://llvm.org/viewvc/llvm-project?rev=348258&view=rev
Log:
[ELF] Allow discarding of .rela.plt
When linking the linux kernel on ppc64le
ld.lld -EL -m elf64lppc -Bstatic --orphan-handling=warn --build-id -o
.tmp_vmlinux1 -T ./arch/powerpc/kernel/vmlinux.lds --whole-archive
built-in.a --no-whole-archive --start-group lib/lib.a --end-group
ld.lld: error: discarding .rela.plt section is not allowed
The linker script discards with the following matches
*(.glink .iplt .plt .rela* .comment)
Differential Revision: https://reviews.llvm.org/D54871
Modified:
lld/trunk/ELF/LinkerScript.cpp
lld/trunk/test/ELF/linkerscript/discard-section-err.s
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=348258&r1=348257&r2=348258&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Dec 4 04:37:56 2018
@@ -416,8 +416,7 @@ LinkerScript::computeInputSections(const
void LinkerScript::discard(ArrayRef<InputSection *> V) {
for (InputSection *S : V) {
if (S == In.ShStrTab || S == In.Dynamic || S == In.DynSymTab ||
- S == In.DynStrTab || S == In.RelaPlt || S == In.RelaDyn ||
- S == In.RelrDyn)
+ S == In.DynStrTab || S == In.RelaDyn || S == In.RelrDyn)
error("discarding " + S->Name + " section is not allowed");
// You can discard .hash and .gnu.hash sections by linker scripts. Since
Modified: lld/trunk/test/ELF/linkerscript/discard-section-err.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/discard-section-err.s?rev=348258&r1=348257&r2=348258&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/discard-section-err.s (original)
+++ lld/trunk/test/ELF/linkerscript/discard-section-err.s Tue Dec 4 04:37:56 2018
@@ -22,11 +22,6 @@
# RUN: FileCheck -check-prefix=DYNSTR %s
# DYNSTR: discarding .dynstr section is not allowed
-# RUN: echo "SECTIONS { /DISCARD/ : { *(.rela.plt) } }" > %t.script
-# RUN: not ld.lld -pie -o %t --script %t.script %t.o 2>&1 | \
-# RUN: FileCheck -check-prefix=RELAPLT %s
-# RELAPLT: discarding .rela.plt section is not allowed
-
# RUN: echo "SECTIONS { /DISCARD/ : { *(.rela.dyn) } }" > %t.script
# RUN: not ld.lld -pie -o %t --script %t.script %t.o 2>&1 | \
# RUN: FileCheck -check-prefix=RELADYN %s
More information about the llvm-commits
mailing list