43 lines · plain
1# REQUIRES: mips2# Check MIPS R_MIPS_TLS_DTPREL_HI16/LO16 and R_MIPS_TLS_TPREL_HI16/LO163# relocations handling.4 5# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o6# RUN: ld.lld %t.o -o %t.exe7# RUN: llvm-objdump --no-print-imm-hex -d -t --no-show-raw-insn %t.exe | FileCheck --check-prefix=DIS %s8# RUN: llvm-readobj -r -A %t.exe | FileCheck %s9 10# RUN: not ld.lld %t.o -shared -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR --implicit-check-not=error:11 12# ERR: error: relocation R_MIPS_TLS_TPREL_HI16 against loc0 cannot be used with -shared13# ERR: error: relocation R_MIPS_TLS_TPREL_LO16 against loc0 cannot be used with -shared14 15# DIS: 00000000 l .tdata 00000000 loc016 17# DIS: <__start>:18# DIS-NEXT: addiu $2, $3, 019# ^-- %hi(loc0 - .tdata - 0x8000)20# DIS-NEXT: addiu $2, $3, -3276821# ^-- %lo(loc0 - .tdata - 0x8000)22# DIS-NEXT: addiu $2, $3, 023# ^-- %hi(loc0 - .tdata - 0x7000)24# DIS-NEXT: addiu $2, $3, -2867225# ^-- %lo(loc0 - .tdata - 0x7000)26 27# CHECK: Relocations [28# CHECK-NEXT: ]29# CHECK-NOT: Primary GOT30 31 .text32 .globl __start33 .type __start,@function34__start:35 addiu $2, $3, %dtprel_hi(loc0) # R_MIPS_TLS_DTPREL_HI1636 addiu $2, $3, %dtprel_lo(loc0) # R_MIPS_TLS_DTPREL_LO1637 addiu $2, $3, %tprel_hi(loc0) # R_MIPS_TLS_TPREL_HI1638 addiu $2, $3, %tprel_lo(loc0) # R_MIPS_TLS_TPREL_LO1639 40 .section .tdata,"awT",%progbits41loc0:42 .word 043