]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/mips-gprel32-relocs-gp0.s
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / mips-gprel32-relocs-gp0.s
1 # REQUIRES: mips
2 # Check that relocatable object produced by LLD has zero gp0 value.
3
4 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
5 # RUN: ld.lld -r -o %t-rel.o %t.o
6 # RUN: llvm-readobj -mips-reginfo %t-rel.o | FileCheck --check-prefix=REL %s
7
8 # RUN: ld.lld -shared -o %t.so %S/Inputs/mips-gp0-non-zero.o
9 # RUN: llvm-readobj -mips-reginfo %t.so | FileCheck --check-prefix=DSO %s
10 # RUN: llvm-objdump -s -t %t.so | FileCheck --check-prefix=DUMP %s
11
12 # REL: GP: 0x0
13
14 # DSO: GP: 0x27FF0
15
16 # DUMP: Contents of section .rodata:
17 # DUMP:  {{[0-9a-f]+}} ffff0004 ffff0008
18 #                      ^ 0x10004 + 0x7ff0 - 0x27ff0
19 #                               ^ 0x10008 + 0x7ff0 - 0x27ff0
20
21 # DUMP: SYMBOL TABLE:
22 # DUMP: 00010008         .text          00000000 bar
23 # DUMP: 00010004         .text          00000000 foo
24 # DUMP: 00027ff0         .got           00000000 .hidden _gp
25
26   .text
27   .global  __start
28 __start:
29   lw      $t0,%call16(__start)($gp)
30 foo:
31   nop
32 bar:
33   nop
34
35   .section .rodata, "a"
36 v:
37   .gpword foo
38   .gpword bar