]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/Mips/tls-4-micro.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / Mips / tls-4-micro.test
1 # Check handling of R_MICROMIPS_TLS_LDM relocation and generation
2 # of corresponding dynamic relocation R_MICROMIPS_TLS_DTPMOD32.
3
4 # RUN: yaml2obj -format=elf -docnum 1 -o %t-so1.o %s
5 # RUN: yaml2obj -format=elf -docnum 2 -o %t-so2.o %s
6 # RUN: lld -flavor gnu -target mipsel -shared -o %t.so %t-so1.o %t-so2.o
7
8 # RUN: llvm-readobj -r %t.so | FileCheck -check-prefix=REL %s
9 # RUN: llvm-readobj -dynamic-table %t.so | FileCheck -check-prefix=DYN %s
10 # RUN: llvm-readobj -dt %t.so | FileCheck -check-prefix=SYM %s
11 # RUN: llvm-objdump -s %t.so | FileCheck -check-prefix=GOT %s
12
13 # REL:      Section (4) .rel.dyn {
14 # REL-NEXT:   0x2008 R_MIPS_TLS_DTPMOD32 - 0x0
15 # REL-NEXT: }
16
17 # DYN: 0x7000000A MIPS_LOCAL_GOTNO 2
18 # DYN: 0x70000013 MIPS_GOTSYM      0x4
19
20 # SYM: Name: @ (0)
21 # SYM: Name: T1@ (1)
22 # SYM: Name: T2@ (4)
23 # SYM: Name: T3@ (7)
24
25 # GOT:      Contents of section .got:
26 # GOT-NEXT:  2000 00000000 00000080 00000000 00000000  ................
27 #                 Two LDM entries --^--------^
28
29 # so1.o
30 ---
31 FileHeader:
32   Class:           ELFCLASS32
33   Data:            ELFDATA2LSB
34   OSABI:           ELFOSABI_GNU
35   Type:            ET_REL
36   Machine:         EM_MIPS
37   Flags:           [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC,
38                      EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2, EF_MIPS_MICROMIPS ]
39 Sections:
40   - Name:            .text
41     Type:            SHT_PROGBITS
42     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
43     AddressAlign:    0x04
44     Size:            0x08
45   - Name:            .rel.text
46     Type:            SHT_REL
47     Link:            .symtab
48     AddressAlign:    0x04
49     Info:            .text
50     Relocations:
51       - Offset:          0x00
52         Symbol:          L01
53         Type:            R_MICROMIPS_TLS_LDM
54       - Offset:          0x04
55         Symbol:          L01
56         Type:            R_MICROMIPS_TLS_LDM
57   - Name:            .tdata
58     Type:            SHT_PROGBITS
59     Flags:           [ SHF_WRITE, SHF_ALLOC, SHF_TLS ]
60     AddressAlign:    0x04
61     Size:            0x04
62
63 Symbols:
64   Local:
65     - Name:            L01
66       Type:            STT_TLS
67       Section:         .tdata
68       Size:            0x04
69   Global:
70     - Name:            T1
71       Type:            STT_FUNC
72       Section:         .text
73       Value:           0x00
74       Size:            0x04
75       Other:           [ STO_MIPS_MICROMIPS ]
76     - Name:            T2
77       Type:            STT_FUNC
78       Section:         .text
79       Value:           0x04
80       Size:            0x04
81       Other:           [ STO_MIPS_MICROMIPS ]
82
83 # so2.o
84 ---
85 FileHeader:
86   Class:           ELFCLASS32
87   Data:            ELFDATA2LSB
88   OSABI:           ELFOSABI_GNU
89   Type:            ET_REL
90   Machine:         EM_MIPS
91   Flags:           [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC,
92                      EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2, EF_MIPS_MICROMIPS ]
93 Sections:
94   - Name:            .text
95     Type:            SHT_PROGBITS
96     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
97     AddressAlign:    0x04
98     Size:            0x04
99   - Name:            .rel.text
100     Type:            SHT_REL
101     Link:            .symtab
102     AddressAlign:    0x04
103     Info:            .text
104     Relocations:
105       - Offset:          0x00
106         Symbol:          L02
107         Type:            R_MICROMIPS_TLS_LDM
108   - Name:            .tdata
109     Type:            SHT_PROGBITS
110     Flags:           [ SHF_WRITE, SHF_ALLOC, SHF_TLS ]
111     AddressAlign:    0x04
112     Size:            0x04
113
114 Symbols:
115   Local:
116     - Name:            L02
117       Type:            STT_TLS
118       Section:         .tdata
119       Size:            0x04
120   Global:
121     - Name:            T3
122       Type:            STT_FUNC
123       Section:         .text
124       Size:            0x04
125       Other:           [ STO_MIPS_MICROMIPS ]
126 ...