1 # Check handling of R_MIPS_TLS_GOTTPREL and R_MIPS_TLS_GD relocations
2 # and generation of corresponding dynamic relocations R_MIPS_TLS_TPREL32,
3 # R_MIPS_TLS_DTPMOD32 and R_MIPS_TLS_DTPREL32 in case of shared library.
5 # Create a shared library with thread symbol D1.
6 # RUN: yaml2obj -format=elf -o %t-so.o %s
7 # RUN: lld -flavor gnu -target mipsel -shared -o %t.so %t-so.o
9 # Check dynamic relocations and GOT in the shared library.
10 # RUN: llvm-readobj -r %t.so | FileCheck -check-prefix=REL %s
11 # RUN: llvm-readobj -dynamic-table %t.so | FileCheck -check-prefix=DYN %s
12 # RUN: llvm-readobj -dt %t.so | FileCheck -check-prefix=SYM %s
13 # RUN: llvm-objdump -s %t.so | FileCheck -check-prefix=GOT %s
15 # REL: Section (4) .rel.dyn {
16 # REL-NEXT: 0x2008 R_MIPS_TLS_DTPMOD32 D1 0x0
17 # REL-NEXT: 0x200C R_MIPS_TLS_DTPREL32 D1 0x0
20 # DYN: 0x7000000A MIPS_LOCAL_GOTNO 2
21 # DYN: 0x70000013 MIPS_GOTSYM 0x3
26 # GOT: Contents of section .got:
27 # GOT-NEXT: 2000 00000000 00000080 00000000 00000000 ................
36 Flags: [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC,
37 EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2 ]
41 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
55 Flags: [ SHF_WRITE, SHF_ALLOC, SHF_TLS ]