[ELF] Make section member orders consistent
[llvm-project.git] / lld / test / ELF / ppc64-pcrel-long-branch-error.s
blob618acdf36b0461f30a25f39a965d1b0752f34244
1 # REQUIRES: ppc
2 # RUN: split-file %s %t
3 # RUN: llvm-mc -filetype=obj -triple=ppc64le %t/asm -o %t.o
4 # RUN: not ld.lld --script %t/lds %t.o -o %t1 2>&1 | FileCheck %s
5 # RUN: ld.lld --script %t/lds %t.o -o %t1 --noinhibit-exec
6 # RUN: rm %t.o %t1
7 # RUN: llvm-mc -filetype=obj -triple=ppc64le -defsym HIDDEN=1 %t/asm -o %t.o
8 # RUN: not ld.lld -shared --script %t/lds %t.o -o %t1 2>&1 | FileCheck %s
9 # RUN: ld.lld -shared --script %t/lds %t.o -o %t1 --noinhibit-exec
10 # RUN: rm %t.o %t1
12 # RUN: llvm-mc -filetype=obj -triple=ppc64 %t/asm -o %t.o
13 # RUN: not ld.lld --script %t/lds %t.o -o %t1 2>&1 | FileCheck %s
14 # RUN: ld.lld --script %t/lds %t.o -o %t1 --noinhibit-exec
15 # RUN: rm %t.o %t1
16 # RUN: llvm-mc -filetype=obj -triple=ppc64 -defsym HIDDEN=1 %t/asm -o %t.o
17 # RUN: not ld.lld -shared --script %t/lds %t.o -o %t1 2>&1 | FileCheck %s
18 # RUN: ld.lld -shared --script %t/lds %t.o -o %t1 --noinhibit-exec
19 # RUN: rm %t.o %t1
21 ## Note: GNU ld uses sldi 11, 11, 34 and add 12, 11, 12 to support offsets beyond +-2**33.
22 # CHECK: error: R12 setup stub offset is out of range: 8589934592 is not in [-8589934592, 8589934591]; references 'high'
23 # CHECK-NEXT: >>> defined in {{.*}}.o
25 //--- asm
26 .section .text_low, "ax", %progbits
27 .globl _start
28 _start:
29 bl high@notoc
30 blr
32 .section .text_high, "ax", %progbits
33 .ifdef HIDDEN
34 .hidden high
35 .endif
36 .globl high
37 high:
38 blr
40 //--- lds
41 PHDRS {
42 low PT_LOAD FLAGS(0x1 | 0x4);
43 high PT_LOAD FLAGS(0x1 | 0x4);
45 SECTIONS {
46 .text_low 0x2000 : { *(.text_low) } :low
47 .text_high 0x200002010 : { *(.text_high) } :high