Files
clang-p2996/lld/test/elf/Mips/exe-fileheader.test
Simon Atanasyan d8cadd6f17 [ELF] Customize a relocation table output format (rel / rela).
Add new virtual virtual function `isRelaOutputFormat` to the
`ELFLinkingContext` class. Call this function everywhere we need to
select a relocation table format.

Patch reviewed by Shankar Easwaran and Rui Ueyama.

llvm-svn: 199973
2014-01-24 05:21:21 +00:00

55 lines
1.5 KiB
Plaintext

# Check ELF Header for non-pic executable file.
# Build shared library
# RUN: llvm-mc -triple=mipsel -filetype=obj -relocation-model=pic \
# RUN: -o=%t-obj %p/Inputs/ext.s
# RUN: lld -flavor gnu -target mipsel -shared -o %t-so %t-obj
# Build executable
# RUN: llvm-mc -triple=mipsel -filetype=obj -o=%t-obj %s
# RUN: lld -flavor gnu -target mipsel -e glob -o %t-exe %t-obj %t-so
# RUN: llvm-readobj -file-headers %t-exe | 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: 1
# CHECK: Unused: (00 00 00 00 00 00 00)
# CHECK: }
# CHECK: Type: Executable (0x2)
# CHECK: Machine: EM_MIPS (0x8)
# CHECK: Version: 1
# CHECK: Entry: 0x4001A0
# CHECK: ProgramHeaderOffset: 0x34
# CHECK: SectionHeaderOffset: 0x2268
# CHECK: Flags [ (0x70001005)
# CHECK: 0x1
# CHECK: 0x4
# CHECK: 0x1000
# CHECK: 0x10000000
# CHECK: 0x20000000
# CHECK: 0x40000000
# CHECK: ]
# CHECK: HeaderSize: 52
# CHECK: ProgramHeaderEntrySize: 32
# CHECK: ProgramHeaderCount: 6
# CHECK: SectionHeaderEntrySize: 40
# CHECK: SectionHeaderCount: 16
# CHECK: StringTableSectionIndex: 13
# CHECK: }
.abicalls
.global glob
.ent glob
glob:
jal ext1
.end glob