]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/Mips/dynlib-fileheader.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / Mips / dynlib-fileheader.test
1 # Check ELF Header for shared library.
2
3 # Build shared library
4 # RUN: yaml2obj -format=elf %s > %t.o
5 # RUN: lld -flavor gnu -target mipsel -shared -o %t.so %t.o
6 # RUN: llvm-readobj -file-headers %t.so | FileCheck %s
7
8 # CHECK: Format: ELF32-mips
9 # CHECK: Arch: mipsel
10 # CHECK: AddressSize: 32bit
11 # CHECK: LoadName:
12 # CHECK: ElfHeader {
13 # CHECK:   Ident {
14 # CHECK:    Magic: (7F 45 4C 46)
15 # CHECK:    Class: 32-bit (0x1)
16 # CHECK:    DataEncoding: LittleEndian (0x1)
17 # CHECK:    FileVersion: 1
18 # CHECK:    OS/ABI: SystemV (0x0)
19 # CHECK:    ABIVersion: 0
20 # CHECK:    Unused: (00 00 00 00 00 00 00)
21 # CHECK:  }
22 # CHECK:  Type: SharedObject (0x3)
23 # CHECK:  Machine: EM_MIPS (0x8)
24 # CHECK:  Version: 1
25 # CHECK:  Entry: 0x100
26 # CHECK:  ProgramHeaderOffset: 0x34
27 # CHECK:  SectionHeaderOffset: 0x2100
28 # CHECK:  Flags [ (0x70001007)
29 # CHECK:    EF_MIPS_ABI_O32 (0x1000)
30 # CHECK:    EF_MIPS_ARCH_32R2 (0x70000000)
31 # CHECK:    EF_MIPS_CPIC (0x4)
32 # CHECK:    EF_MIPS_NOREORDER (0x1)
33 # CHECK:    EF_MIPS_PIC (0x2)
34 # CHECK:  ]
35 # CHECK:  HeaderSize: 52
36 # CHECK:  ProgramHeaderEntrySize: 32
37 # CHECK:  ProgramHeaderCount: 4
38 # CHECK:  SectionHeaderEntrySize: 40
39 # CHECK:  SectionHeaderCount: 11
40 # CHECK:  StringTableSectionIndex: 8
41 # CHECK:}
42
43 FileHeader:
44   Class:           ELFCLASS32
45   Data:            ELFDATA2LSB
46   Type:            ET_REL
47   Machine:         EM_MIPS
48   Flags:           [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC,
49                      EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2 ]
50 Sections:
51   - Name:            .text
52     Type:            SHT_PROGBITS
53     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
54     AddressAlign:    0x04
55     Size:            0x04
56   - Name:            .data
57     Type:            SHT_PROGBITS
58     Flags:           [ SHF_WRITE, SHF_ALLOC ]
59     AddressAlign:    0x04
60     Size:            0x00
61   - Name:            .bss
62     Type:            SHT_NOBITS
63     Flags:           [ SHF_WRITE, SHF_ALLOC ]
64     AddressAlign:    0x04
65     Size:            0x00
66   - Name:            .reginfo
67     Type:            SHT_MIPS_REGINFO
68     Flags:           [ SHF_ALLOC ]
69     AddressAlign:    0x01
70     Size:            0x18
71   - Name:            .MIPS.abiflags
72     Type:            SHT_MIPS_ABIFLAGS
73     Flags:           [ SHF_ALLOC ]
74     AddressAlign:    0x08
75     Size:            0x18
76
77 Symbols:
78   Global:
79     - Name:            glob
80       Section:         .text