1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/test/Object/invalid-alignment.test
Fangrui Song bb43600d6c [Object] Change ELFObjectFile<ELFT>::getFileFormatName() to use BFD names
Follow-up for D74433

What the function returns are almost standard BFD names, except that "ELF" is
in uppercase instead of lowercase.

This patch changes "ELF" to "elf" and changes ARM/AArch64 to use their BFD names.
MIPS and PPC64 have endianness differences as well, but this patch does not intend to address them.

Advantages:

* llvm-objdump: the "file format " line matches GNU objdump on ARM/AArch64 objects
* "file format " line can be extracted and fed into llvm-objcopy -O literally.
  (https://github.com/ClangBuiltLinux/linux/issues/779 has such a use case)

Affected tools: llvm-readobj, llvm-objdump, llvm-dwarfdump, MCJIT (internal implementation detail, not exposed)

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D76046
2020-03-16 07:42:04 -07:00

29 lines
710 B
Plaintext

# RUN: yaml2obj %s -o %t.o
# RUN: llvm-readobj -r %t.o 2>&1 | FileCheck %s
# CHECK: Format: elf64-x86-64
# CHECK-NEXT: Arch: x86_64
# CHECK-NEXT: AddressSize: 64bit
# CHECK-NEXT: LoadName:
# CHECK-NEXT: Relocations [
# CHECK-NEXT: Section (2) .rela.foo {
# CHECK-NEXT: 0x0 R_X86_64_NONE - 0x0
# CHECK-NEXT: }
# CHECK-NEXT: ]
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .foo
Type: SHT_PROGBITS
Content: 42
- Name: .rela.foo
Type: SHT_RELA
Info: .foo
Relocations:
- Type: R_X86_64_NONE