]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/Mips/rel-dynamic-11.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / Mips / rel-dynamic-11.test
1 # Conditions:
2 #   a) Linking a shared library.
3 #   b) Relocations' targets are symbols defined in the other shared object.
4 # Check:
5 #   a) Emitting R_MIPS_REL32 relocations for both symbols.
6 #   b) There should be no PLT entries.
7 #
8 # RUN: yaml2obj -format=elf -docnum 1 %s > %t-so.o
9 # RUN: lld -flavor gnu -target mipsel -shared -o %t1.so %t-so.o
10 # RUN: yaml2obj -format=elf -docnum 2 %s > %t-o.o
11 # RUN: lld -flavor gnu -target mipsel -shared -o %t2.so %t-o.o %t1.so
12 # RUN: llvm-readobj -dt -r -s %t2.so | FileCheck -check-prefix=PLT-SYM %s
13
14 # PLT-SYM:     Sections [
15 # PLT-SYM:       Section {
16 # PLT-SYM-NOT:     Name: .plt ({{[0-9]+}})
17 #
18 # PLT-SYM:      Relocations [
19 # PLT-SYM-NEXT:   Section (4) .rel.dyn {
20 # PLT-SYM-NEXT:     0x150 R_MIPS_REL32 T1 0x0
21 # PLT-SYM-NEXT:     0x2000 R_MIPS_REL32 T1 0x0
22 # PLT-SYM-NEXT:   }
23 # PLT-SYM-NEXT: ]
24 #
25 # PLT-SYM:      Name: T1@ (7)
26 # PLT-SYM-NEXT: Value: 0x0
27 # PLT-SYM-NEXT: Size: 0
28 # PLT-SYM-NEXT: Binding: Global (0x1)
29 # PLT-SYM-NEXT: Type: Function (0x2)
30 # PLT-SYM-NEXT: Other: 0
31 # PLT-SYM-NEXT: Section: Undefined (0x0)
32
33 # so.o
34 ---
35 FileHeader:
36   Class:   ELFCLASS32
37   Data:    ELFDATA2LSB
38   Type:    ET_REL
39   Machine: EM_MIPS
40   Flags:   [EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32]
41
42 Sections:
43 - Name:         .text
44   Type:         SHT_PROGBITS
45   Size:         0x0C
46   AddressAlign: 16
47   Flags:        [SHF_EXECINSTR, SHF_ALLOC]
48
49 Symbols:
50   Global:
51     - Name: T1
52       Section: .text
53       Type: STT_FUNC
54       Value: 0x0
55       Size: 4
56
57 # o.o
58 ---
59 FileHeader:
60   Class: ELFCLASS32
61   Data: ELFDATA2LSB
62   Type: ET_REL
63   Machine: EM_MIPS
64   Flags: [EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32]
65
66 Sections:
67 - Name: .text
68   Type: SHT_PROGBITS
69   Size: 0x08
70   AddressAlign: 16
71   Flags: [SHF_EXECINSTR, SHF_ALLOC]
72
73 - Name: .data
74   Type: SHT_PROGBITS
75   Size: 0x08
76   AddressAlign: 16
77   Flags: [SHF_WRITE, SHF_ALLOC]
78
79 - Name: .rel.text
80   Type: SHT_REL
81   Info: .text
82   AddressAlign: 4
83   Relocations:
84     - Offset: 0x00
85       Symbol: T1
86       Type: R_MIPS_32
87
88 - Name: .rel.data
89   Type: SHT_REL
90   Info: .data
91   AddressAlign: 4
92   Relocations:
93     - Offset: 0x00
94       Symbol: T1
95       Type: R_MIPS_32
96
97 Symbols:
98   Global:
99     - Name: T0
100       Section: .text
101       Type: STT_FUNC
102       Value: 0x0
103       Size: 4
104     - Name: T1
105     - Name: D0
106       Section: .data
107       Type: STT_OBJECT
108       Value: 0x0
109       Size: 8
110 ...