[ELF] Make section member orders consistent
[llvm-project.git] / lld / test / ELF / mips-32.s
blob61f1dbfbdb8aa9e27c61ef4bc03c07bd6673e4d4
1 # REQUIRES: mips
2 # Check R_MIPS_32 relocation calculation.
4 # RUN: echo "SECTIONS { \
5 # RUN: . = 0x10000; .data ALIGN(0x1000) : { *(.data) } \
6 # RUN: }" > %t.script
8 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t-be.o
9 # RUN: ld.lld -shared %t-be.o -script %t.script -o %t-be.so
10 # RUN: llvm-objdump -t -s %t-be.so | FileCheck --check-prefixes=SYM,BE %s
11 # RUN: llvm-readelf -r -s --dynamic-table -A %t-be.so \
12 # RUN: | FileCheck -check-prefix=REL %s
14 # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux %s -o %t-el.o
15 # RUN: ld.lld -shared %t-el.o -script %t.script -o %t-el.so
16 # RUN: llvm-objdump -t -s %t-el.so | FileCheck --check-prefixes=SYM,EL %s
17 # RUN: llvm-readelf --dynamic-table -r -s -A %t-el.so \
18 # RUN: | FileCheck -check-prefix=REL %s
20 .data
21 .globl v2
22 v1:
23 .word v2+4 # R_MIPS_32 target v2 addend 4
24 v2:
25 .word v1 # R_MIPS_32 target v1 addend 0
27 # SYM: SYMBOL TABLE:
28 # SYM: 00011000 l .data 00000000 v1
30 # BE: Contents of section .data:
31 # BE-NEXT: {{.*}} 00000004 00011000
32 # ^-- v2+4 ^-- v1
34 # EL: Contents of section .data:
35 # EL-NEXT: {{.*}} 04000000 00100100
36 # ^-- v2+4 ^-- v1
38 # REL: Dynamic section
39 # REL: (RELSZ) 16
40 # REL: (RELENT) 8
41 # REL-NOT: (RELCOUNT)
43 # REL: Relocation section
44 # REL: {{.*}} R_MIPS_REL32 [[V2:[0-9a-f]+]]
45 # REL-NEXT: {{.*}} R_MIPS_REL32 {{$}}
47 # REL: Symbol table
48 # REL: {{.*}}: [[V2]] {{.*}} v2
50 # REL: Global entries
51 # REL: {{.*}} -32744(gp) [[V2]] {{.*}} v2