]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/Mips/tls-2-64.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / Mips / tls-2-64.test
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.
4
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
8
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
14
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
18 # REL-NEXT: }
19
20 # DYN: 0x000000007000000A MIPS_LOCAL_GOTNO 2
21 # DYN: 0x0000000070000013 MIPS_GOTSYM      0x3
22
23 # SYM: Name: T1@ (1)
24 # SYM: Name: D1@ (4)
25
26 # GOT:      Contents of section .got:
27 # GOT-NEXT:  2000 00000000 00000000 00000000 00000080 ................
28 # GOT-NEXT:  2010 00000000 00000000 00000000 00000000  ................
29
30 ---
31 FileHeader:
32   Class:   ELFCLASS64
33   Data:    ELFDATA2LSB
34   Type:    ET_REL
35   Machine: EM_MIPS
36   Flags:   [EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ARCH_64]
37
38 Sections:
39   - Name:            .text
40     Type:            SHT_PROGBITS
41     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
42     AddressAlign:    4
43     Size:            4
44   - Name:            .rel.text
45     Type:            SHT_RELA
46     Link:            .symtab
47     Info:            .text
48     AddressAlign:    4
49     Relocations:
50       - Offset:      0
51         Symbol:      D1
52         Type:        R_MIPS_TLS_GD
53   - Name:            .tdata
54     Type:            SHT_PROGBITS
55     Flags:           [ SHF_WRITE, SHF_ALLOC, SHF_TLS ]
56     AddressAlign:    4
57     Size:            8
58
59 Symbols:
60   Global:
61     - Name:          T1
62       Type:          STT_FUNC
63       Section:       .text
64       Size:          4
65     - Name:          D1
66       Type:          STT_TLS
67       Section:       .tdata
68       Size:          8
69 ...