1 ## If a symbol needing a PLT entry also needs a GLOB_DAT relocation, GNU ld's
2 ## x86 port places the PLT entry in .plt.got, relocated by a GLOB_DAT. The
3 ## JUMP_SLOT relocation is unused in this case.
4 ## Test that we synthesize @plt symbols for such PLT entries.
5 # RUN: yaml2obj --docnum=1 %s -o %t.x86-64
6 # RUN: llvm-objdump -d %t.x86-64 | FileCheck %s --check-prefix=64
7 # RUN: yaml2obj --docnum=2 %s -o %t.x86-32
8 # RUN: llvm-objdump -d %t.x86-32 | FileCheck %s --check-prefix=32
10 # 64: Disassembly of section .plt:
16 # 64: Disassembly of section .plt.got:
18 # 64-NEXT: <combined0@plt>:
19 # 64: <combined1@plt>:
22 # 64-NEXT: movq {{.*}}(%rip), %rax
23 # 64-NEXT: movq {{.*}}(%rip), %rax
24 # 64-NEXT: callq {{.*}} <combined0@plt>
25 # 64-NEXT: callq {{.*}} <combined1@plt>
26 # 64-NEXT: callq {{.*}} <foo0@plt>
27 # 64-NEXT: callq {{.*}} <foo1@plt>
29 # 32: Disassembly of section .plt:
35 # 32: Disassembly of section .plt.got:
37 # 32-NEXT: <combined0@plt>:
38 # 32: <combined1@plt>:
41 # 32-NEXT: movl -0x8(%eax), %eax
42 # 32-NEXT: movl -0x4(%eax), %eax
43 # 32-NEXT: calll {{.*}} <combined0@plt>
44 # 32-NEXT: calll {{.*}} <combined1@plt>
45 # 32-NEXT: calll {{.*}} <foo0@plt>
46 # 32-NEXT: calll {{.*}} <foo1@plt>
48 ## %t.x86-64 is linked with ld.bfd -pie -z now a.o b.so and
49 ## doesn't have .got.plt.
50 ## %t.x86-32 is linked with ld.bfd -pie -z lazy a.o b.so and
54 ## .globl _start; _start:
55 ## mov combined0@gotpcrel(%rip), %rax # movl combined0@GOT(%eax), %eax for x86-32
56 ## mov combined1@gotpcrel(%rip), %rax # movl combined1@GOT(%eax), %eax for x86-32
63 ## .globl foo0, foo1, combined0, combined1
64 ## foo0: foo1: combined0: combined1:
83 Type: R_X86_64_GLOB_DAT
86 Type: R_X86_64_GLOB_DAT
89 Flags: [ SHF_ALLOC, SHF_INFO_LINK ]
97 Type: R_X86_64_JUMP_SLOT
100 Type: R_X86_64_JUMP_SLOT
103 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
108 Content: FF35CA1F0000FF25CC1F00000F1F4000FF25CA1F00006800000000E9E0FFFFFFFF25C21F00006801000000E9D0FFFFFF
111 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
115 Content: FF25BA1F00006690FF25BA1F00006690
118 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
121 Content: 488B05A91F0000488B05AA1F0000E8DDFFFFFFE8E0FFFFFFE8C3FFFFFFE8AEFFFFFF
124 Flags: [ SHF_WRITE, SHF_ALLOC ]
128 Content: '682E000000000000000000000000000000000000000000001610000000000000261000000000000000000000000000000000000000000000'
168 Flags: [ SHF_ALLOC, SHF_INFO_LINK ]
176 Type: R_386_JUMP_SLOT
179 Type: R_386_JUMP_SLOT
182 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
187 Content: FFB304000000FFA30800000000000000FFA30C0000006800000000E9E0FFFFFFFFA3100000006808000000E9D0FFFFFF
190 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
194 Content: FFA3F8FFFFFF6690FFA3FCFFFFFF6690
197 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
200 Content: 8B80F8FFFFFF8B80FCFFFFFFE8DFFFFFFFE8E2FFFFFFE8C5FFFFFFE8B0FFFFFF
203 Flags: [ SHF_WRITE, SHF_ALLOC ]
207 Content: '0000000000000000'
210 Flags: [ SHF_WRITE, SHF_ALLOC ]
214 Content: 442F000000000000000000001610000026100000
216 - Name: _GLOBAL_OFFSET_TABLE_