2 # Check that even if _gp_disp symbol is defined in the shared library
3 # we use our own value.
5 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
6 # RUN: echo "SECTIONS { \
7 # RUN: . = 0x1000; .text ALIGN(0x1000) : { *(.text) } \
8 # RUN: . = 0x30000; .got : { *(.got) } \
10 # RUN: ld.lld -shared --script %t.script -o %t.so %t.o %S/Inputs/mips-gp-disp.so
11 # RUN: llvm-readelf --symbols %t.so | FileCheck -check-prefix=INT-SO %s
12 # RUN: llvm-readelf --symbols %S/Inputs/mips-gp-disp.so \
13 # RUN: | FileCheck -check-prefix=EXT-SO %s
14 # RUN: llvm-objdump --no-print-imm-hex -d -t --no-show-raw-insn %t.so | FileCheck --check-prefix=DIS %s
15 # RUN: llvm-readelf -r %t.so | FileCheck -check-prefix=REL %s
17 # INT-SO: 00000000 0 NOTYPE LOCAL HIDDEN ABS _gp_disp
18 # EXT-SO: 00020000 0 NOTYPE GLOBAL DEFAULT 9 _gp_disp
20 # DIS: 00037ff0 l .got 00000000 .hidden _gp
21 # DIS: 00002000 g .text 00000000 __start
22 # DIS: Disassembly of section .text:
24 # DIS-NEXT: <__start>:
26 # DIS-NEXT: addi $8, $8, 24560
27 # ^-- (_gp - __start) & 0xffff
29 # REL: There are no relocations in this file
35 addi $t0
,$t0
,%lo
(_gp_disp
)
36 lw $v0
,%call16
(_foo
)($gp
)