1 # Check handling of R_MIPS_TLS_GOTTPREL and R_MIPS_TLS_GD relocations
2 # and generation of corresponding dynamic relocations R_MIPS_TLS_TPREL64,
3 # R_MIPS_TLS_DTPMOD64 and R_MIPS_TLS_DTPREL64 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 mips64el -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: 0x2010 R_MIPS_TLS_DTPMOD64/R_MIPS_NONE/R_MIPS_NONE D1 0x0
17 # REL-NEXT: 0x2018 R_MIPS_TLS_DTPREL64/R_MIPS_NONE/R_MIPS_NONE D1 0x0
20 # DYN: 0x000000007000000A MIPS_LOCAL_GOTNO 2
21 # DYN: 0x0000000070000013 MIPS_GOTSYM 0x3
26 # GOT: Contents of section .got:
27 # GOT-NEXT: 2000 00000000 00000000 00000000 00000080 ................
28 # GOT-NEXT: 2010 00000000 00000000 00000000 00000000 ................
36 Flags: [EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ARCH_64]
41 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
55 Flags: [ SHF_WRITE, SHF_ALLOC, SHF_TLS ]