aboutsummaryrefslogtreecommitdiff
path: root/test/elf/Mips/tls-4.test
blob: fb42f0d93378c362873963a0968655b5bdb0665f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# Check handling of R_MIPS_TLS_LDM relocation and generation of corresponding
# dynamic relocation R_MIPS_TLS_DTPMOD32.

# RUN: yaml2obj -format=elf -docnum 1 -o %t-so1.o %s
# RUN: yaml2obj -format=elf -docnum 2 -o %t-so2.o %s
# RUN: lld -flavor gnu -target mipsel -shared -o %t.so %t-so1.o %t-so2.o

# RUN: llvm-readobj -r %t.so | FileCheck -check-prefix=REL %s
# RUN: llvm-readobj -dynamic-table %t.so | FileCheck -check-prefix=DYN %s
# RUN: llvm-readobj -dt %t.so | FileCheck -check-prefix=SYM %s
# RUN: llvm-objdump -s %t.so | FileCheck -check-prefix=GOT %s

# REL:      Section (4) .rel.dyn {
# REL-NEXT:   0x2008 R_MIPS_TLS_DTPMOD32 - 0x0
# REL-NEXT: }

# DYN: 0x7000000A MIPS_LOCAL_GOTNO 2
# DYN: 0x70000013 MIPS_GOTSYM      0x4

# SYM: Name: @ (0)
# SYM: Name: T1@ (1)
# SYM: Name: T2@ (4)
# SYM: Name: T3@ (7)

# GOT:      Contents of section .got:
# GOT-NEXT:  2000 00000000 00000080 00000000 00000000  ................
#                 Two LDM entries --^--------^

# so1.o
---
FileHeader:
  Class:           ELFCLASS32
  Data:            ELFDATA2LSB
  OSABI:           ELFOSABI_GNU
  Type:            ET_REL
  Machine:         EM_MIPS
  Flags:           [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC,
                     EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2 ]
Sections:
  - Name:            .text
    Type:            SHT_PROGBITS
    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
    AddressAlign:    0x04
    Size:            0x08
  - Name:            .rel.text
    Type:            SHT_REL
    Link:            .symtab
    AddressAlign:    0x04
    Info:            .text
    Relocations:
      - Offset:          0x00
        Symbol:          L01
        Type:            R_MIPS_TLS_LDM
      - Offset:          0x04
        Symbol:          L01
        Type:            R_MIPS_TLS_LDM
  - Name:            .tdata
    Type:            SHT_PROGBITS
    Flags:           [ SHF_WRITE, SHF_ALLOC, SHF_TLS ]
    AddressAlign:    0x04
    Size:            0x04

Symbols:
  Local:
    - Name:            L01
      Type:            STT_TLS
      Section:         .tdata
      Size:            0x04
  Global:
    - Name:            T1
      Type:            STT_FUNC
      Section:         .text
      Value:           0x00
      Size:            0x04
    - Name:            T2
      Type:            STT_FUNC
      Section:         .text
      Value:           0x04
      Size:            0x04

# so2.o
---
FileHeader:
  Class:           ELFCLASS32
  Data:            ELFDATA2LSB
  OSABI:           ELFOSABI_GNU
  Type:            ET_REL
  Machine:         EM_MIPS
  Flags:           [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC,
                     EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2 ]
Sections:
  - Name:            .text
    Type:            SHT_PROGBITS
    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
    AddressAlign:    0x04
    Size:            0x04
  - Name:            .rel.text
    Type:            SHT_REL
    Link:            .symtab
    AddressAlign:    0x04
    Info:            .text
    Relocations:
      - Offset:          0x00
        Symbol:          L02
        Type:            R_MIPS_TLS_LDM
  - Name:            .tdata
    Type:            SHT_PROGBITS
    Flags:           [ SHF_WRITE, SHF_ALLOC, SHF_TLS ]
    AddressAlign:    0x04
    Size:            0x04

Symbols:
  Local:
    - Name:            L02
      Type:            STT_TLS
      Section:         .tdata
      Size:            0x04
  Global:
    - Name:            T3
      Type:            STT_FUNC
      Section:         .text
      Size:            0x04
...