]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/Mips/exe-fileheader.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / Mips / exe-fileheader.test
1 # Check ELF Header for non-pic executable file.
2
3 # Build shared library
4 # RUN: yaml2obj -format=elf -docnum 1 %s > %t-so.o
5 # RUN: lld -flavor gnu -target mipsel -shared -o %t.so %t-so.o
6
7 # Build executable
8 # RUN: yaml2obj -format=elf -docnum 2 %s > %t-o.o
9 # RUN: lld -flavor gnu -target mipsel -e glob -o %t.exe %t-o.o %t.so
10 # RUN: llvm-readobj -file-headers %t.exe | FileCheck %s
11
12 # CHECK: Format: ELF32-mips
13 # CHECK: Arch: mipsel
14 # CHECK: AddressSize: 32bit
15 # CHECK: LoadName:
16 # CHECK: ElfHeader {
17 # CHECK:   Ident {
18 # CHECK:     Magic: (7F 45 4C 46)
19 # CHECK:     Class: 32-bit (0x1)
20 # CHECK:     DataEncoding: LittleEndian (0x1)
21 # CHECK:     FileVersion: 1
22 # CHECK:     OS/ABI: SystemV (0x0)
23 # CHECK:     ABIVersion: 1
24 # CHECK:     Unused: (00 00 00 00 00 00 00)
25 # CHECK:   }
26 # CHECK:   Type: Executable (0x2)
27 # CHECK:   Machine: EM_MIPS (0x8)
28 # CHECK:   Version: 1
29 # CHECK:   Entry: 0x400190
30 # CHECK:   ProgramHeaderOffset: 0x34
31 # CHECK:   SectionHeaderOffset: 0x2280
32 # CHECK:   Flags [ (0x70001005)
33 # CHECK:     EF_MIPS_ABI_O32 (0x1000)
34 # CHECK:     EF_MIPS_ARCH_32R2 (0x70000000)
35 # CHECK:     EF_MIPS_CPIC (0x4)
36 # CHECK:     EF_MIPS_NOREORDER (0x1)
37 # CHECK:   ]
38 # CHECK:   HeaderSize: 52
39 # CHECK:   ProgramHeaderEntrySize: 32
40 # CHECK:   ProgramHeaderCount: 6
41 # CHECK:   SectionHeaderEntrySize: 40
42 # CHECK:   SectionHeaderCount: 14
43 # CHECK:   StringTableSectionIndex: 11
44 # CHECK: }
45
46 # so.o
47 ---
48 FileHeader:
49   Class:   ELFCLASS32
50   Data:    ELFDATA2LSB
51   Type:    ET_REL
52   Machine: EM_MIPS
53   Flags:   [EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC,
54             EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2]
55
56 Sections:
57 - Name:         .text
58   Type:         SHT_PROGBITS
59   Size:         0x0C
60   AddressAlign: 16
61   Flags:        [SHF_EXECINSTR, SHF_ALLOC]
62
63 Symbols:
64   Global:
65     - Name:    T1
66       Section: .text
67       Type:    STT_FUNC
68       Value:   0x0
69       Size:    4
70
71 # o.o
72 ---
73 FileHeader:
74   Class:           ELFCLASS32
75   Data:            ELFDATA2LSB
76   Type:            ET_REL
77   Machine:         EM_MIPS
78   Flags:           [ EF_MIPS_NOREORDER, EF_MIPS_CPIC,
79                      EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
80 Sections:
81   - Name:            .text
82     Type:            SHT_PROGBITS
83     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
84     AddressAlign:    0x04
85     Size:            0x08
86   - Name:            .rel.text
87     Type:            SHT_REL
88     Link:            .symtab
89     AddressAlign:    0x04
90     Info:            .text
91     Relocations:
92       - Offset:          0x00
93         Symbol:          T1
94         Type:            R_MIPS_26
95
96 Symbols:
97   Local:
98     - Name:            .text
99       Type:            STT_SECTION
100       Section:         .text
101   Global:
102     - Name:            glob
103       Section:         .text
104     - Name:            T1
105 ...