2 # RUN: echo 'SECTIONS { \
3 # RUN: .text_low 0x2000: { *(.text_low) } \
4 # RUN: .text_high 0xa000 : { *(.text_high) } \
7 # RUN: llvm-mc -filetype=obj -triple=powerpc64 %s -o %t.o
8 # RUN: ld.lld -T %t.lds %t.o -o %t
9 # RUN: llvm-readelf -r %t | FileCheck --check-prefix=SEC %s
10 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
12 # RUN: llvm-mc -filetype=obj -triple=powerpc64le %s -o %t.o
13 # RUN: ld.lld -pie -T %t.lds %t.o -o %t
14 # RUN: llvm-readelf -r %t | FileCheck --check-prefix=SEC %s
15 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
17 # SEC: There are no relocations in this file.
19 # CHECK-LABEL: <_start>:
20 # CHECK-NEXT: 2000: bt 2, 0x2020
21 # CHECK-NEXT: bt+ 2, 0x2020
22 # CHECK-NEXT: bf 2, 0xa004
23 # CHECK-NEXT: bt 2, 0x2040
29 # CHECK-NEXT: <__long_branch_high>:
30 # CHECK-NEXT: 2020: addis 12, 2, 0
31 # CHECK-NEXT: ld 12, {{.*}}(12)
32 # CHECK-NEXT: mtctr 12
37 # CHECK-NEXT: <__long_branch_>:
38 # CHECK-NEXT: 2040: addis 12, 2, 0
39 # CHECK-NEXT: ld 12, {{.*}}(12)
40 # CHECK-NEXT: mtctr 12
43 .section .text_low, "ax", @progbits
46 beq high
# Need a thunk
47 beq+ high
# Need a thunk
49 beq .text_high+16 # Need a thunk
52 # CHECK-LABEL: <.text_high>:
53 # CHECK-NEXT: a000: nop
55 # CHECK-LABEL: <high>:
56 # CHECK-NEXT: a004: bf 0, 0x2008
57 # CHECK-NEXT: bt 1, 0x2008
59 .section .text_high, "ax", @progbits
63 bge .text_low+8 # Need a thunk
64 bgt .text_low+8 # Need a thunk