forked from OSchip/llvm-project
70 lines
2.1 KiB
Plaintext
70 lines
2.1 KiB
Plaintext
# Check ELF Header for non-pic executable file in case
|
|
# of microMIPS entry symbol.
|
|
|
|
# Build executable
|
|
# RUN: yaml2obj -format=elf %s > %t-o.o
|
|
# RUN: lld -flavor old-gnu -target mipsel -e glob -o %t.exe %t-o.o
|
|
# RUN: llvm-readobj -file-headers %t.exe | FileCheck %s
|
|
|
|
# CHECK: Format: ELF32-mips
|
|
# CHECK-NEXT: Arch: mipsel
|
|
# CHECK-NEXT: AddressSize: 32bit
|
|
# CHECK-NEXT: LoadName:
|
|
# CHECK-NEXT: ElfHeader {
|
|
# CHECK-NEXT: Ident {
|
|
# CHECK-NEXT: Magic: (7F 45 4C 46)
|
|
# CHECK-NEXT: Class: 32-bit (0x1)
|
|
# CHECK-NEXT: DataEncoding: LittleEndian (0x1)
|
|
# CHECK-NEXT: FileVersion: 1
|
|
# CHECK-NEXT: OS/ABI: SystemV (0x0)
|
|
# CHECK-NEXT: ABIVersion: 1
|
|
# CHECK-NEXT: Unused: (00 00 00 00 00 00 00)
|
|
# CHECK-NEXT: }
|
|
# CHECK-NEXT: Type: Executable (0x2)
|
|
# CHECK-NEXT: Machine: EM_MIPS (0x8)
|
|
# CHECK-NEXT: Version: 1
|
|
# CHECK-NEXT: Entry: 0x{{[0-9A-F]+[13579bdf]}}
|
|
# CHECK-NEXT: ProgramHeaderOffset: 0x{{[0-9A-F]+}}
|
|
# CHECK-NEXT: SectionHeaderOffset: 0x{{[0-9A-F]+}}
|
|
# CHECK-NEXT: Flags [ (0x72001005)
|
|
# CHECK-NEXT: EF_MIPS_ABI_O32 (0x1000)
|
|
# CHECK-NEXT: EF_MIPS_ARCH_32R2 (0x70000000)
|
|
# CHECK-NEXT: EF_MIPS_CPIC (0x4)
|
|
# CHECK-NEXT: EF_MIPS_MICROMIPS (0x2000000)
|
|
# CHECK-NEXT: EF_MIPS_NOREORDER (0x1)
|
|
# CHECK-NEXT: ]
|
|
# CHECK-NEXT: HeaderSize: 52
|
|
# CHECK-NEXT: ProgramHeaderEntrySize: 32
|
|
# CHECK-NEXT: ProgramHeaderCount: 6
|
|
# CHECK-NEXT: SectionHeaderEntrySize: 40
|
|
# CHECK-NEXT: SectionHeaderCount: 12
|
|
# CHECK-NEXT: StringTableSectionIndex: 9
|
|
# CHECK-NEXT: }
|
|
|
|
# o.o
|
|
---
|
|
FileHeader:
|
|
Class: ELFCLASS32
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [ EF_MIPS_NOREORDER, EF_MIPS_CPIC,
|
|
EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2, EF_MIPS_MICROMIPS ]
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
AddressAlign: 0x04
|
|
Size: 0x08
|
|
|
|
Symbols:
|
|
Local:
|
|
- Name: .text
|
|
Type: STT_SECTION
|
|
Section: .text
|
|
Global:
|
|
- Name: glob
|
|
Section: .text
|
|
Other: [ STO_MIPS_MICROMIPS ]
|
|
...
|