]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/Mips/tls-2-micro.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / Mips / tls-2-micro.test
1 # Check handling of R_MICROMIPS_TLS_GOTTPREL and R_MICROMIPS_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.
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 mipsel -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:   0x2008 R_MIPS_TLS_DTPMOD32 D1 0x0
17 # REL-NEXT:   0x200C R_MIPS_TLS_DTPREL32 D1 0x0
18 # REL-NEXT: }
19
20 # DYN: 0x7000000A MIPS_LOCAL_GOTNO 2
21 # DYN: 0x70000013 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 00000080 00000000 00000000  ................
28
29 ---
30 FileHeader:
31   Class:           ELFCLASS32
32   Data:            ELFDATA2LSB
33   OSABI:           ELFOSABI_GNU
34   Type:            ET_REL
35   Machine:         EM_MIPS
36   Flags:           [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC,
37                      EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2, EF_MIPS_MICROMIPS ]
38 Sections:
39   - Name:            .text
40     Type:            SHT_PROGBITS
41     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
42     AddressAlign:    0x04
43     Size:            0x04
44   - Name:            .rel.text
45     Type:            SHT_REL
46     Link:            .symtab
47     Info:            .text
48     AddressAlign:    0x04
49     Relocations:
50       - Offset:          0x00
51         Symbol:          D1
52         Type:            R_MICROMIPS_TLS_GD
53   - Name:            .tdata
54     Type:            SHT_PROGBITS
55     Flags:           [ SHF_WRITE, SHF_ALLOC, SHF_TLS ]
56     AddressAlign:    0x04
57     Size:            0x04
58
59 Symbols:
60   Global:
61     - Name:            T1
62       Type:            STT_FUNC
63       Section:         .text
64       Size:            0x04
65       Other:           [ STO_MIPS_MICROMIPS ]
66     - Name:            D1
67       Type:            STT_TLS
68       Section:         .tdata
69       Size:            0x04
70 ...