37 lines · plain
1# REQUIRES: mips2# Check that even if _gp_disp symbol is defined in the shared library3# we use our own value.4 5# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o6# RUN: echo "SECTIONS { \7# RUN: . = 0x1000; .text ALIGN(0x1000) : { *(.text) } \8# RUN: . = 0x30000; .got : { *(.got) } \9# RUN: }" > %t.script10# RUN: ld.lld -shared --script %t.script -o %t.so %t.o %S/Inputs/mips-gp-disp.so11# RUN: llvm-readelf --symbols %t.so | FileCheck -check-prefix=INT-SO %s12# RUN: llvm-readelf --symbols %S/Inputs/mips-gp-disp.so \13# RUN: | FileCheck -check-prefix=EXT-SO %s14# RUN: llvm-objdump --no-print-imm-hex -d -t --no-show-raw-insn %t.so | FileCheck --check-prefix=DIS %s15# RUN: llvm-readelf -r %t.so | FileCheck -check-prefix=REL %s16 17# INT-SO: 00000000 0 NOTYPE LOCAL HIDDEN ABS _gp_disp18# EXT-SO: 00020000 0 NOTYPE GLOBAL DEFAULT 9 _gp_disp19 20# DIS: 00037ff0 l .got 00000000 .hidden _gp21# DIS: 00002000 g .text 00000000 __start22# DIS: Disassembly of section .text:23# DIS-EMPTY:24# DIS-NEXT: <__start>:25# DIS-NEXT: lui $8, 326# DIS-NEXT: addi $8, $8, 2456027# ^-- (_gp - __start) & 0xffff28 29# REL: There are no relocations in this file30 31 .text32 .globl __start33__start:34 lui $t0,%hi(_gp_disp)35 addi $t0,$t0,%lo(_gp_disp)36 lw $v0,%call16(_foo)($gp)37