2 ## Test .got2 placed in a different output section.
4 # RUN: rm -rf %t && split-file %s %t
5 # RUN: llvm-mc -filetype=obj -triple=powerpc %t/a.s -o %t/a.o
6 # RUN: llvm-mc -filetype=obj -triple=powerpc %t/b.s -o %t/b.o
7 # RUN: ld.lld -shared -T %t/t %t/a.o %t/b.o -o %t/a.so
8 # RUN: llvm-readobj -r %t/a.so | FileCheck --check-prefix=RELOC %s
9 # RUN: llvm-readelf -S %t/a.so | FileCheck --check-prefix=SEC %s
12 # RELOC-NEXT: 0x1A4 R_PPC_JMP_SLOT f 0x0
15 # SEC: .got PROGBITS 0000018c
16 # SEC-NEXT: .rodata PROGBITS 00000198
18 ## .got2+0x8000-0xb0 = .rodata+4+0x8000-0xb0 = 0x198+4+0x8000-0xb0 = 65536*1-32532
20 # CHECK-NEXT: bcl 20, 31, 0x
21 # CHECK-NEXT: b0: mflr 30
22 # CHECK-NEXT: addis 30, 30, 1
23 # CHECK-NEXT: addi 30, 30, -32532
24 # CHECK-NEXT: bl {{.*}} <00008000.got2.plt_pic32.f>
26 ## &.got[2] - (.got2+0x8000) = &.got[2] - (.rodata+4+0x8000) = 0x1A4 - (0x198+4+0x8000) = -32760
27 # CHECK: <00008000.got2.plt_pic32.f>:
28 # CHECK-NEXT: lwz 11, -32760(30)
29 # CHECK-NEXT: mtctr 11
34 .section .rodata.cst4,"aM",@progbits,4
46 addis 30, 30, .got2+0x8000-.L@ha
47 addi 30, 30, .got2+0x8000-.L@l
58 .rodata : { *(.rodata .rodata.*) *(.got2) }