2 # RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-freebsd %p/Inputs/aarch64-tstbr14-reloc.s -o %t1
3 # RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-freebsd %s -o %t2
4 # RUN: ld.lld %t1 %t2 -o %t
5 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t | FileCheck %s
6 # RUN: ld.lld -shared %t1 %t2 -o %t3
7 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t3 | FileCheck --check-prefix=DSO %s
8 # RUN: llvm-readobj -S -r %t3 | FileCheck -check-prefix=DSOREL %s
11 # CHECK-NEXT: 210120: nop
12 # CHECK-NEXT: 210124: nop
13 # CHECK-NEXT: 210128: nop
14 # CHECK-NEXT: 21012c: nop
16 # CHECK-NEXT: 210130: nop
17 # CHECK-NEXT: 210134: nop
18 # CHECK-NEXT: 210138: nop
20 # CHECK-NEXT: 21013c: tbnz w3, #15, 0x210120 <_foo>
21 # CHECK-NEXT: 210140: tbnz w3, #15, 0x210130 <_bar>
22 # CHECK-NEXT: 210144: tbz x6, #45, 0x210120 <_foo>
23 # CHECK-NEXT: 210148: tbz x6, #45, 0x210130 <_bar>
27 #DSOREL: Name: .got.plt
28 #DSOREL-NEXT: Type: SHT_PROGBITS
30 #DSOREL-NEXT: SHF_ALLOC
31 #DSOREL-NEXT: SHF_WRITE
33 #DSOREL-NEXT: Address: 0x30420
34 #DSOREL-NEXT: Offset: 0x420
35 #DSOREL-NEXT: Size: 40
38 #DSOREL-NEXT: AddressAlignment: 8
39 #DSOREL-NEXT: EntrySize: 0
41 #DSOREL: Relocations [
42 #DSOREL-NEXT: Section ({{.*}}) .rela.plt {
43 #DSOREL-NEXT: 0x30438 R_AARCH64_JUMP_SLOT _foo
44 #DSOREL-NEXT: 0x30440 R_AARCH64_JUMP_SLOT _bar
48 #DSO: Disassembly of section .text:
60 #DSO-NEXT: 10314: tbnz w3, #15, 0x10350 <_foo@plt>
61 #DSO-NEXT: 10318: tbnz w3, #15, 0x10360 <_bar@plt>
62 #DSO-NEXT: 1031c: tbz x6, #45, 0x10350 <_foo@plt>
63 #DSO-NEXT: 10320: tbz x6, #45, 0x10360 <_bar@plt>
65 #DSO-NEXT: Disassembly of section .plt:
68 #DSO-NEXT: 10330: stp x16, x30, [sp, #-16]!
69 #DSO-NEXT: 10334: adrp x16, 0x30000
70 #DSO-NEXT: 10338: ldr x17, [x16, #1072]
71 #DSO-NEXT: 1033c: add x16, x16, #1072
72 #DSO-NEXT: 10340: br x17
77 #DSO-NEXT: <_foo@plt>:
78 #DSO-NEXT: 10350: adrp x16, 0x30000
79 #DSO-NEXT: 10354: ldr x17, [x16, #1080]
80 #DSO-NEXT: 10358: add x16, x16, #1080
81 #DSO-NEXT: 1035c: br x17
83 #DSO-NEXT: <_bar@plt>:
84 #DSO-NEXT: 10360: adrp x16, 0x30000
85 #DSO-NEXT: 10364: ldr x17, [x16, #1088]
86 #DSO-NEXT: 10368: add x16, x16, #1088
87 #DSO-NEXT: 1036c: br x17