[lld] 536ba63 - [Object] Change ELFObjectFile<ELFT>::getFileFormatName() to use BFD names
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 16 07:42:40 PDT 2020
Author: Fangrui Song
Date: 2020-03-16T07:42:04-07:00
New Revision: 536ba6373f05fb1e9bc7199e301fbf4bc514006f
URL: https://github.com/llvm/llvm-project/commit/536ba6373f05fb1e9bc7199e301fbf4bc514006f
DIFF: https://github.com/llvm/llvm-project/commit/536ba6373f05fb1e9bc7199e301fbf4bc514006f.diff
LOG: [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
Added:
Modified:
lld/test/ELF/basic-ppc.s
lld/test/ELF/basic-ppc64.s
lld/test/ELF/format-binary.test
lld/test/ELF/gnu-hash-table.s
lld/test/ELF/linkerscript/linker-script-in-search-path.s
lld/test/ELF/lto/lto-start.ll
lld/test/ELF/lto/obj-path.ll
lld/test/ELF/lto/thinlto-debug-fission.ll
lld/test/ELF/lto/thinlto-obj-path.ll
lld/test/ELF/relocatable-empty-archive.s
lld/test/ELF/relocatable.s
llvm/include/llvm/Object/ELFObjectFile.h
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
llvm/test/CodeGen/AArch64/arm64-simplest-elf.ll
llvm/test/CodeGen/AMDGPU/elf.ll
llvm/test/CodeGen/AMDGPU/elf.r600.ll
llvm/test/DebugInfo/AArch64/big-endian-dump.ll
llvm/test/DebugInfo/AArch64/little-endian-dump.ll
llvm/test/DebugInfo/ARM/big-endian-dump.ll
llvm/test/DebugInfo/ARM/little-endian-dump.ll
llvm/test/DebugInfo/Sparc/gnu-window-save.ll
llvm/test/MC/ARM/dwarf-asm-no-code.s
llvm/test/MC/AVR/dwarf-asm-no-code.s
llvm/test/MC/AsmParser/non-english-characters.s
llvm/test/MC/ELF/empty.s
llvm/test/MC/ELF/relocation-386.s
llvm/test/MC/Hexagon/basic.ll
llvm/test/MC/RISCV/elf-header.s
llvm/test/MC/Sparc/sparc-relocations.s
llvm/test/Object/AMDGPU/elf32-unknown.yaml
llvm/test/Object/AMDGPU/elf64-unknown.yaml
llvm/test/Object/invalid-alignment.test
llvm/test/ThinLTO/X86/empty-module.ll
llvm/test/tools/gold/X86/thinlto.ll
llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test
llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test
llvm/test/tools/llvm-objcopy/ELF/many-sections.test
llvm/test/tools/llvm-readobj/ELF/all.test
llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-definitions.test
llvm/test/tools/llvm-readobj/ELF/basic.test
llvm/test/tools/llvm-readobj/ELF/dynamic-no-pt-dynamic.test
llvm/test/tools/llvm-readobj/ELF/file-headers.test
llvm/test/tools/llvm-readobj/ELF/loadname.test
llvm/test/tools/llvm-readobj/ELF/no-action.test
llvm/test/tools/llvm-readobj/ELF/ppc64-glink.test
llvm/test/tools/llvm-readobj/ELF/program-headers.test
llvm/test/tools/llvm-readobj/archive.test
llvm/test/tools/llvm-readobj/thin-archive.test
Removed:
################################################################################
diff --git a/lld/test/ELF/basic-ppc.s b/lld/test/ELF/basic-ppc.s
index ff753c8cebad..b67841e691a2 100644
--- a/lld/test/ELF/basic-ppc.s
+++ b/lld/test/ELF/basic-ppc.s
@@ -9,7 +9,7 @@
li 3,1
sc
-// CHECK: Format: ELF32-ppc
+// CHECK: Format: elf32-powerpc
// CHECK-NEXT: Arch: powerpc
// CHECK-NEXT: AddressSize: 32bit
// CHECK-NEXT: LoadName:
diff --git a/lld/test/ELF/basic-ppc64.s b/lld/test/ELF/basic-ppc64.s
index 59a406bc83fa..a768436f222c 100644
--- a/lld/test/ELF/basic-ppc64.s
+++ b/lld/test/ELF/basic-ppc64.s
@@ -14,7 +14,7 @@
li 3,55
sc
-// CHECK:Format: ELF64-ppc64
+// CHECK: Format: elf64-powerpc
// LE-NEXT: Arch: powerpc64le
// BE-NEXT: Arch: powerpc64{{$}}
// CHECK-NEXT: AddressSize: 64bit
diff --git a/lld/test/ELF/format-binary.test b/lld/test/ELF/format-binary.test
index 7c554bb60e43..fc843345cbb5 100644
--- a/lld/test/ELF/format-binary.test
+++ b/lld/test/ELF/format-binary.test
@@ -60,10 +60,10 @@
# RUN: ld.lld -b binary %t.binary -T %t.script -o %t.out
# RUN: llvm-readobj %t.out -sections -section-data -symbols | FileCheck -check-prefix=X86-64 %s
-# X86-64: Format: ELF64-x86-64
+# X86-64: Format: elf64-x86-64
# RUN: echo 'OUTPUT_FORMAT("elf64-x86-64")' > %t.script
# RUN: ld.lld -b binary %t.binary -T %t.script -o %t.out
# RUN: llvm-readobj %t.out -sections -section-data -symbols | FileCheck -check-prefix=X86-64-in-quotes %s
-# X86-64-in-quotes: Format: ELF64-x86-64
+# X86-64-in-quotes: Format: elf64-x86-64
diff --git a/lld/test/ELF/gnu-hash-table.s b/lld/test/ELF/gnu-hash-table.s
index 092e584cf47a..91ebe5d7ab95 100644
--- a/lld/test/ELF/gnu-hash-table.s
+++ b/lld/test/ELF/gnu-hash-table.s
@@ -68,7 +68,7 @@
# EMPTY-NEXT: Values: []
# EMPTY-NEXT: }
-# I386: Format: ELF32-i386
+# I386: Format: elf32-i386
# I386: Arch: i386
# I386: AddressSize: 32bit
# I386: Sections [
@@ -127,7 +127,7 @@
# I386-NEXT: Values: [0xB8860BA, 0xB887389]
# I386-NEXT: }
-# X86_64: Format: ELF64-x86-64
+# X86_64: Format: elf64-x86-64
# X86_64: Arch: x86_64
# X86_64: AddressSize: 64bit
# X86_64: Sections [
@@ -187,7 +187,7 @@
# X86_64-NEXT: Values: [0xB8860BA, 0xB887389]
# X86_64-NEXT: }
-# PPC64: Format: ELF64-ppc64
+# PPC64: Format: elf64-powerpc
# PPC64: Arch: powerpc64
# PPC64: AddressSize: 64bit
# PPC64: Sections [
diff --git a/lld/test/ELF/linkerscript/linker-script-in-search-path.s b/lld/test/ELF/linkerscript/linker-script-in-search-path.s
index d411becb48f8..49bf6c0089de 100644
--- a/lld/test/ELF/linkerscript/linker-script-in-search-path.s
+++ b/lld/test/ELF/linkerscript/linker-script-in-search-path.s
@@ -7,7 +7,7 @@
# RUN: echo 'OUTPUT("%t.out")' > %t.dir/script
# RUN: ld.lld -T%t.dir/script %t.o
# RUN: llvm-readobj %t.out | FileCheck %s
-# CHECK: Format: ELF64-x86-64
+# CHECK: Format: elf64-x86-64
# If the linker script specified with -T is missing we should emit an error
# RUN: not ld.lld -Tscript %t.o 2>&1 | FileCheck %s -check-prefix ERROR
diff --git a/lld/test/ELF/lto/lto-start.ll b/lld/test/ELF/lto/lto-start.ll
index e39c35f17e07..541f15b3a988 100644
--- a/lld/test/ELF/lto/lto-start.ll
+++ b/lld/test/ELF/lto/lto-start.ll
@@ -3,7 +3,7 @@
; RUN: ld.lld %t.o -o %t2
; RUN: llvm-readobj --symbols %t2 | FileCheck %s
-; CHECK: Format: ELF64-x86-64
+; CHECK: Format: elf64-x86-64
; CHECK-NEXT: Arch: x86_64
; CHECK-NEXT: AddressSize: 64bit
diff --git a/lld/test/ELF/lto/obj-path.ll b/lld/test/ELF/lto/obj-path.ll
index 07e30e2a500f..1fbffe7932fe 100644
--- a/lld/test/ELF/lto/obj-path.ll
+++ b/lld/test/ELF/lto/obj-path.ll
@@ -16,10 +16,10 @@
; CHECK-NEXT: T g
; NM1: T f
-; ELF1: Format: ELF64-x86-64
+; ELF1: Format: elf64-x86-64
; NM2: T g
-; ELF2: Format: ELF64-x86-64
+; ELF2: Format: elf64-x86-64
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
diff --git a/lld/test/ELF/lto/thinlto-debug-fission.ll b/lld/test/ELF/lto/thinlto-debug-fission.ll
index 64da345d7af0..3b471dc20e11 100644
--- a/lld/test/ELF/lto/thinlto-debug-fission.ll
+++ b/lld/test/ELF/lto/thinlto-debug-fission.ll
@@ -7,7 +7,7 @@
; RUN: ld.lld --plugin-opt=dwo_dir=%t.dir -shared %t1.o -o /dev/null
; RUN: llvm-readobj -h %t.dir/0.dwo | FileCheck %s
-; CHECK: Format: ELF64-x86-64
+; CHECK: Format: elf64-x86-64
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
diff --git a/lld/test/ELF/lto/thinlto-obj-path.ll b/lld/test/ELF/lto/thinlto-obj-path.ll
index 52338f9df375..787c1c03b665 100644
--- a/lld/test/ELF/lto/thinlto-obj-path.ll
+++ b/lld/test/ELF/lto/thinlto-obj-path.ll
@@ -14,7 +14,7 @@
; RUN: ld.lld -thinlto-index-only -lto-obj-path=%t4.o -shared %t1.o %t2.o -o /dev/null
; RUN: llvm-readobj -h %t4.o | FileCheck %s
-; CHECK: Format: ELF64-x86-64
+; CHECK: Format: elf64-x86-64
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
diff --git a/lld/test/ELF/relocatable-empty-archive.s b/lld/test/ELF/relocatable-empty-archive.s
index 30a711af5509..9286f9d79fb0 100644
--- a/lld/test/ELF/relocatable-empty-archive.s
+++ b/lld/test/ELF/relocatable-empty-archive.s
@@ -4,7 +4,7 @@
# RUN: ld.lld -m elf_x86_64 %t.a -o %t -r
# RUN: llvm-readobj --file-headers %t | FileCheck %s
-# CHECK: Format: ELF64-x86-64
+# CHECK: Format: elf64-x86-64
# CHECK: Arch: x86_64
# CHECK: AddressSize: 64bit
# CHECK: Type: Relocatable
diff --git a/lld/test/ELF/relocatable.s b/lld/test/ELF/relocatable.s
index d309ca52dd25..04516df45cf8 100644
--- a/lld/test/ELF/relocatable.s
+++ b/lld/test/ELF/relocatable.s
@@ -75,7 +75,7 @@
# CHECKTEXT-NEXT: 40: c7 04 25 00 00 00 00 08 00 00 00 movl $8, 0
# CHECKTEXT-NEXT: 4b: c7 04 25 00 00 00 00 09 00 00 00 movl $9, 0
-# CHECKEXE: Format: ELF64-x86-64
+# CHECKEXE: Format: elf64-x86-64
# CHECKEXE-NEXT: Arch: x86_64
# CHECKEXE-NEXT: AddressSize: 64bit
# CHECKEXE-NEXT: LoadName:
diff --git a/llvm/include/llvm/Object/ELFObjectFile.h b/llvm/include/llvm/Object/ELFObjectFile.h
index 59b99d088921..e2c9b42e04b4 100644
--- a/llvm/include/llvm/Object/ELFObjectFile.h
+++ b/llvm/include/llvm/Object/ELFObjectFile.h
@@ -1060,59 +1060,59 @@ StringRef ELFObjectFile<ELFT>::getFileFormatName() const {
case ELF::ELFCLASS32:
switch (EF.getHeader()->e_machine) {
case ELF::EM_386:
- return "ELF32-i386";
+ return "elf32-i386";
case ELF::EM_IAMCU:
- return "ELF32-iamcu";
+ return "elf32-iamcu";
case ELF::EM_X86_64:
- return "ELF32-x86-64";
+ return "elf32-x86-64";
case ELF::EM_ARM:
- return (IsLittleEndian ? "ELF32-arm-little" : "ELF32-arm-big");
+ return (IsLittleEndian ? "elf32-littlearm" : "elf32-bigarm");
case ELF::EM_AVR:
- return "ELF32-avr";
+ return "elf32-avr";
case ELF::EM_HEXAGON:
- return "ELF32-hexagon";
+ return "elf32-hexagon";
case ELF::EM_LANAI:
- return "ELF32-lanai";
+ return "elf32-lanai";
case ELF::EM_MIPS:
- return "ELF32-mips";
+ return "elf32-mips";
case ELF::EM_MSP430:
- return "ELF32-msp430";
+ return "elf32-msp430";
case ELF::EM_PPC:
- return "ELF32-ppc";
+ return "elf32-powerpc";
case ELF::EM_RISCV:
- return "ELF32-riscv";
+ return "elf32-littleriscv";
case ELF::EM_SPARC:
case ELF::EM_SPARC32PLUS:
- return "ELF32-sparc";
+ return "elf32-sparc";
case ELF::EM_AMDGPU:
- return "ELF32-amdgpu";
+ return "elf32-amdgpu";
default:
- return "ELF32-unknown";
+ return "elf32-unknown";
}
case ELF::ELFCLASS64:
switch (EF.getHeader()->e_machine) {
case ELF::EM_386:
- return "ELF64-i386";
+ return "elf64-i386";
case ELF::EM_X86_64:
- return "ELF64-x86-64";
+ return "elf64-x86-64";
case ELF::EM_AARCH64:
- return (IsLittleEndian ? "ELF64-aarch64-little" : "ELF64-aarch64-big");
+ return (IsLittleEndian ? "elf64-littleaarch64" : "elf64-bigaarch64");
case ELF::EM_PPC64:
- return "ELF64-ppc64";
+ return "elf64-powerpc";
case ELF::EM_RISCV:
- return "ELF64-riscv";
+ return "elf64-littleriscv";
case ELF::EM_S390:
- return "ELF64-s390";
+ return "elf64-s390";
case ELF::EM_SPARCV9:
- return "ELF64-sparc";
+ return "elf64-sparc";
case ELF::EM_MIPS:
- return "ELF64-mips";
+ return "elf64-mips";
case ELF::EM_AMDGPU:
- return "ELF64-amdgpu";
+ return "elf64-amdgpu";
case ELF::EM_BPF:
- return "ELF64-BPF";
+ return "elf64-bpf";
default:
- return "ELF64-unknown";
+ return "elf64-unknown";
}
default:
// FIXME: Proper error handling.
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
index 440ab4174a56..e869547964ac 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -554,7 +554,7 @@ void RuntimeDyldELF::setMipsABI(const ObjectFile &Obj) {
IsMipsO32ABI = AbiVariant & ELF::EF_MIPS_ABI_O32;
IsMipsN32ABI = AbiVariant & ELF::EF_MIPS_ABI2;
}
- IsMipsN64ABI = Obj.getFileFormatName().equals("ELF64-mips");
+ IsMipsN64ABI = Obj.getFileFormatName().equals("elf64-mips");
}
// Return the .TOC. section and offset.
diff --git a/llvm/test/CodeGen/AArch64/arm64-simplest-elf.ll b/llvm/test/CodeGen/AArch64/arm64-simplest-elf.ll
index 2d6863d129d0..be8f53f47dd8 100644
--- a/llvm/test/CodeGen/AArch64/arm64-simplest-elf.ll
+++ b/llvm/test/CodeGen/AArch64/arm64-simplest-elf.ll
@@ -11,7 +11,7 @@ define void @foo() nounwind {
; Similarly make sure ELF output works and is vaguely sane: aarch64 target
; machine with correct section & symbol names.
-; CHECK-ELF: file format elf64-aarch64
+; CHECK-ELF: file format elf64-littleaarch64
; CHECK-ELF: Disassembly of section .text
; CHECK-ELF-LABEL: <foo>:
diff --git a/llvm/test/CodeGen/AMDGPU/elf.ll b/llvm/test/CodeGen/AMDGPU/elf.ll
index 4ddb763ee53f..be49e273ad9f 100644
--- a/llvm/test/CodeGen/AMDGPU/elf.ll
+++ b/llvm/test/CodeGen/AMDGPU/elf.ll
@@ -8,7 +8,7 @@
; Test that we don't try to produce a COFF file on windows
; RUN: llc < %s -mtriple=amdgcn-pc-mingw -verify-machineinstrs -filetype=obj | llvm-readobj -S --symbols --file-headers - | FileCheck --check-prefix=ELF %s
-; ELF: Format: ELF64-amdgpu
+; ELF: Format: elf64-amdgpu
; ELF: OS/ABI: SystemV (0x0)
; ELF: Machine: EM_AMDGPU (0xE0)
; ELF: Name: .AMDGPU.config
diff --git a/llvm/test/CodeGen/AMDGPU/elf.r600.ll b/llvm/test/CodeGen/AMDGPU/elf.r600.ll
index 63a87ed0ea42..276310724630 100644
--- a/llvm/test/CodeGen/AMDGPU/elf.r600.ll
+++ b/llvm/test/CodeGen/AMDGPU/elf.r600.ll
@@ -1,7 +1,7 @@
; RUN: llc < %s -march=r600 -mcpu=redwood -filetype=obj | llvm-readobj -S - | FileCheck --check-prefix=ELF %s
; RUN: llc < %s -march=r600 -mcpu=redwood -o - | FileCheck --check-prefix=CONFIG %s
-; ELF: Format: ELF32-amdgpu
+; ELF: Format: elf32-amdgpu
; ELF: Name: .AMDGPU.config
; CONFIG: .section .AMDGPU.config
diff --git a/llvm/test/DebugInfo/AArch64/big-endian-dump.ll b/llvm/test/DebugInfo/AArch64/big-endian-dump.ll
index 4a1a9e78ae9f..d18f82ea612e 100644
--- a/llvm/test/DebugInfo/AArch64/big-endian-dump.ll
+++ b/llvm/test/DebugInfo/AArch64/big-endian-dump.ll
@@ -1,6 +1,6 @@
; RUN: llc -O0 -filetype=obj -mtriple=aarch64_be-none-linux < %s | llvm-dwarfdump - | FileCheck %s
-; CHECK: file format ELF64-aarch64-big
+; CHECK: file format elf64-bigaarch64
target datalayout = "E-m:e-i64:64-i128:128-n32:64-S128"
diff --git a/llvm/test/DebugInfo/AArch64/little-endian-dump.ll b/llvm/test/DebugInfo/AArch64/little-endian-dump.ll
index 65330c9eb95a..d4626db47a14 100644
--- a/llvm/test/DebugInfo/AArch64/little-endian-dump.ll
+++ b/llvm/test/DebugInfo/AArch64/little-endian-dump.ll
@@ -1,6 +1,6 @@
; RUN: llc -O0 -filetype=obj -mtriple=aarch64-none-linux < %s | llvm-dwarfdump - | FileCheck %s
-; CHECK: file format ELF64-aarch64-little
+; CHECK: file format elf64-littleaarch64
target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
diff --git a/llvm/test/DebugInfo/ARM/big-endian-dump.ll b/llvm/test/DebugInfo/ARM/big-endian-dump.ll
index 7bfe24eb2300..daaa9b4f29a2 100644
--- a/llvm/test/DebugInfo/ARM/big-endian-dump.ll
+++ b/llvm/test/DebugInfo/ARM/big-endian-dump.ll
@@ -1,6 +1,6 @@
; RUN: llc -O0 -filetype=obj -mtriple=armeb-none-linux < %s | llvm-dwarfdump - | FileCheck %s
-; CHECK: file format ELF32-arm-big
+; CHECK: file format elf32-bigarm
target datalayout = "E-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
diff --git a/llvm/test/DebugInfo/ARM/little-endian-dump.ll b/llvm/test/DebugInfo/ARM/little-endian-dump.ll
index b5f86e979be9..60f6675edcde 100644
--- a/llvm/test/DebugInfo/ARM/little-endian-dump.ll
+++ b/llvm/test/DebugInfo/ARM/little-endian-dump.ll
@@ -1,6 +1,6 @@
; RUN: llc -O0 -filetype=obj -mtriple=arm-none-linux < %s | llvm-dwarfdump - | FileCheck %s
-; CHECK: file format ELF32-arm-little
+; CHECK: file format elf32-littlearm
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
diff --git a/llvm/test/DebugInfo/Sparc/gnu-window-save.ll b/llvm/test/DebugInfo/Sparc/gnu-window-save.ll
index d81bcb6edb03..38467bd0c7be 100644
--- a/llvm/test/DebugInfo/Sparc/gnu-window-save.ll
+++ b/llvm/test/DebugInfo/Sparc/gnu-window-save.ll
@@ -4,7 +4,7 @@
; Check for DW_CFA_GNU_Window_save in debug_frame. Also, Ensure that relocations
; are performed correctly in debug_info.
-; SPARC64: file format ELF64-sparc
+; SPARC64: file format elf64-sparc
; SPARC64: .debug_info
; SPARC64: DW_TAG_compile_unit
@@ -20,7 +20,7 @@
; SPARC64-NEXT: DW_CFA_register
-; SPARC32: file format ELF32-sparc
+; SPARC32: file format elf32-sparc
; SPARC32: .debug_info
; SPARC32: DW_TAG_compile_unit
diff --git a/llvm/test/MC/ARM/dwarf-asm-no-code.s b/llvm/test/MC/ARM/dwarf-asm-no-code.s
index bce9301e1781..1a009e8a6ed3 100644
--- a/llvm/test/MC/ARM/dwarf-asm-no-code.s
+++ b/llvm/test/MC/ARM/dwarf-asm-no-code.s
@@ -8,7 +8,7 @@
a:
.long 42
-// DWARF: ELF32-arm-little
+// DWARF: elf32-littlearm
// DWARF-NOT: contents:
// DWARF: .debug_line contents:
diff --git a/llvm/test/MC/AVR/dwarf-asm-no-code.s b/llvm/test/MC/AVR/dwarf-asm-no-code.s
index fefd667d7795..98c8151d7335 100644
--- a/llvm/test/MC/AVR/dwarf-asm-no-code.s
+++ b/llvm/test/MC/AVR/dwarf-asm-no-code.s
@@ -8,7 +8,7 @@
a:
.long 42
-// DWARF: ELF32-avr
+// DWARF: elf32-avr
// DWARF-NOT: contents:
// DWARF: .debug_line contents:
diff --git a/llvm/test/MC/AsmParser/non-english-characters.s b/llvm/test/MC/AsmParser/non-english-characters.s
index 0e47a943bd30..4eae7a1c6c8d 100644
--- a/llvm/test/MC/AsmParser/non-english-characters.s
+++ b/llvm/test/MC/AsmParser/non-english-characters.s
@@ -1,7 +1,7 @@
# RUN: llvm-mc -triple i386-linux-gnu -filetype=obj -o %t \
# RUN: %S/Inputs/non-english-characters-comments.s
# RUN: llvm-readobj %t | FileCheck %s
-# CHECK: Format: ELF32-i386
+# CHECK: Format: elf32-i386
# RUN: not llvm-mc -triple i386-linux-gnu -filetype=obj -o %t \
# RUN: %S/Inputs/non-english-characters-section-name.s 2>&1 | \
diff --git a/llvm/test/MC/ELF/empty.s b/llvm/test/MC/ELF/empty.s
index e640715591af..bc5c80a21815 100644
--- a/llvm/test/MC/ELF/empty.s
+++ b/llvm/test/MC/ELF/empty.s
@@ -5,8 +5,8 @@
// Check that we can create ELF files for darwin/windows, even though
// it is not the default file format.
-// DARWIN: Format: ELF64-x86-64
-// WINDOWS: Format: ELF64-x86-64
+// DARWIN: Format: elf64-x86-64
+// WINDOWS: Format: elf64-x86-64
// DARWIN-NEXT: Arch: x86_64
// WINDOWS-NEXT: Arch: x86_64
diff --git a/llvm/test/MC/ELF/relocation-386.s b/llvm/test/MC/ELF/relocation-386.s
index e2c4e1073ad9..d06cea9be9fd 100644
--- a/llvm/test/MC/ELF/relocation-386.s
+++ b/llvm/test/MC/ELF/relocation-386.s
@@ -4,8 +4,8 @@
// Test that we produce the correct relocation types and that the relocations
// correctly point to the section or the symbol.
-// IAMCU: Format: ELF32-iamcu
-// I386: Format: ELF32-i386
+// IAMCU: Format: elf32-iamcu
+// I386: Format: elf32-i386
// CHECK: Relocations [
// CHECK-NEXT: Section {{.*}} .rel.text {
// CHECK-NEXT: 0x2 R_386_GOTOFF .Lfoo 0x0
diff --git a/llvm/test/MC/Hexagon/basic.ll b/llvm/test/MC/Hexagon/basic.ll
index 98b4cbc0a31d..5fba44f3a5f9 100644
--- a/llvm/test/MC/Hexagon/basic.ll
+++ b/llvm/test/MC/Hexagon/basic.ll
@@ -1,7 +1,7 @@
;; RUN: llc -mtriple=hexagon-unknown-elf -filetype=obj %s -o - \
;; RUN: | llvm-readobj -h -r | FileCheck -check-prefix=OBJ %s
-; OBJ: Format: ELF32-hexagon
+; OBJ: Format: elf32-hexagon
; OBJ: Arch: hexagon
; OBJ: AddressSize: 32bit
; OBJ: Machine: EM_HEXAGON (0xA4)
diff --git a/llvm/test/MC/RISCV/elf-header.s b/llvm/test/MC/RISCV/elf-header.s
index 29a7036f2fc6..491d3bea4ce4 100644
--- a/llvm/test/MC/RISCV/elf-header.s
+++ b/llvm/test/MC/RISCV/elf-header.s
@@ -3,7 +3,7 @@
# RUN: llvm-mc %s -filetype=obj -triple=riscv64 | llvm-readobj -h \
# RUN: | FileCheck -check-prefix=RV64 %s
-# RV32: Format: ELF32-riscv
+# RV32: Format: elf32-littleriscv
# RV32: Arch: riscv32
# RV32: AddressSize: 32bit
# RV32: ElfHeader {
@@ -22,7 +22,7 @@
# RV32: ]
# RV32: }
-# RV64: Format: ELF64-riscv
+# RV64: Format: elf64-littleriscv
# RV64: Arch: riscv64
# RV64: AddressSize: 64bit
# RV64: ElfHeader {
diff --git a/llvm/test/MC/Sparc/sparc-relocations.s b/llvm/test/MC/Sparc/sparc-relocations.s
index 44e3cedc37d3..5c090a6f2edd 100644
--- a/llvm/test/MC/Sparc/sparc-relocations.s
+++ b/llvm/test/MC/Sparc/sparc-relocations.s
@@ -1,7 +1,7 @@
! RUN: llvm-mc %s -arch=sparcv9 -show-encoding | FileCheck %s
! RUN: llvm-mc %s -arch=sparcv9 -filetype=obj | llvm-readobj -r | FileCheck %s --check-prefix=CHECK-OBJ
- ! CHECK-OBJ: Format: ELF64-sparc
+ ! CHECK-OBJ: Format: elf64-sparc
! CHECK-OBJ: Relocations [
! CHECK-OBJ: 0x{{[0-9,A-F]+}} R_SPARC_WDISP30 foo
! CHECK-OBJ: 0x{{[0-9,A-F]+}} R_SPARC_LO10 sym
diff --git a/llvm/test/Object/AMDGPU/elf32-unknown.yaml b/llvm/test/Object/AMDGPU/elf32-unknown.yaml
index 4c43401499c4..ae4ef71c2da7 100644
--- a/llvm/test/Object/AMDGPU/elf32-unknown.yaml
+++ b/llvm/test/Object/AMDGPU/elf32-unknown.yaml
@@ -1,7 +1,7 @@
# RUN: yaml2obj %s -o %t.o
# RUN: llvm-readobj -S --file-headers %t.o | FileCheck %s
-# CHECK: Format: ELF32-amdgpu
+# CHECK: Format: elf32-amdgpu
--- !ELF
FileHeader:
diff --git a/llvm/test/Object/AMDGPU/elf64-unknown.yaml b/llvm/test/Object/AMDGPU/elf64-unknown.yaml
index b991df62a555..3d419f261724 100644
--- a/llvm/test/Object/AMDGPU/elf64-unknown.yaml
+++ b/llvm/test/Object/AMDGPU/elf64-unknown.yaml
@@ -1,7 +1,7 @@
# RUN: yaml2obj %s -o %t.o
# RUN: llvm-readobj -S --file-headers %t.o | FileCheck %s
-# CHECK: Format: ELF64-amdgpu
+# CHECK: Format: elf64-amdgpu
--- !ELF
FileHeader:
diff --git a/llvm/test/Object/invalid-alignment.test b/llvm/test/Object/invalid-alignment.test
index 66c5fed72a21..8a0079062669 100644
--- a/llvm/test/Object/invalid-alignment.test
+++ b/llvm/test/Object/invalid-alignment.test
@@ -1,7 +1,7 @@
# RUN: yaml2obj %s -o %t.o
# RUN: llvm-readobj -r %t.o 2>&1 | FileCheck %s
-# CHECK: Format: ELF64-x86-64
+# CHECK: Format: elf64-x86-64
# CHECK-NEXT: Arch: x86_64
# CHECK-NEXT: AddressSize: 64bit
# CHECK-NEXT: LoadName:
diff --git a/llvm/test/ThinLTO/X86/empty-module.ll b/llvm/test/ThinLTO/X86/empty-module.ll
index 0f4543446d35..550be4df6657 100644
--- a/llvm/test/ThinLTO/X86/empty-module.ll
+++ b/llvm/test/ThinLTO/X86/empty-module.ll
@@ -5,7 +5,7 @@
; RUN: llvm-readobj -h %t2.0 | FileCheck %s
; RUN: llvm-nm %t2.0 2>&1 | count 0
-; CHECK: Format: ELF64-x86-64
+; CHECK: Format: elf64-x86-64
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
diff --git a/llvm/test/tools/gold/X86/thinlto.ll b/llvm/test/tools/gold/X86/thinlto.ll
index 9a81618aad7e..ebe9b56a2f85 100644
--- a/llvm/test/tools/gold/X86/thinlto.ll
+++ b/llvm/test/tools/gold/X86/thinlto.ll
@@ -87,7 +87,7 @@
; NM: T f
; NM2: T {{f|g}}
-; FORMAT: Format: ELF64-x86-64
+; FORMAT: Format: elf64-x86-64
; The backend index for this module contains summaries from itself and
; Inputs/thinlto.ll, as it imports from the latter.
diff --git a/llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test b/llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test
index 4af2d0514bf4..1ca911a64012 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test
@@ -31,16 +31,16 @@
# RUN: llvm-readobj --file-headers %t.sparcel.o | FileCheck %s --check-prefixes=CHECK,LE,SPARCEL,32
# CHECK: Format:
-# 32-SAME: ELF32-
-# 64-SAME: ELF64-
-# AARCH64-SAME: aarch64-little
-# ARM-SAME: arm-little
+# 32-SAME: elf32-
+# 64-SAME: elf64-
+# AARCH64-SAME: littleaarch64
+# ARM-SAME: littlearm
# I386-SAME: i386
# MIPS-SAME: mips{{$}}
# RISCV32-SAME: riscv{{$}}
# RISCV64-SAME: riscv{{$}}
-# PPC-SAME: ppc{{$}}
-# PPC64le-SAME: ppc64
+# PPC-SAME: powerpc{{$}}
+# PPC64le-SAME: powerpc{{$}}
# SPARC-SAME: sparc
# SPARCEL-SAME: sparc
# X86-64-SAME: x86-64
diff --git a/llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test b/llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test
index 720dcbfa99b8..f2c37392fc9b 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test
@@ -133,16 +133,16 @@ Symbols:
Binding: STB_GLOBAL
# CHECK: Format:
-# 32-SAME: ELF32-
-# 64-SAME: ELF64-
+# 32-SAME: elf32-
+# 64-SAME: elf64-
# I386-SAME: i386
# IAMCU-SAME: iamcu
# AARCH-SAME: aarch64
-# ARM-SAME: arm-little
+# ARM-SAME: littlearm
# MIPS-SAME: mips
-# PPC-SAME: ppc{{$}}
-# PPC64BE-SAME: ppc64{{$}}
-# PPC64LE-SAME: ppc64{{$}}
+# PPC-SAME: powerpc{{$}}
+# PPC64BE-SAME: powerpc{{$}}
+# PPC64LE-SAME: powerpc{{$}}
# RISCV32-SAME: riscv{{$}}
# RISCV64-SAME: riscv{{$}}
# SPARC-SAME: sparc
diff --git a/llvm/test/tools/llvm-objcopy/ELF/many-sections.test b/llvm/test/tools/llvm-objcopy/ELF/many-sections.test
index 906fb3a6fbba..41e237a37771 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/many-sections.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/many-sections.test
@@ -5,7 +5,7 @@ RUN: llvm-readobj --sections %t2 | FileCheck --check-prefix=SECS %s
RUN: llvm-readobj --symbols %t2 | grep "Symbol {" | wc -l | FileCheck --check-prefix=SYMS %s
RUN: llvm-readobj --symbols %t2 | FileCheck %s --check-prefix=SYM_SEC_IDS
-EHDR: Format: ELF64-x86-64
+EHDR: Format: elf64-x86-64
EHDR-NEXT: Arch: x86_64
EHDR-NEXT: AddressSize: 64bit
EHDR-NEXT: LoadName:
diff --git a/llvm/test/tools/llvm-readobj/ELF/all.test b/llvm/test/tools/llvm-readobj/ELF/all.test
index f792143b9537..39783613e789 100644
--- a/llvm/test/tools/llvm-readobj/ELF/all.test
+++ b/llvm/test/tools/llvm-readobj/ELF/all.test
@@ -2,7 +2,7 @@
# RUN: llvm-readobj -a %t.o | FileCheck %s --check-prefix LLVM-ALL
# RUN: llvm-readobj --all %t.o | FileCheck %s --check-prefix LLVM-ALL
-# LLVM-ALL: Format: ELF32-i386
+# LLVM-ALL: Format: elf32-i386
# LLVM-ALL: Arch: i386
# LLVM-ALL: AddressSize: 32bit
# LLVM-ALL: LoadName:
diff --git a/llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-definitions.test b/llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-definitions.test
index 24dcc7c052be..cb0e6213cafd 100644
--- a/llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-definitions.test
+++ b/llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-definitions.test
@@ -1,6 +1,6 @@
RUN: llvm-readobj --file-headers -l -S --symbols %p/Inputs/trivial.obj.elf-amdhsa-gfx803 | FileCheck %s
-CHECK: Format: ELF64-amdgpu
+CHECK: Format: elf64-amdgpu
CHECK: Arch: unknown
CHECK: ElfHeader {
CHECK: Ident {
diff --git a/llvm/test/tools/llvm-readobj/ELF/basic.test b/llvm/test/tools/llvm-readobj/ELF/basic.test
index 1d273b8b927f..608ad34e2b49 100644
--- a/llvm/test/tools/llvm-readobj/ELF/basic.test
+++ b/llvm/test/tools/llvm-readobj/ELF/basic.test
@@ -5,7 +5,7 @@
# RUN: llvm-readelf %t.trivial.obj.elf-x86-64 | FileCheck --check-prefix=NO-OUTPUT --allow-empty %s
# HEADER: File: {{.*}}trivial.obj.elf-x86-64
-# HEADER: Format: ELF64-x86-64
+# HEADER: Format: elf64-x86-64
# HEADER: Arch: x86_64
# HEADER: AddressSize: 64bit
diff --git a/llvm/test/tools/llvm-readobj/ELF/dynamic-no-pt-dynamic.test b/llvm/test/tools/llvm-readobj/ELF/dynamic-no-pt-dynamic.test
index 8fa7f655249f..f5c95d7d66d0 100644
--- a/llvm/test/tools/llvm-readobj/ELF/dynamic-no-pt-dynamic.test
+++ b/llvm/test/tools/llvm-readobj/ELF/dynamic-no-pt-dynamic.test
@@ -5,7 +5,7 @@
# RUN: llvm-readelf --dynamic-table %t.no-phdr | FileCheck %s --check-prefix=GNU
# LLVM: File: {{.*}}.no-phdr
-# LLVM-NEXT: Format: ELF64-x86-64
+# LLVM-NEXT: Format: elf64-x86-64
# LLVM-NEXT: Arch: x86_64
# LLVM-NEXT: AddressSize: 64bit
# LLVM-NEXT: LoadName:{{ *}}
diff --git a/llvm/test/tools/llvm-readobj/ELF/file-headers.test b/llvm/test/tools/llvm-readobj/ELF/file-headers.test
index d3282c804cc4..99cbfdf5e8c7 100644
--- a/llvm/test/tools/llvm-readobj/ELF/file-headers.test
+++ b/llvm/test/tools/llvm-readobj/ELF/file-headers.test
@@ -4,7 +4,7 @@
# RUN: llvm-readobj --file-headers %t.i386 | FileCheck %s --strict-whitespace --match-full-lines -DFILE=%t.i386 --check-prefix I386
# I386:File: [[FILE]]
-# I386-NEXT:Format: ELF32-i386
+# I386-NEXT:Format: elf32-i386
# I386-NEXT:Arch: i386
# I386-NEXT:AddressSize: 32bit
# I386-NEXT:LoadName: <Not found>
@@ -52,7 +52,7 @@ FileHeader:
# RUN: | FileCheck %s --strict-whitespace --match-full-lines -DFILE=%t.x86-64 --check-prefix X86-64
# X86-64:File: [[FILE]]
-# X86-64-NEXT:Format: ELF64-x86-64
+# X86-64-NEXT:Format: elf64-x86-64
# X86-64-NEXT:Arch: x86_64
# X86-64-NEXT:AddressSize: 64bit
# X86-64-NEXT:LoadName: <Not found>
@@ -107,7 +107,7 @@ FileHeader:
Machine: EM_LANAI
# LANAI:File: [[FILE]]
-# LANAI-NEXT:Format: ELF32-lanai
+# LANAI-NEXT:Format: elf32-lanai
# LANAI-NEXT:Arch: lanai
# LANAI-NEXT:AddressSize: 32bit
# LANAI-NEXT:LoadName: <Not found>
diff --git a/llvm/test/tools/llvm-readobj/ELF/loadname.test b/llvm/test/tools/llvm-readobj/ELF/loadname.test
index c29ee33ae7e6..7bd64fd27fa7 100644
--- a/llvm/test/tools/llvm-readobj/ELF/loadname.test
+++ b/llvm/test/tools/llvm-readobj/ELF/loadname.test
@@ -4,7 +4,7 @@
# RUN: llvm-readobj %t.o | FileCheck %s --check-prefix LLVM
# RUN: llvm-readelf --dynamic-table %t.o | FileCheck %s --check-prefix GNU
-# LLVM: Format: ELF64-x86-64
+# LLVM: Format: elf64-x86-64
# LLVM-NEXT: Arch: x86_64
# LLVM-NEXT: AddressSize: 64bit
# LLVM-NEXT: LoadName: test.so
diff --git a/llvm/test/tools/llvm-readobj/ELF/no-action.test b/llvm/test/tools/llvm-readobj/ELF/no-action.test
index 964db74bf306..b18c90043854 100644
--- a/llvm/test/tools/llvm-readobj/ELF/no-action.test
+++ b/llvm/test/tools/llvm-readobj/ELF/no-action.test
@@ -7,7 +7,7 @@
# RUN: llvm-readelf %t.exe | FileCheck %s -DFILE=%t.exe --check-prefix GNU --allow-empty
# LLVM: File: [[FILE]]
-# LLVM: Format: ELF64-x86-64
+# LLVM: Format: elf64-x86-64
# LLVM: Arch: x86_64
# LLVM: AddressSize: 64bit
# LLVM: LoadName: <Not found>{{$}}
diff --git a/llvm/test/tools/llvm-readobj/ELF/ppc64-glink.test b/llvm/test/tools/llvm-readobj/ELF/ppc64-glink.test
index ac361784e06d..d173c985b5f2 100644
--- a/llvm/test/tools/llvm-readobj/ELF/ppc64-glink.test
+++ b/llvm/test/tools/llvm-readobj/ELF/ppc64-glink.test
@@ -2,7 +2,7 @@
RUN: llvm-readobj --dynamic-table %p/Inputs/ppc64.exe | FileCheck %s
-CHECK: Format: ELF64-ppc64
+CHECK: Format: elf64-powerpc
CHECK: Arch: powerpc64le
CHECK: AddressSize: 64bit
diff --git a/llvm/test/tools/llvm-readobj/ELF/program-headers.test b/llvm/test/tools/llvm-readobj/ELF/program-headers.test
index 119b3a4d9f0d..8ab5f65c02ce 100644
--- a/llvm/test/tools/llvm-readobj/ELF/program-headers.test
+++ b/llvm/test/tools/llvm-readobj/ELF/program-headers.test
@@ -79,7 +79,7 @@
# RUN: llvm-readobj -l %p/../../../Object/Inputs/program-headers.mips \
# RUN: | FileCheck %s -check-prefix ELF-MIPS
-# ELF-MIPS: Format: ELF32-mips
+# ELF-MIPS: Format: elf32-mips
# ELF-MIPS-NEXT: Arch: mips
# ELF-MIPS-NEXT: AddressSize: 32bit
# ELF-MIPS-NEXT: LoadName:
@@ -126,7 +126,7 @@
# RUN: llvm-readobj -l %p/../../../Object/Inputs/program-headers.mips64 \
# RUN: | FileCheck %s -check-prefix ELF-MIPS64
-# ELF-MIPS64: Format: ELF64-mips
+# ELF-MIPS64: Format: elf64-mips
# ELF-MIPS64-NEXT: Arch: mips64
# ELF-MIPS64-NEXT: AddressSize: 64bit
# ELF-MIPS64-NEXT: LoadName:
diff --git a/llvm/test/tools/llvm-readobj/archive.test b/llvm/test/tools/llvm-readobj/archive.test
index a06a917a5875..5b61320d0a58 100644
--- a/llvm/test/tools/llvm-readobj/archive.test
+++ b/llvm/test/tools/llvm-readobj/archive.test
@@ -13,7 +13,7 @@
# LLVM: {{^$}}
# LLVM-NEXT: File: [[ARFILE]](trivial.obj.elf-x86-64)
-# LLVM: Format: ELF64-x86-64
+# LLVM: Format: elf64-x86-64
# LLVM: ElfHeader {
# LLVM: Machine: EM_X86_64
# LLVM: Sections [
@@ -33,7 +33,7 @@
# LLVM-EMPTY:
# LLVM-NEXT: File: [[ARFILE]](trivial.obj.elf-i386)
-# LLVM: Format: ELF32-i386
+# LLVM: Format: elf32-i386
# LLVM: ElfHeader {
# LLVM: Machine: EM_386
# LLVM: Sections [
diff --git a/llvm/test/tools/llvm-readobj/thin-archive.test b/llvm/test/tools/llvm-readobj/thin-archive.test
index f0c26bf914d5..d13ae23e1b89 100644
--- a/llvm/test/tools/llvm-readobj/thin-archive.test
+++ b/llvm/test/tools/llvm-readobj/thin-archive.test
@@ -11,7 +11,7 @@
# RUN: llvm-readelf --all %t.a | FileCheck %s --check-prefixes=GNU,COFF
# LLVM: File: {{.*}}1.o
-# LLVM: Format: ELF64-x86-64
+# LLVM: Format: elf64-x86-64
# LLVM: ElfHeader {
# LLVM: SectionHeaderCount: 3
# LLVM: Sections [
@@ -23,7 +23,7 @@
# GNU: Section Headers:
# LLVM: File: {{.*}}2.o
-# LLVM: Format: ELF32-i386
+# LLVM: Format: elf32-i386
# LLVM: ElfHeader {
# LLVM: SectionHeaderCount: 4
# LLVM: Sections [
@@ -48,9 +48,9 @@
# RUN: llvm-readobj --file-headers %t.a | FileCheck %s --check-prefix=RESIZED
# RESIZED: File: {{.*}}1.o
-# RESIZED: Format: ELF64-x86-64
+# RESIZED: Format: elf64-x86-64
# RESIZED: File: {{.*}}2.o
-# RESIZED: Format: ELF64-x86-64
+# RESIZED: Format: elf64-x86-64
# Remove the second member and show that the first can still be dumped, but that the last isn't.
# RUN: rm %t/2.o
@@ -58,7 +58,7 @@
# RUN: FileCheck %s --check-prefix=ERR --input-file=%t.err
# MISSING: File: {{.*}}1.o
-# MISSING: Format: ELF64-x86-64
+# MISSING: Format: elf64-x86-64
# MISSING-NOT: File: {{.*}}3.o
# ERR: error: '{{.*}}.a': '{{.*}}2.o': {{[Nn]}}o such file or directory
More information about the llvm-commits
mailing list