2018-06-27 00:58:19 +08:00
|
|
|
# REQUIRES: mips
|
2016-03-17 20:36:08 +08:00
|
|
|
# Check MIPS R_MIPS_TLS_DTPREL_HI16/LO16 and R_MIPS_TLS_TPREL_HI16/LO16
|
|
|
|
# relocations handling.
|
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
|
|
|
|
# RUN: ld.lld %t.o -o %t.exe
|
2019-07-25 15:12:23 +08:00
|
|
|
# RUN: llvm-objdump -d -t --no-show-raw-insn %t.exe | FileCheck -check-prefix=DIS %s
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj -r --mips-plt-got %t.exe | FileCheck %s
|
2016-03-17 20:36:08 +08:00
|
|
|
|
2016-04-21 05:57:51 +08:00
|
|
|
# RUN: ld.lld %t.o -shared -o %t.so
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj -r --mips-plt-got %t.so | FileCheck -check-prefix=SO %s
|
2016-04-21 05:57:51 +08:00
|
|
|
|
2016-03-17 20:36:08 +08:00
|
|
|
# DIS: __start:
|
2019-07-25 15:12:23 +08:00
|
|
|
# DIS-NEXT: 20000: addiu $2, $3, 0
|
2016-03-17 20:36:08 +08:00
|
|
|
# %hi(loc0 - .tdata - 0x8000) --^
|
2019-07-25 15:12:23 +08:00
|
|
|
# DIS-NEXT: 20004: addiu $2, $3, -32768
|
2016-03-17 20:36:08 +08:00
|
|
|
# %lo(loc0 - .tdata - 0x8000) --^
|
2019-07-25 15:12:23 +08:00
|
|
|
# DIS-NEXT: 20008: addiu $2, $3, 0
|
2016-03-17 20:36:08 +08:00
|
|
|
# %hi(loc0 - .tdata - 0x7000) --^
|
2019-07-25 15:12:23 +08:00
|
|
|
# DIS-NEXT: 2000c: addiu $2, $3, -28672
|
2016-03-17 20:36:08 +08:00
|
|
|
# %lo(loc0 - .tdata - 0x7000) --^
|
|
|
|
|
2018-11-12 02:49:05 +08:00
|
|
|
# DIS: 00000000 l O .tdata 00000000 loc0
|
2016-03-17 20:36:08 +08:00
|
|
|
|
|
|
|
# CHECK: Relocations [
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NOT: Primary GOT
|
|
|
|
|
2016-04-21 05:57:51 +08:00
|
|
|
# SO: Relocations [
|
|
|
|
# SO-NEXT: ]
|
|
|
|
# SO: Primary GOT {
|
|
|
|
# SO: Local entries [
|
|
|
|
# SO-NEXT: ]
|
|
|
|
# SO-NEXT: Global entries [
|
|
|
|
# SO-NEXT: ]
|
|
|
|
# SO-NEXT: Number of TLS and multi-GOT entries: 0
|
|
|
|
# SO-NEXT: }
|
|
|
|
|
2016-03-17 20:36:08 +08:00
|
|
|
.text
|
|
|
|
.globl __start
|
|
|
|
.type __start,@function
|
|
|
|
__start:
|
|
|
|
addiu $2, $3, %dtprel_hi(loc0) # R_MIPS_TLS_DTPREL_HI16
|
|
|
|
addiu $2, $3, %dtprel_lo(loc0) # R_MIPS_TLS_DTPREL_LO16
|
|
|
|
addiu $2, $3, %tprel_hi(loc0) # R_MIPS_TLS_TPREL_HI16
|
|
|
|
addiu $2, $3, %tprel_lo(loc0) # R_MIPS_TLS_TPREL_LO16
|
|
|
|
|
|
|
|
.section .tdata,"awT",%progbits
|
|
|
|
loc0:
|
|
|
|
.word 0
|