llvm-project/lld/test/elf/Mips/tls-2-64.test

70 lines
2.1 KiB
Plaintext

# Check handling of R_MIPS_TLS_GOTTPREL and R_MIPS_TLS_GD relocations
# and generation of corresponding dynamic relocations R_MIPS_TLS_TPREL64,
# R_MIPS_TLS_DTPMOD64 and R_MIPS_TLS_DTPREL64 in case of shared library.
# Create a shared library with thread symbol D1.
# RUN: yaml2obj -format=elf -o %t-so.o %s
# RUN: lld -flavor gnu -target mips64el -shared -o %t.so %t-so.o
# Check dynamic relocations and GOT in the shared library.
# RUN: llvm-readobj -r %t.so | FileCheck -check-prefix=REL %s
# RUN: llvm-readobj -dynamic-table %t.so | FileCheck -check-prefix=DYN %s
# RUN: llvm-readobj -dt %t.so | FileCheck -check-prefix=SYM %s
# RUN: llvm-objdump -s %t.so | FileCheck -check-prefix=GOT %s
# REL: Section (4) .rel.dyn {
# REL-NEXT: 0x2010 R_MIPS_TLS_DTPMOD64/R_MIPS_NONE/R_MIPS_NONE D1 0x0
# REL-NEXT: 0x2018 R_MIPS_TLS_DTPREL64/R_MIPS_NONE/R_MIPS_NONE D1 0x0
# REL-NEXT: }
# DYN: 0x000000007000000A MIPS_LOCAL_GOTNO 2
# DYN: 0x0000000070000013 MIPS_GOTSYM 0x3
# SYM: Name: T1@ (1)
# SYM: Name: D1@ (4)
# GOT: Contents of section .got:
# GOT-NEXT: 2000 00000000 00000000 00000000 00000080 ................
# GOT-NEXT: 2010 00000000 00000000 00000000 00000000 ................
---
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_MIPS
Flags: [EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ARCH_64]
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
AddressAlign: 4
Size: 4
- Name: .rel.text
Type: SHT_RELA
Link: .symtab
Info: .text
AddressAlign: 4
Relocations:
- Offset: 0
Symbol: D1
Type: R_MIPS_TLS_GD
- Name: .tdata
Type: SHT_PROGBITS
Flags: [ SHF_WRITE, SHF_ALLOC, SHF_TLS ]
AddressAlign: 4
Size: 8
Symbols:
Global:
- Name: T1
Type: STT_FUNC
Section: .text
Size: 4
- Name: D1
Type: STT_TLS
Section: .tdata
Size: 8
...