]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/Mips/e-flags-merge-3-64.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / Mips / e-flags-merge-3-64.test
1 # Check PIC/CPIC flags merging in case of multiple input objects.
2
3 # RUN: yaml2obj -format=elf -docnum 1 %s > %t-none.o
4 # RUN: yaml2obj -format=elf -docnum 2 %s > %t-cpic.o
5 # RUN: yaml2obj -format=elf -docnum 3 %s > %t-pic.o
6 # RUN: yaml2obj -format=elf -docnum 4 %s > %t-both.o
7
8 # RUN: lld -flavor gnu -target mips64el -e T1 -o %t-abi1.exe \
9 # RUN:     %t-none.o %t-pic.o 2>&1 | FileCheck -check-prefix=ABI-CALLS-WARN %s
10 # RUN: llvm-readobj -file-headers %t-abi1.exe \
11 # RUN:              | FileCheck -check-prefix=ABI-CALLS1 %s
12
13 # RUN: lld -flavor gnu -target mips64el -e T1 -o %t-abi2.exe \
14 # RUN:     %t-cpic.o %t-none.o 2>&1 | FileCheck -check-prefix=ABI-CALLS-WARN %s
15 # RUN: llvm-readobj -file-headers %t-abi2.exe \
16 # RUN:              | FileCheck -check-prefix=ABI-CALLS2 %s
17
18 # RUN: lld -flavor gnu -target mips64el -e T2 -o %t-cpic.exe %t-cpic.o %t-pic.o
19 # RUN: llvm-readobj -file-headers %t-cpic.exe | FileCheck -check-prefix=CPIC %s
20
21 # RUN: lld -flavor gnu -target mips64el -e T3 -o %t-both.exe %t-pic.o %t-both.o
22 # RUN: llvm-readobj -file-headers %t-both.exe | FileCheck -check-prefix=BOTH %s
23
24 # ABI-CALLS-WARN: lld warning: linking abicalls and non-abicalls files
25
26 # ABI-CALLS1:      Flags [ (0x60000004)
27 # ABI-CALLS1-NEXT:   EF_MIPS_ARCH_64 (0x60000000)
28 # ABI-CALLS1-NEXT:   EF_MIPS_CPIC (0x4)
29 # ABI-CALLS1-NEXT: ]
30
31 # ABI-CALLS2:      Flags [ (0x60000004)
32 # ABI-CALLS2-NEXT:   EF_MIPS_ARCH_64 (0x60000000)
33 # ABI-CALLS2-NEXT:   EF_MIPS_CPIC (0x4)
34 # ABI-CALLS2-NEXT: ]
35
36 # CPIC:      Flags [ (0x60000004)
37 # CPIC-NEXT:   EF_MIPS_ARCH_64 (0x60000000)
38 # CPIC-NEXT:   EF_MIPS_CPIC (0x4)
39 # CPIC-NEXT: ]
40
41 # BOTH:      Flags [ (0x60000006)
42 # BOTH-NEXT:   EF_MIPS_ARCH_64 (0x60000000)
43 # BOTH-NEXT:   EF_MIPS_CPIC (0x4)
44 # BOTH-NEXT:   EF_MIPS_PIC (0x2)
45 # BOTH-NEXT: ]
46
47 # none.o
48 ---
49 FileHeader:
50   Class:           ELFCLASS64
51   Data:            ELFDATA2LSB
52   Type:            ET_REL
53   Machine:         EM_MIPS
54   Flags:           [EF_MIPS_ARCH_64]
55
56 Sections:
57   - Name:          .text
58     Type:          SHT_PROGBITS
59     Flags:         [ SHF_ALLOC, SHF_EXECINSTR ]
60     AddressAlign:  0x10
61     Size:          0x08
62
63 Symbols:
64   Global:
65     - Name:        T1
66       Section:     .text
67
68 # cpic.o
69 ---
70 FileHeader:
71   Class:           ELFCLASS64
72   Data:            ELFDATA2LSB
73   Type:            ET_REL
74   Machine:         EM_MIPS
75   Flags:           [EF_MIPS_ARCH_64, EF_MIPS_CPIC]
76
77 Sections:
78   - Name:          .text
79     Type:          SHT_PROGBITS
80     Flags:         [ SHF_ALLOC, SHF_EXECINSTR ]
81     AddressAlign:  0x10
82     Size:          0x08
83
84 Symbols:
85   Global:
86     - Name:        T2
87       Section:     .text
88
89 # pic.o
90 ---
91 FileHeader:
92   Class:           ELFCLASS64
93   Data:            ELFDATA2LSB
94   Type:            ET_REL
95   Machine:         EM_MIPS
96   Flags:           [EF_MIPS_ARCH_64, EF_MIPS_PIC]
97
98 Sections:
99   - Name:          .text
100     Type:          SHT_PROGBITS
101     Flags:         [ SHF_ALLOC, SHF_EXECINSTR ]
102     AddressAlign:  0x10
103     Size:          0x08
104
105 Symbols:
106   Global:
107     - Name:        T3
108       Section:     .text
109
110 # both.o
111 ---
112 FileHeader:
113   Class:           ELFCLASS64
114   Data:            ELFDATA2LSB
115   Type:            ET_REL
116   Machine:         EM_MIPS
117   Flags:           [EF_MIPS_ARCH_64, EF_MIPS_CPIC, EF_MIPS_PIC]
118
119 Sections:
120   - Name:          .text
121     Type:          SHT_PROGBITS
122     Flags:         [ SHF_ALLOC, SHF_EXECINSTR ]
123     AddressAlign:  0x10
124     Size:          0x08
125
126 Symbols:
127   Global:
128     - Name:        T4
129       Section:     .text
130 ...