[PATCH] D54871: [ELF] Allow discarding of .rela.plt

Martell Malone via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 24 14:46:39 PST 2018


martell created this revision.
martell added reviewers: ruiu, espindola, sfertile.
martell added a project: lld.
Herald added subscribers: MaskRay, arichardson, emaste.

When linking the linux kernel on ppc64 le

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


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D54871

Files:
  ELF/LinkerScript.cpp


Index: ELF/LinkerScript.cpp
===================================================================
--- ELF/LinkerScript.cpp
+++ ELF/LinkerScript.cpp
@@ -416,8 +416,7 @@
 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54871.175166.patch
Type: text/x-patch
Size: 631 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181124/d11ce0fa/attachment.bin>


More information about the llvm-commits mailing list