forked from OSchip/llvm-project
76 lines
2.3 KiB
Plaintext
76 lines
2.3 KiB
Plaintext
# Check ELF Header for shared library in case of microMIPS symbols.
|
|
|
|
# Build shared library
|
|
# RUN: yaml2obj -format=elf %s > %t.o
|
|
# RUN: lld -flavor gnu -target mips64el -shared -o %t.so %t.o
|
|
# RUN: llvm-readobj -file-headers %t.so | FileCheck %s
|
|
|
|
# CHECK: Format: ELF64-mips
|
|
# CHECK-NEXT: Arch: mips64el
|
|
# CHECK-NEXT: AddressSize: 64bit
|
|
# CHECK-NEXT: LoadName:
|
|
# CHECK-NEXT: ElfHeader {
|
|
# CHECK-NEXT: Ident {
|
|
# CHECK-NEXT: Magic: (7F 45 4C 46)
|
|
# CHECK-NEXT: Class: 64-bit (0x2)
|
|
# CHECK-NEXT: DataEncoding: LittleEndian (0x1)
|
|
# CHECK-NEXT: FileVersion: 1
|
|
# CHECK-NEXT: OS/ABI: SystemV (0x0)
|
|
# CHECK-NEXT: ABIVersion: 0
|
|
# CHECK-NEXT: Unused: (00 00 00 00 00 00 00)
|
|
# CHECK-NEXT: }
|
|
# CHECK-NEXT: Type: SharedObject (0x3)
|
|
# CHECK-NEXT: Machine: EM_MIPS (0x8)
|
|
# CHECK-NEXT: Version: 1
|
|
# CHECK-NEXT: Entry: 0x{{[0-9A-F]+}}
|
|
# CHECK-NEXT: ProgramHeaderOffset: 0x{{[0-9A-F]+}}
|
|
# CHECK-NEXT: SectionHeaderOffset: 0x{{[0-9A-F]+}}
|
|
# CHECK-NEXT: Flags [ (0x82000007)
|
|
# CHECK-NEXT: EF_MIPS_ARCH_64R2 (0x80000000)
|
|
# CHECK-NEXT: EF_MIPS_CPIC (0x4)
|
|
# CHECK-NEXT: EF_MIPS_MICROMIPS (0x2000000)
|
|
# CHECK-NEXT: EF_MIPS_NOREORDER (0x1)
|
|
# CHECK-NEXT: EF_MIPS_PIC (0x2)
|
|
# CHECK-NEXT: ]
|
|
# CHECK-NEXT: HeaderSize: 64
|
|
# CHECK-NEXT: ProgramHeaderEntrySize: 56
|
|
# CHECK-NEXT: ProgramHeaderCount: {{[0-9]+}}
|
|
# CHECK-NEXT: SectionHeaderEntrySize: 64
|
|
# CHECK-NEXT: SectionHeaderCount: {{[0-9]+}}
|
|
# CHECK-NEXT: StringTableSectionIndex: {{[0-9]+}}
|
|
# CHECK-NEXT:}
|
|
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC,
|
|
EF_MIPS_MICROMIPS, EF_MIPS_ARCH_64R2 ]
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
AddressAlign: 0x10
|
|
Size: 0x08
|
|
- Name: .data
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_WRITE, SHF_ALLOC ]
|
|
AddressAlign: 0x10
|
|
Size: 0x08
|
|
|
|
Symbols:
|
|
Local:
|
|
- Name: .text
|
|
Type: STT_SECTION
|
|
Section: .text
|
|
- Name: .data
|
|
Type: STT_SECTION
|
|
Section: .data
|
|
Global:
|
|
- Name: foo
|
|
Type: STT_FUNC
|
|
Section: .text
|
|
Size: 0x08
|
|
Other: [ STO_MIPS_MICROMIPS ]
|