2 # RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-freebsd %p/Inputs/aarch64-condb-reloc.s -o %t1.o
3 # RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-freebsd %s -o %t2.o
4 # RUN: ld.lld %t1.o %t2.o -o %t
5 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t | FileCheck %s
6 # RUN: ld.lld -shared %t1.o %t2.o -o %t.so
7 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.so | FileCheck --check-prefix=DSO %s
8 # RUN: llvm-readobj -S -r %t.so | FileCheck -check-prefix=DSOREL %s
10 # 0x11024 - 36 = 0x11000
11 # 0x11028 - 24 = 0x11010
12 # 0x1102c - 16 = 0x1101c
13 # CHECK: Disassembly of section .text:
16 # CHECK-NEXT: 210120: nop
17 # CHECK-NEXT: 210124: nop
18 # CHECK-NEXT: 210128: nop
19 # CHECK-NEXT: 21012c: nop
21 # CHECK-NEXT: 210130: nop
22 # CHECK-NEXT: 210134: nop
23 # CHECK-NEXT: 210138: nop
25 # CHECK-NEXT: 21013c: nop
26 # CHECK-NEXT: 210140: nop
28 # CHECK-NEXT: 210144: b.eq 0x210120 <_foo>
29 # CHECK-NEXT: 210148: b.eq 0x210130 <_bar>
30 # CHECK-NEXT: 21014c: b.eq 0x21013c <_dah>
34 #DSOREL: Name: .got.plt
35 #DSOREL-NEXT: Type: SHT_PROGBITS
37 #DSOREL-NEXT: SHF_ALLOC
38 #DSOREL-NEXT: SHF_WRITE
40 #DSOREL-NEXT: Address: 0x30470
41 #DSOREL-NEXT: Offset: 0x470
42 #DSOREL-NEXT: Size: 48
45 #DSOREL-NEXT: AddressAlignment: 8
46 #DSOREL-NEXT: EntrySize: 0
48 #DSOREL: Relocations [
49 #DSOREL-NEXT: Section ({{.*}}) .rela.plt {
50 #DSOREL-NEXT: 0x30488 R_AARCH64_JUMP_SLOT _foo
51 #DSOREL-NEXT: 0x30490 R_AARCH64_JUMP_SLOT _bar
52 #DSOREL-NEXT: 0x30498 R_AARCH64_JUMP_SLOT _dah
56 #DSO: Disassembly of section .text:
71 #DSO-NEXT: 1035c: b.eq 0x10390 <_foo@plt>
72 #DSO-NEXT: 10360: b.eq 0x103a0 <_bar@plt>
73 #DSO-NEXT: 10364: b.eq 0x103b0 <_dah@plt>
75 #DSO-NEXT: Disassembly of section .plt:
78 #DSO-NEXT: 10370: stp x16, x30, [sp, #-16]!
79 #DSO-NEXT: 10374: adrp x16, 0x30000
80 #DSO-NEXT: 10378: ldr x17, [x16, #1152]
81 #DSO-NEXT: 1037c: add x16, x16, #1152
82 #DSO-NEXT: 10380: br x17
87 #DSO-NEXT: <_foo@plt>:
88 #DSO-NEXT: 10390: adrp x16, 0x30000
89 #DSO-NEXT: 10394: ldr x17, [x16, #1160]
90 #DSO-NEXT: 10398: add x16, x16, #1160
91 #DSO-NEXT: 1039c: br x17
93 #DSO-NEXT: <_bar@plt>:
94 #DSO-NEXT: 103a0: adrp x16, 0x30000
95 #DSO-NEXT: 103a4: ldr x17, [x16, #1168]
96 #DSO-NEXT: 103a8: add x16, x16, #1168
97 #DSO-NEXT: 103ac: br x17
99 #DSO-NEXT: <_dah@plt>:
100 #DSO-NEXT: 103b0: adrp x16, 0x30000
101 #DSO-NEXT: 103b4: ldr x17, [x16, #1176]
102 #DSO-NEXT: 103b8: add x16, x16, #1176
103 #DSO-NEXT: 103bc: br x17