diff options
Diffstat (limited to 'test/elf/Mips/dynlib-fileheader.test')
-rw-r--r-- | test/elf/Mips/dynlib-fileheader.test | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/test/elf/Mips/dynlib-fileheader.test b/test/elf/Mips/dynlib-fileheader.test new file mode 100644 index 0000000000000..5dd9d6a64a713 --- /dev/null +++ b/test/elf/Mips/dynlib-fileheader.test @@ -0,0 +1,80 @@ +# Check ELF Header for shared library. + +# Build shared library +# RUN: yaml2obj -format=elf %s > %t.o +# RUN: lld -flavor gnu -target mipsel -shared -o %t.so %t.o +# RUN: llvm-readobj -file-headers %t.so | FileCheck %s + +# CHECK: Format: ELF32-mips +# CHECK: Arch: mipsel +# CHECK: AddressSize: 32bit +# CHECK: LoadName: +# CHECK: ElfHeader { +# CHECK: Ident { +# CHECK: Magic: (7F 45 4C 46) +# CHECK: Class: 32-bit (0x1) +# CHECK: DataEncoding: LittleEndian (0x1) +# CHECK: FileVersion: 1 +# CHECK: OS/ABI: SystemV (0x0) +# CHECK: ABIVersion: 0 +# CHECK: Unused: (00 00 00 00 00 00 00) +# CHECK: } +# CHECK: Type: SharedObject (0x3) +# CHECK: Machine: EM_MIPS (0x8) +# CHECK: Version: 1 +# CHECK: Entry: 0x100 +# CHECK: ProgramHeaderOffset: 0x34 +# CHECK: SectionHeaderOffset: 0x2100 +# CHECK: Flags [ (0x70001007) +# CHECK: EF_MIPS_ABI_O32 (0x1000) +# CHECK: EF_MIPS_ARCH_32R2 (0x70000000) +# CHECK: EF_MIPS_CPIC (0x4) +# CHECK: EF_MIPS_NOREORDER (0x1) +# CHECK: EF_MIPS_PIC (0x2) +# CHECK: ] +# CHECK: HeaderSize: 52 +# CHECK: ProgramHeaderEntrySize: 32 +# CHECK: ProgramHeaderCount: 4 +# CHECK: SectionHeaderEntrySize: 40 +# CHECK: SectionHeaderCount: 11 +# CHECK: StringTableSectionIndex: 8 +# CHECK:} + +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_MIPS + Flags: [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, + EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2 ] +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + AddressAlign: 0x04 + Size: 0x04 + - Name: .data + Type: SHT_PROGBITS + Flags: [ SHF_WRITE, SHF_ALLOC ] + AddressAlign: 0x04 + Size: 0x00 + - Name: .bss + Type: SHT_NOBITS + Flags: [ SHF_WRITE, SHF_ALLOC ] + AddressAlign: 0x04 + Size: 0x00 + - Name: .reginfo + Type: SHT_MIPS_REGINFO + Flags: [ SHF_ALLOC ] + AddressAlign: 0x01 + Size: 0x18 + - Name: .MIPS.abiflags + Type: SHT_MIPS_ABIFLAGS + Flags: [ SHF_ALLOC ] + AddressAlign: 0x08 + Size: 0x18 + +Symbols: + Global: + - Name: glob + Section: .text |