llvm-project/lld/test/ELF/mips-64-rels.s

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
1.8 KiB
ArmAsm
Raw Normal View History

# REQUIRES: mips
# Check handling multiple MIPS N64 ABI relocations packed
# into the single relocation record.
# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t.o
# RUN: ld.lld %t.o -o %t.exe
# RUN: llvm-objdump -d -s -t --no-show-raw-insn %t.exe | FileCheck %s
# RUN: llvm-readobj -r %t.exe | FileCheck -check-prefix=REL %s
# CHECK: __start:
# CHECK-NEXT: 20000: lui $gp, 1
# ^-- 0x20000 - 0x37ff0
# ^-- 0 - 0xfffffffffffe8010
# ^-- %hi(0x17ff0)
# CHECK: loc:
# CHECK-NEXT: 20004: daddiu $gp, $gp, 32752
# ^-- 0x20000 - 0x37ff0
# ^-- 0 - 0xfffffffffffe8010
# ^-- %lo(0x17ff0)
# CHECK: Contents of section .rodata:
# CHECK-NEXT: {{[0-9a-f]+}} ffffffff fffe8014
# ^-- 0x20004 - 0x37ff0 = 0xfffffffffffe8014
# CHECK: 0000000000020004 .text 00000000 loc
# CHECK: 0000000000037ff0 .got 00000000 .hidden _gp
# CHECK: 0000000000020000 .text 00000000 __start
# REL: Relocations [
# REL-NEXT: ]
.text
.global __start
__start:
lui $gp,%hi(%neg(%gp_rel(__start))) # R_MIPS_GPREL16
# R_MIPS_SUB
# R_MIPS_HI16
loc:
daddiu $gp,$gp,%lo(%neg(%gp_rel(__start))) # R_MIPS_GPREL16
# R_MIPS_SUB
# R_MIPS_LO16
.section .rodata,"a",@progbits
.gpdword(loc) # R_MIPS_GPREL32
# R_MIPS_64