[ELF] Make SyntheticSection parameter order match InputSection
[llvm-project.git] / lld / test / ELF / mips-dynsym-sort.s
blob413d2e7156de919d3220437d893c5326f7d8ffc1
1 # REQUIRES: mips
2 # Check the order of dynamic symbols for the MIPS target.
4 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t-be.o
5 # RUN: ld.lld -shared %t-be.o -o %t-be.so
6 # RUN: llvm-readobj --symbols --dyn-syms %t-be.so | FileCheck %s
8 # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux %s -o %t-el.o
9 # RUN: ld.lld -shared %t-el.o -o %t-el.so
10 # RUN: llvm-readobj --symbols --dyn-syms %t-el.so | FileCheck %s
12 .data
13 .globl v1,v2,v3
14 v1:
15 .space 4
16 v2:
17 .space 4
18 v3:
19 .space 4
21 .text
22 .globl __start
23 __start:
24 lui $2, %got(v3) # v3 will precede v1 in the GOT
25 lui $2, %got(v1)
27 # Since all these symbols have global binding,
28 # the Symbols section contains them in the original order.
29 # CHECK: Symbols [
30 # CHECK: Name: v1
31 # CHECK: Name: v2
32 # CHECK: Name: v3
33 # CHECK: ]
35 # The symbols in the DynamicSymbols section are sorted in compliance with
36 # the MIPS rules. v2 comes first as it is not in the GOT.
37 # v1 and v3 are sorted according to their order in the GOT.
38 # CHECK: DynamicSymbols [
39 # CHECK: Name: v2
40 # CHECK: Name: v3
41 # CHECK: Name: v1
42 # CHECK: ]