forked from OSchip/llvm-project
parent
2b780160cd
commit
c9265e81f4
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue