diff options
-rw-r--r-- | lld/ELF/LinkerScript.h | 14 | ||||
-rw-r--r-- | lld/test/ELF/linkerscript/symbols-synthetic.s | 26 | ||||
-rw-r--r-- | lld/test/ELF/lto/defsym.ll | 36 | ||||
-rw-r--r-- | lld/test/ELF/lto/linker-script-symbols-assign.ll | 14 | ||||
-rw-r--r-- | lld/test/ELF/lto/linker-script-symbols-ipo.ll | 18 |
5 files changed, 54 insertions, 54 deletions
diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h index c16388d90e5..1ff07ffb0d7 100644 --- a/lld/ELF/LinkerScript.h +++ b/lld/ELF/LinkerScript.h @@ -262,13 +262,13 @@ public: bool needsInterpSection(); bool shouldKeep(InputSectionBase *S); - void assignAddresses();
- void allocateHeaders(std::vector<PhdrEntry *> &Phdrs);
- void processSectionCommands();
- void declareSymbols();
-
- // SECTIONS command list.
- std::vector<BaseCommand *> SectionCommands;
+ void assignAddresses(); + void allocateHeaders(std::vector<PhdrEntry *> &Phdrs); + void processSectionCommands(); + void declareSymbols(); + + // SECTIONS command list. + std::vector<BaseCommand *> SectionCommands; // PHDRS command list. std::vector<PhdrsCommand> PhdrsCommands; diff --git a/lld/test/ELF/linkerscript/symbols-synthetic.s b/lld/test/ELF/linkerscript/symbols-synthetic.s index fee47efc824..978ec9a8e15 100644 --- a/lld/test/ELF/linkerscript/symbols-synthetic.s +++ b/lld/test/ELF/linkerscript/symbols-synthetic.s @@ -58,20 +58,20 @@ # RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=IN-SEC %s # SIMPLE: 0000000000000128 .foo 00000000 .hidden _end_sec -# SIMPLE-NEXT: 0000000000000120 .foo 00000000 _begin_sec
-# SIMPLE-NEXT: 0000000000000128 *ABS* 00000000 _end_sec_abs
-# SIMPLE-NEXT: 0000000000001048 .text 00000000 _start
-# SIMPLE-NEXT: 0000000000000ee4 *ABS* 00000000 size_foo_3
-# SIMPLE-NEXT: 0000000000000120 .foo 00000000 begin_foo
-# SIMPLE-NEXT: 0000000000000128 .foo 00000000 end_foo
-# SIMPLE-NEXT: 0000000000000008 *ABS* 00000000 size_foo_1
+# SIMPLE-NEXT: 0000000000000120 .foo 00000000 _begin_sec +# SIMPLE-NEXT: 0000000000000128 *ABS* 00000000 _end_sec_abs +# SIMPLE-NEXT: 0000000000001048 .text 00000000 _start +# SIMPLE-NEXT: 0000000000000ee4 *ABS* 00000000 size_foo_3 +# SIMPLE-NEXT: 0000000000000120 .foo 00000000 begin_foo +# SIMPLE-NEXT: 0000000000000128 .foo 00000000 end_foo +# SIMPLE-NEXT: 0000000000000008 *ABS* 00000000 size_foo_1 # SIMPLE-NEXT: 0000000000000008 *ABS* 00000000 size_foo_1_abs -# SIMPLE-NEXT: 0000000000001000 .foo 00000000 begin_bar
-# SIMPLE-NEXT: 0000000000001004 .foo 00000000 end_bar
-# SIMPLE-NEXT: 0000000000000ee4 *ABS* 00000000 size_foo_2
-# SIMPLE-NEXT: 0000000000001004 .eh_frame_hdr 00000000 __eh_frame_hdr_start
-# SIMPLE-NEXT: 0000000000001010 *ABS* 00000000 __eh_frame_hdr_start2
-# SIMPLE-NEXT: 0000000000001018 .eh_frame_hdr 00000000 __eh_frame_hdr_end
+# SIMPLE-NEXT: 0000000000001000 .foo 00000000 begin_bar +# SIMPLE-NEXT: 0000000000001004 .foo 00000000 end_bar +# SIMPLE-NEXT: 0000000000000ee4 *ABS* 00000000 size_foo_2 +# SIMPLE-NEXT: 0000000000001004 .eh_frame_hdr 00000000 __eh_frame_hdr_start +# SIMPLE-NEXT: 0000000000001010 *ABS* 00000000 __eh_frame_hdr_start2 +# SIMPLE-NEXT: 0000000000001018 .eh_frame_hdr 00000000 __eh_frame_hdr_end # SIMPLE-NEXT: 0000000000001020 *ABS* 00000000 __eh_frame_hdr_end2 # NO-SEC: 0000000000201000 .text 00000000 .hidden _begin_sec diff --git a/lld/test/ELF/lto/defsym.ll b/lld/test/ELF/lto/defsym.ll index 61ab06a0f55..e5f0a4875f5 100644 --- a/lld/test/ELF/lto/defsym.ll +++ b/lld/test/ELF/lto/defsym.ll @@ -1,22 +1,22 @@ ; REQUIRES: x86 -; LTO
-; RUN: llvm-as %s -o %t.o
-; RUN: llvm-as %S/Inputs/defsym-bar.ll -o %t1.o
-; RUN: ld.lld %t.o %t1.o -shared -o %t.so -defsym=bar2=bar3 -save-temps
-; RUN: llvm-readelf -t %t.so.lto.o | FileCheck --check-prefix=OBJ %s
-; RUN: llvm-objdump -d %t.so | FileCheck %s
-
-; ThinLTO
-; RUN: opt -module-summary %s -o %t.o
-; RUN: opt -module-summary %S/Inputs/defsym-bar.ll -o %t1.o
-; RUN: ld.lld %t.o %t1.o -shared -o %t2.so -defsym=bar2=bar3 -save-temps
-; RUN: llvm-readelf -t %t2.so1.lto.o | FileCheck --check-prefix=OBJ %s
-; RUN: llvm-objdump -d %t2.so | FileCheck %s --check-prefix=THIN
-
-; OBJ: UND bar2
-
-; Call to bar2() should not be inlined and should be routed to bar3()
-; Symbol bar3 should not be eliminated
+; LTO +; RUN: llvm-as %s -o %t.o +; RUN: llvm-as %S/Inputs/defsym-bar.ll -o %t1.o +; RUN: ld.lld %t.o %t1.o -shared -o %t.so -defsym=bar2=bar3 -save-temps +; RUN: llvm-readelf -t %t.so.lto.o | FileCheck --check-prefix=OBJ %s +; RUN: llvm-objdump -d %t.so | FileCheck %s + +; ThinLTO +; RUN: opt -module-summary %s -o %t.o +; RUN: opt -module-summary %S/Inputs/defsym-bar.ll -o %t1.o +; RUN: ld.lld %t.o %t1.o -shared -o %t2.so -defsym=bar2=bar3 -save-temps +; RUN: llvm-readelf -t %t2.so1.lto.o | FileCheck --check-prefix=OBJ %s +; RUN: llvm-objdump -d %t2.so | FileCheck %s --check-prefix=THIN + +; OBJ: UND bar2 + +; Call to bar2() should not be inlined and should be routed to bar3() +; Symbol bar3 should not be eliminated ; CHECK: foo: ; CHECK-NEXT: pushq %rax diff --git a/lld/test/ELF/lto/linker-script-symbols-assign.ll b/lld/test/ELF/lto/linker-script-symbols-assign.ll index e08bc7c4868..6ca78245a1c 100644 --- a/lld/test/ELF/lto/linker-script-symbols-assign.ll +++ b/lld/test/ELF/lto/linker-script-symbols-assign.ll @@ -3,13 +3,13 @@ ; RUN: echo "foo = 1;" > %t.script ; RUN: ld.lld -m elf_x86_64 %t.o -o %t2 --script %t.script -save-temps -; RUN: llvm-readobj -symbols %t2.lto.o | FileCheck %s
-
-; CHECK-NOT: bar
-; CHECK-NOT: foo
-
-; RUN: llvm-readobj -symbols %t2 | FileCheck %s --check-prefix=VAL
-; VAL: Symbol {
+; RUN: llvm-readobj -symbols %t2.lto.o | FileCheck %s + +; CHECK-NOT: bar +; CHECK-NOT: foo + +; RUN: llvm-readobj -symbols %t2 | FileCheck %s --check-prefix=VAL +; VAL: Symbol { ; VAL: Name: foo ; VAL-NEXT: Value: 0x1 ; VAL-NEXT: Size: diff --git a/lld/test/ELF/lto/linker-script-symbols-ipo.ll b/lld/test/ELF/lto/linker-script-symbols-ipo.ll index 9762ea66e77..330ac6795ef 100644 --- a/lld/test/ELF/lto/linker-script-symbols-ipo.ll +++ b/lld/test/ELF/lto/linker-script-symbols-ipo.ll @@ -13,15 +13,15 @@ ;; Check that LTO does not do IPO for symbols assigned by script. ; RUN: ld.lld -m elf_x86_64 %t1.o %t2.o -o %t4 --script %t.script -save-temps -; RUN: llvm-objdump -d %t4 | FileCheck %s --check-prefix=NOIPO
-; NOIPO: Disassembly of section .text:
-; NOIPO: foo:
-; NOIPO-NEXT: {{.*}} movl $2, %eax
-; NOIPO: _start:
-; NOIPO-NEXT: {{.*}} jmp -21 <foo>
-
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
+; RUN: llvm-objdump -d %t4 | FileCheck %s --check-prefix=NOIPO +; NOIPO: Disassembly of section .text: +; NOIPO: foo: +; NOIPO-NEXT: {{.*}} movl $2, %eax +; NOIPO: _start: +; NOIPO-NEXT: {{.*}} jmp -21 <foo> + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" define i32 @bar() { ret i32 1 |