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