48 lines · plain
1# REQUIRES: mips2# Check handling multiple MIPS N64 ABI relocations packed3# into the single relocation record.4 5# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t.o6# RUN: echo "SECTIONS { \7# RUN: . = 0x20000; .text ALIGN(0x1000) : { *(.text) } \8# RUN: . = 0x30000; .got : { *(.got) } \9# RUN: }" > %t.script10# RUN: ld.lld %t.o --script %t.script -o %t.exe11# RUN: llvm-objdump -d -s -t --print-imm-hex --no-show-raw-insn %t.exe | FileCheck %s12# RUN: llvm-readobj -r %t.exe | FileCheck -check-prefix=REL %s13 14# CHECK: 0000000000037ff0 l .got 0000000000000000 .hidden _gp15 16# CHECK: Contents of section .rodata:17# CHECK-NEXT: {{[0-9a-f]+}} ffffffff fffe901418# ^-- 0x21004 - 0x37ff0 = 0xfffffffffffe901419 20# CHECK: <__start>:21# CHECK-NEXT: 21000: lui $gp, 0x122# ^-- 0x21000 - 0x37ff023# ^-- 0 - 0xffffffffffff901024# ^-- %hi(0x16ff0)25# CHECK: <loc>:26# CHECK-NEXT: 21004: daddiu $gp, $gp, 0x6ff027# ^-- 0x21000 - 0x37ff028# ^-- 0 - 0xfffffffffffe901029# ^-- %lo(0x16ff0)30 31# REL: Relocations [32# REL-NEXT: ]33 34 .text35 .global __start36__start:37 lui $gp,%hi(%neg(%gp_rel(__start))) # R_MIPS_GPREL1638 # R_MIPS_SUB39 # R_MIPS_HI1640loc:41 daddiu $gp,$gp,%lo(%neg(%gp_rel(__start))) # R_MIPS_GPREL1642 # R_MIPS_SUB43 # R_MIPS_LO1644 45 .section .rodata,"a",@progbits46 .gpdword(loc) # R_MIPS_GPREL3247 # R_MIPS_6448