2 # Check handling multiple MIPS N64 ABI relocations packed
3 # into the single relocation record.
5 # RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t.o
6 # RUN: echo "SECTIONS { \
7 # RUN: . = 0x20000; .text ALIGN(0x1000) : { *(.text) } \
8 # RUN: . = 0x30000; .got : { *(.got) } \
10 # RUN: ld.lld %t.o --script %t.script -o %t.exe
11 # RUN: llvm-objdump -d -s -t --print-imm-hex --no-show-raw-insn %t.exe | FileCheck %s
12 # RUN: llvm-readobj -r %t.exe | FileCheck -check-prefix=REL %s
14 # CHECK: 0000000000037ff0 l .got 0000000000000000 .hidden _gp
16 # CHECK: Contents of section .rodata:
17 # CHECK-NEXT: {{[0-9a-f]+}} ffffffff fffe9014
18 # ^-- 0x21004 - 0x37ff0 = 0xfffffffffffe9014
21 # CHECK-NEXT: 21000: lui $gp, 0x1
22 # ^-- 0x21000 - 0x37ff0
23 # ^-- 0 - 0xffffffffffff9010
26 # CHECK-NEXT: 21004: daddiu $gp, $gp, 0x6ff0
27 # ^-- 0x21000 - 0x37ff0
28 # ^-- 0 - 0xfffffffffffe9010
37 lui $gp
,%hi
(%neg(%gp_rel
(__start
))) # R_MIPS_GPREL16
41 daddiu $gp
,$gp
,%lo
(%neg(%gp_rel
(__start
))) # R_MIPS_GPREL16
45 .section .rodata,"a",@progbits
46 .gpdword(loc) # R_MIPS_GPREL32