[ELF] Make section member orders consistent
[llvm-project.git] / lld / test / ELF / riscv-relax-call2.s
blob8b3c8ec1459d1d8bbbbac378088b050906f81766
1 # REQUIRES: riscv
2 # RUN: rm -rf %t && split-file %s %t && cd %t
3 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+c,+relax a.s -o a.o
5 # RUN: ld.lld -T lds a.o -o a
6 # RUN: llvm-objdump -d --no-show-raw-insn -M no-aliases a | FileCheck %s
8 ## Unsure whether this needs a diagnostic. GNU ld allows this.
9 # RUN: ld.lld -T lds -pie a.o -o a.pie
10 # RUN: llvm-objdump -d --no-show-raw-insn -M no-aliases a.pie | FileCheck %s
12 # RUN: ld.lld -T lds -pie -z notext -z ifunc-noplt a.o -o a.ifunc-noplt
13 # RUN: llvm-objdump -d --no-show-raw-insn -M no-aliases a.ifunc-noplt | FileCheck %s --check-prefix=CHECK2
15 # CHECK-LABEL: <_start>:
16 # CHECK-NEXT: jal zero, 0x8 <abs>
17 # CHECK-NEXT: jal zero, 0x8 <abs>
18 # CHECK-NEXT: jal ra, 0x8 <abs>
19 # CHECK-NEXT: auipc t1, 0xfff00
20 # CHECK-NEXT: jalr zero, -0x4(t1)
21 # CHECK-EMPTY:
23 # CHECK-LABEL: <.mid>:
24 # CHECK-NEXT: jal zero, 0x101000
25 # CHECK-NEXT: c.j 0x101000
26 # CHECK-EMPTY:
28 # CHECK2-LABEL: <.mid>:
29 # CHECK2-NEXT: auipc t1, 0x0
30 # CHECK2-NEXT: jalr zero, 0x0(t1)
31 # CHECK2-NEXT: auipc t1, 0x0
32 # CHECK2-NEXT: jalr zero, 0x0(t1)
33 # CHECK2-EMPTY:
35 #--- a.s
36 .global _start, ifunc
37 _start:
38 jump abs, t2
39 jump abs, t3
40 call abs
41 tail abs # not relaxed
43 .section .mid,"ax",@progbits
44 .balign 16
45 tail ifunc@plt # not relaxed
46 tail ifunc@plt
48 .type ifunc, @gnu_indirect_function
49 ifunc:
50 ret
52 #--- lds
53 SECTIONS {
54 .text 0x100000 : { *(.text) }
55 .mid 0x100800 : { *(.mid) }
56 .iplt 0x101000 : { *(.iplt) }
58 abs = 8;