43 lines · plain
1# REQUIRES: mips2# Check writing updated addend for R_MIPS_GOT16 relocation,3# when produce a relocatable output.4 5# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux -o %t.o %s6# RUN: ld.lld -r -o %t %t.o %t.o7# RUN: llvm-objdump --no-print-imm-hex -d -r --no-show-raw-insn %t | FileCheck --check-prefix=OBJ %s8# RUN: ld.lld -shared -o %t.so %t9# RUN: llvm-objdump -d -t --print-imm-hex --no-show-raw-insn %t.so \10# RUN: | FileCheck -check-prefix=SO %s11 12# OBJ: Disassembly of section .text:13# OBJ-EMPTY:14# OBJ-NEXT: <.text>:15# OBJ-NEXT: lw $25, 0($gp)16# OBJ-NEXT: 00000000: R_MIPS_GOT16 .data17# OBJ-NEXT: addiu $4, $25, 018# OBJ-NEXT: 00000004: R_MIPS_LO16 .data19# OBJ: lw $25, 0($gp)20# OBJ-NEXT: 00000010: R_MIPS_GOT16 .data21# OBJ-NEXT: addiu $4, $25, 1622# OBJ-NEXT: 00000014: R_MIPS_LO16 .data23 24# SO: SYMBOL TABLE25# SO: {{0*}}[[D1:[0-9a-f]{1,4}]] l .data {{0+}} data26# SO: {{0*}}[[D2:[0-9a-f]{1,4}]] l .data {{0+}} data27 28# SO: Disassembly of section .text:29# SO-EMPTY:30# SO-NEXT: <.text>:31# SO-NEXT: lw $25, -0x7fe8($gp)32# SO-NEXT: addiu $4, $25, 0x[[D1]]33# SO: lw $25, -0x7fe8($gp)34# SO-NEXT: addiu $4, $25, 0x[[D2]]35 36 .text37 lw $t9, %got(.data)($gp)38 addiu $a0, $t9, %lo(.data)39 40 .data41data:42 .word 043