1# REQUIRES: mips 2# Check the order of dynamic symbols for the MIPS target. 3 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 7 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 11 12 .data 13 .globl v1,v2,v3 14v1: 15 .space 4 16v2: 17 .space 4 18v3: 19 .space 4 20 21 .text 22 .globl __start 23__start: 24 lui $2, %got(v3) # v3 will precede v1 in the GOT 25 lui $2, %got(v1) 26 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: ] 34 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: ] 43