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
|
2020-03-16 08:47:44 +08:00
|
|
|
# RUN: llvm-objdump -d -t --no-show-raw-insn %t.exe | FileCheck --check-prefix=DIS %s
|
2019-10-03 20:08:04 +08:00
|
|
|
# RUN: llvm-readobj -r -A %t.exe | FileCheck %s
|
2016-03-17 20:36:08 +08:00
|
|
|
|
2020-12-22 00:47:04 +08:00
|
|
|
# RUN: not ld.lld %t.o -shared -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR --implicit-check-not=error:
|
|
|
|
|
|
|
|
# ERR: error: relocation R_MIPS_TLS_TPREL_HI16 against loc0 cannot be used with -shared
|
|
|
|
# ERR: error: relocation R_MIPS_TLS_TPREL_LO16 against loc0 cannot be used with -shared
|
2016-04-21 05:57:51 +08:00
|
|
|
|
2021-02-18 15:17:20 +08:00
|
|
|
# DIS: 00000000 l .tdata 00000000 loc0
|
[llvm-objdump] Further rearrange llvm-objdump sections for compatability
Summary:
rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.
I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
* Archive headers
* File headers
* Section headers
* Symbol table
* Dwarf debugging
* Relocations (if `--disassemble` is not used)
* Section contents
* Disassembly
Reviewers: jhenderson, justice_adams, grimar, ychen, espindola
Reviewed By: jhenderson
Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68066
llvm-svn: 373671
2019-10-04 06:01:08 +08:00
|
|
|
|
2020-03-06 06:18:38 +08:00
|
|
|
# DIS: <__start>:
|
2019-09-10 06:04:20 +08:00
|
|
|
# DIS-NEXT: addiu $2, $3, 0
|
|
|
|
# ^-- %hi(loc0 - .tdata - 0x8000)
|
|
|
|
# DIS-NEXT: addiu $2, $3, -32768
|
|
|
|
# ^-- %lo(loc0 - .tdata - 0x8000)
|
|
|
|
# DIS-NEXT: addiu $2, $3, 0
|
|
|
|
# ^-- %hi(loc0 - .tdata - 0x7000)
|
|
|
|
# DIS-NEXT: addiu $2, $3, -28672
|
|
|
|
# ^-- %lo(loc0 - .tdata - 0x7000)
|
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
|