2 // RUN
: llvm-mc
-filetype
=obj
-triple
=x86_64-unknown-linux
%s
-o
%t.o
3 // RUN
: llvm-mc
-filetype
=obj
-triple
=x86_64-unknown-linux
%p
/Inputs
/undef-with-plt-addr.s
-o
%t2.o
4 // RUN
: ld.lld
%t2.o
-o
%t2.so
-shared
-soname
=so
5 // RUN
: ld.lld
%t.o
%t2.so
-o
%t3
6 // RUN
: llvm-readobj
--symbols
-S
-r
%t3 | FileCheck
%s
8 // Test that
-z nocopyreloc doesn
't prevent the plt hack.
9 // RUN: ld.lld %t.o %t2.so -o %t3 -z nocopyreloc
13 movabsq $set_data, %rax
17 // Test that set_data has an address in the .plt, but foo is not
20 // CHECK-NEXT: Type: SHT_PROGBITS
21 // CHECK-NEXT: Flags [
22 // CHECK-NEXT: SHF_ALLOC
23 // CHECK-NEXT: SHF_EXECINSTR
25 // CHECK-NEXT: Address: 0x2012E0
27 // CHECK: Section ({{.*}}) .rela.dyn {
28 // CHECK-NEXT: 0x203400 R_X86_64_64 foo 0x0
30 // CHECK-NEXT: Section ({{.*}}) .rela.plt {
31 // CHECK-NEXT: 0x203420 R_X86_64_JUMP_SLOT set_data 0x0
34 // CHECK: Name: set_data
35 // CHECK-NEXT: Value: 0x2012F0
36 // CHECK-NEXT: Size: 0
37 // CHECK-NEXT: Binding: Global
38 // CHECK-NEXT: Type: Function
39 // CHECK-NEXT: Other: 0
40 // CHECK-NEXT: Section: Undefined
43 // CHECK-NEXT: Value: 0x0
44 // CHECK-NEXT: Size: 0
45 // CHECK-NEXT: Binding: Global
46 // CHECK-NEXT: Type: Function
47 // CHECK-NEXT: Other: 0
48 // CHECK-NEXT: Section: Undefined