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
85 lines
2.1 KiB
Plaintext
85 lines
2.1 KiB
Plaintext
## Show that dumping operations apply to all members in an archive.
|
|
|
|
# RUN: rm -f %t.a
|
|
# RUN: rm -rf %t.dir
|
|
# RUN: mkdir -p %t.dir
|
|
# RUN: yaml2obj --docnum=1 %s -o %t.dir/trivial.obj.elf-x86-64
|
|
# RUN: yaml2obj --docnum=2 %s -o %t.dir/trivial.obj.elf-i386
|
|
# RUN: yaml2obj --docnum=3 %s -o %t.dir/trivial.obj.coff-arm
|
|
|
|
# RUN: llvm-ar rc %t.a %t.dir/trivial.obj.elf-x86-64 %t.dir/trivial.obj.elf-i386 %t.dir/trivial.obj.coff-arm
|
|
# RUN: llvm-readobj --all %t.a | FileCheck %s -DARFILE="%t.a" --check-prefixes=HEADER,LLVM,COFF
|
|
# RUN: llvm-readelf --all %t.a | FileCheck %s -DARFILE="%t.a" --check-prefixes=HEADER,GNU,COFF
|
|
|
|
# LLVM: {{^$}}
|
|
# LLVM-NEXT: File: [[ARFILE]](trivial.obj.elf-x86-64)
|
|
# LLVM: Format: elf64-x86-64
|
|
# LLVM: ElfHeader {
|
|
# LLVM: Machine: EM_X86_64
|
|
# LLVM: Sections [
|
|
# LLVM: Relocations [
|
|
# LLVM: Symbols [
|
|
# LLVM: Notes [
|
|
# LLVM: ]
|
|
# LLVM: StackSizes [
|
|
# LLVM: ]
|
|
|
|
# GNU: {{^$}}
|
|
# GNU-NEXT: File: [[ARFILE]](trivial.obj.elf-x86-64)
|
|
# GNU: ELF Header:
|
|
# GNU: Machine: Advanced Micro Devices X86-64
|
|
# GNU: Section Headers:
|
|
# GNU: There are no section groups in this file.
|
|
|
|
# LLVM-EMPTY:
|
|
# LLVM-NEXT: File: [[ARFILE]](trivial.obj.elf-i386)
|
|
# LLVM: Format: elf32-i386
|
|
# LLVM: ElfHeader {
|
|
# LLVM: Machine: EM_386
|
|
# LLVM: Sections [
|
|
# LLVM: Relocations [
|
|
# LLVM: Symbols [
|
|
# LLVM: Notes [
|
|
# LLVM: ]
|
|
# LLVM: StackSizes [
|
|
# LLVM: ]
|
|
|
|
# GNU-EMPTY:
|
|
# GNU-NEXT: File: [[ARFILE]](trivial.obj.elf-i386)
|
|
# GNU: ELF Header:
|
|
# GNU: Machine: Intel 80386
|
|
# GNU: Section Headers:
|
|
# GNU: There are no section groups in this file.
|
|
|
|
# LLVM-EMPTY:
|
|
# LLVM-NEXT: File: [[ARFILE]](trivial.obj.coff-arm)
|
|
# LLVM: Format: COFF-ARM
|
|
# GNU-EMPTY:
|
|
# GNU-NEXT: File: [[ARFILE]](trivial.obj.coff-arm)
|
|
# COFF: ImageFileHeader {
|
|
# COFF: Machine: IMAGE_FILE_MACHINE_ARMNT
|
|
# COFF: Sections [
|
|
# COFF: Relocations [
|
|
# COFF: Symbols [
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_X86_64
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS32
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_386
|
|
|
|
--- !COFF
|
|
header:
|
|
Machine: IMAGE_FILE_MACHINE_ARMNT
|
|
Characteristics: [ ]
|
|
sections: []
|
|
symbols: []
|