[lld] r314098 - [ELF] - Report orphan sections if -verbose given.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 25 02:41:32 PDT 2017
Author: grimar
Date: Mon Sep 25 02:41:32 2017
New Revision: 314098
URL: http://llvm.org/viewvc/llvm-project?rev=314098&view=rev
Log:
[ELF] - Report orphan sections if -verbose given.
When -verbose is specified, patch outputs names of each input orphan section
assigned to output.
Differential revision: https://reviews.llvm.org/D37517
Added:
lld/trunk/test/ELF/linkerscript/orphan-report.s
Modified:
lld/trunk/ELF/LinkerScript.cpp
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=314098&r1=314097&r2=314098&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Mon Sep 25 02:41:32 2017
@@ -460,6 +460,7 @@ void LinkerScript::addOrphanSections(Out
return Sec->Name == Name;
return false;
});
+ log(toString(S) + " is being placed in '" + Name + "'");
if (I == End) {
Factory.addInputSec(S, Name);
assert(S->getOutputSection()->SectionIndex == INT_MAX);
Added: lld/trunk/test/ELF/linkerscript/orphan-report.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/orphan-report.s?rev=314098&view=auto
==============================================================================
--- lld/trunk/test/ELF/linkerscript/orphan-report.s (added)
+++ lld/trunk/test/ELF/linkerscript/orphan-report.s Mon Sep 25 02:41:32 2017
@@ -0,0 +1,34 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
+# RUN: echo "SECTIONS { .text : { *(.text.1) } }" > %t.script
+# RUN: ld.lld -shared -o %t.out --script %t.script %t.o --verbose | FileCheck %s
+
+# CHECK: {{.*}}.o:(.text) is being placed in '.text'
+# CHECK-NEXT: {{.*}}.o:(.text.2) is being placed in '.text'
+# CHECK-NEXT: <internal>:(.comment) is being placed in '.comment'
+# CHECK-NEXT: <internal>:(.bss) is being placed in '.bss'
+# CHECK-NEXT: <internal>:(.bss.rel.ro) is being placed in '.bss.rel.ro'
+# CHECK-NEXT: <internal>:(.dynsym) is being placed in '.dynsym'
+# CHECK-NEXT: <internal>:(.gnu.version) is being placed in '.gnu.version'
+# CHECK-NEXT: <internal>:(.gnu.version_r) is being placed in '.gnu.version_r'
+# CHECK-NEXT: <internal>:(.hash) is being placed in '.hash'
+# CHECK-NEXT: <internal>:(.dynamic) is being placed in '.dynamic'
+# CHECK-NEXT: <internal>:(.dynstr) is being placed in '.dynstr'
+# CHECK-NEXT: <internal>:(.rela.dyn) is being placed in '.rela.dyn'
+# CHECK-NEXT: <internal>:(.got) is being placed in '.got'
+# CHECK-NEXT: <internal>:(.got.plt) is being placed in '.got.plt'
+# CHECK-NEXT: <internal>:(.got.plt) is being placed in '.got.plt'
+# CHECK-NEXT: <internal>:(.rela.plt) is being placed in '.rela.plt'
+# CHECK-NEXT: <internal>:(.rela.plt) is being placed in '.rela.plt'
+# CHECK-NEXT: <internal>:(.plt) is being placed in '.plt'
+# CHECK-NEXT: <internal>:(.plt) is being placed in '.plt'
+# CHECK-NEXT: <internal>:(.eh_frame) is being placed in '.eh_frame'
+# CHECK-NEXT: <internal>:(.symtab) is being placed in '.symtab'
+# CHECK-NEXT: <internal>:(.shstrtab) is being placed in '.shstrtab'
+# CHECK-NEXT: <internal>:(.strtab) is being placed in '.strtab'
+
+.section .text.1,"a"
+ nop
+
+.section .text.2,"a"
+ nop
More information about the llvm-commits
mailing list