1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[llvm-objdump] Print file format in lowercase to match GNU output.

Summary:
GNU objdump prints the file format in lowercase, e.g. `elf64-x86-64`. llvm-objdump prints `ELF64-x86-64` right now, even though piping that into llvm-objcopy refuses that as a valid arch to use.

As an example of a problem this causes, see: https://github.com/ClangBuiltLinux/linux/issues/779

Reviewers: MaskRay, jhenderson, alexshap

Reviewed By: MaskRay

Subscribers: tpimh, sbc100, grimar, jvesely, nhaehnle, kerbowa, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D74433
This commit is contained in:
Jordan Rupprecht 2020-02-11 11:55:40 -08:00
parent d091e1275a
commit 1a3cc9353e
23 changed files with 43 additions and 43 deletions

View File

@ -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-aarch64
; CHECK-ELF: Disassembly of section .text
; CHECK-ELF-LABEL: foo:

View File

@ -2,7 +2,7 @@
; RUN: llc -mtriple=thumbv7-windows-gnu -filetype=obj -o - %s | llvm-objdump -d - | FileCheck %s
define void @foo() {
; CHECK: file format COFF-ARM
; CHECK: file format coff-arm
; CHECK-LABEL: foo:
; CHECK: bx lr

View File

@ -21,7 +21,7 @@ define dso_local i32 @test() local_unnamed_addr #0 !dbg !14 {
ret i32 %3, !dbg !24
}
; CHECK-RELOC: file format ELF64-BPF
; CHECK-RELOC: file format elf64-bpf
; CHECK-RELOC: RELOCATION RECORDS FOR [.BTF]:
; CHECK-RELOC: R_BPF_NONE .bss
; CHECK-RELOC: R_BPF_NONE g

View File

@ -6,7 +6,7 @@ entry:
ret i32 0, !dbg !11
}
; CHECK-RELOC: file format ELF64-BPF
; CHECK-RELOC: file format elf64-bpf
; CHECK-RELOC: RELOCATION RECORDS FOR [.debug_info]:
; CHECK-RELOC: R_BPF_64_32 .debug_abbrev
; CHECK-RELOC: R_BPF_64_64 .text

View File

@ -32,7 +32,7 @@ define i32 @bpf_prog1(%struct.bpf_context* nocapture %ctx) #0 section "events/ne
; <label>:13 ; preds = %10, %0
ret i32 0
; CHECK-RELOC: file format ELF64-BPF
; CHECK-RELOC: file format elf64-bpf
; CHECK-RELOC: RELOCATION RECORDS FOR [.eh_frame]:
; CHECK-RELOC: R_BPF_64_64 events/net/netif_receive_skb
}

View File

@ -45,7 +45,7 @@ BB5:
v_lshlrev_b32_e32 v7, 2, v7
s_endpgm
// CHECK: file format ELF64-amdgpu
// CHECK: file format elf64-amdgpu
// CHECK: Disassembly of section .text:
// CHECK: hello_world:
// CHECK: s_mov_b32 m0, 0x10000 // 000000000100: BEFC00FF 00010000

View File

@ -1,7 +1,7 @@
# RUN: llvm-objdump -d -r %p/../Inputs/trivial-object-test.coff-i386 \
# RUN: | FileCheck %s -check-prefix COFF-i386
# COFF-i386: file format COFF-i386
# COFF-i386: file format coff-i386
# COFF-i386: Disassembly of section .text:
# COFF-i386: 0: 83 ec 0c subl $12, %esp
# COFF-i386: 3: c7 44 24 08 00 00 00 00 movl $0, 8(%esp)
@ -18,7 +18,7 @@
# RUN: llvm-objdump -d -r %p/../Inputs/trivial-object-test.coff-x86-64 \
# RUN: | FileCheck %s -check-prefix COFF-x86-64
# COFF-x86-64: file format COFF-x86-64
# COFF-x86-64: file format coff-x86-64
# COFF-x86-64: Disassembly of section .text:
# COFF-x86-64: 0: 48 83 ec 28 subq $40, %rsp
# COFF-x86-64: 4: c7 44 24 24 00 00 00 00 movl $0, 36(%rsp)
@ -35,7 +35,7 @@
# RUN: llvm-objdump -d -r %p/../Inputs/trivial-object-test.macho-i386 \
# RUN: | FileCheck %s -check-prefix MACHO-i386
# MACHO-i386: file format Mach-O 32-bit i386
# MACHO-i386: file format mach-o 32-bit i386
# MACHO-i386: Disassembly of section __TEXT,__text:
# MACHO-i386: _main:
# MACHO-i386: 0: 83 ec 0c subl $12, %esp
@ -53,7 +53,7 @@
# RUN: llvm-objdump -d -r %p/../Inputs/trivial-object-test.macho-x86-64 \
# RUN: | FileCheck %s -check-prefix MACHO-x86-64
# MACHO-x86-64: file format Mach-O 64-bit x86-64
# MACHO-x86-64: file format mach-o 64-bit x86-64
# MACHO-x86-64: Disassembly of section __TEXT,__text:
# MACHO-x86-64: _main:
# MACHO-x86-64: 0: 48 83 ec 08 subq $8, %rsp
@ -72,7 +72,7 @@
# RUN: yaml2obj --docnum=1 %s -o %t.elf-i386
# RUN: llvm-objdump -d -r %t.elf-i386 | FileCheck %s -check-prefix ELF-i386
# ELF-i386: file format ELF32-i386
# ELF-i386: file format elf32-i386
# ELF-i386: Disassembly of section .text:
# ELF-i386: main:
# ELF-i386: 0: 83 ec 0c subl $12, %esp
@ -170,7 +170,7 @@ Symbols:
- Name: puts
Binding: STB_GLOBAL
# ELF-x86-64: file format ELF64-x86-64
# ELF-x86-64: file format elf64-x86-64
# ELF-x86-64: Disassembly of section .text:
# ELF-x86-64: main:
# ELF-x86-64: 0: 48 83 ec 08 subq $8, %rsp

View File

@ -1,7 +1,7 @@
RUN: llvm-objdump -d %p/../Inputs/trivial-label-test.elf-x86-64 \
RUN: | FileCheck %s -check-prefix ELF-x86-64
ELF-x86-64: file format ELF64-x86-64
ELF-x86-64: file format elf64-x86-64
ELF-x86-64: Disassembly of section .text:
ELF-x86-64: foo:
ELF-x86-64: 0: 90 nop

View File

@ -1,7 +1,7 @@
# RUN: llvm-objdump -d %p/../Inputs/trivial-object-test.coff-i386 \
# RUN: | FileCheck %s -check-prefix COFF-i386
# COFF-i386: file format COFF-i386
# COFF-i386: file format coff-i386
# COFF-i386: Disassembly of section .text:
# COFF-i386: 0: 83 ec 0c subl $12, %esp
# COFF-i386: 3: c7 44 24 08 00 00 00 00 movl $0, 8(%esp)
@ -15,7 +15,7 @@
# RUN: llvm-objdump -d %p/../Inputs/trivial-object-test.coff-x86-64 \
# RUN: | FileCheck %s -check-prefix COFF-x86-64
# COFF-x86-64: file format COFF-x86-64
# COFF-x86-64: file format coff-x86-64
# COFF-x86-64: Disassembly of section .text:
# COFF-x86-64: 0: 48 83 ec 28 subq $40, %rsp
# COFF-x86-64: 4: c7 44 24 24 00 00 00 00 movl $0, 36(%rsp)
@ -29,7 +29,7 @@
# RUN: yaml2obj --docnum=1 %s -o %t.elf-i386
# RUN: llvm-objdump -d %t.elf-i386 | FileCheck %s -check-prefix ELF-i386
# ELF-i386: file format ELF32-i386
# ELF-i386: file format elf32-i386
# ELF-i386: Disassembly of section .text:
# ELF-i386: 0: 83 ec 0c subl $12, %esp
# ELF-i386: 3: c7 44 24 08 00 00 00 00 movl $0, 8(%esp)
@ -55,7 +55,7 @@ Sections:
# RUN: yaml2obj --docnum=2 %s -o %t.elf-x86-64
# RUN: llvm-objdump -d %t.elf-x86-64 | FileCheck %s -check-prefix ELF-x86-64
# ELF-x86-64: file format ELF64-x86-64
# ELF-x86-64: file format elf64-x86-64
# ELF-x86-64: Disassembly of section .text:
# ELF-x86-64: 0: 48 83 ec 08 subq $8, %rsp
# ELF-x86-64: 4: c7 44 24 04 00 00 00 00 movl $0, 4(%rsp)

View File

@ -8,5 +8,5 @@ READOBJ-NEXT: ]
RUN: llvm-objdump -r %p/Inputs/dynamic-reloc.so | FileCheck --check-prefix=OBJDUMP %s
OBJDUMP: file format ELF64-x86-64
OBJDUMP: file format elf64-x86-64
OBJDUMP-NOT: RELOCATION

View File

@ -68,7 +68,7 @@ Symbols:
# RUN: llvm-objdump -t %p/Inputs/trivial-object-test.macho-i386 \
# RUN: | FileCheck %s -check-prefix macho-i386
# macho-i386: trivial-object-test.macho-i386: file format Mach-O 32-bit i386
# macho-i386: trivial-object-test.macho-i386: file format mach-o 32-bit i386
# macho-i386: SYMBOL TABLE:
# macho-i386: 00000000 g F __TEXT,__text _main
# macho-i386: 00000000 *UND* _SomeOtherFunction

View File

@ -1,7 +1,7 @@
# RUN: yaml2obj %p/Inputs/simple-executable-x86_64.yaml -o %t
# RUN: llvm-objdump -d %t | FileCheck %s
# CHECK: : file format ELF64-x86-64
# CHECK: : file format elf64-x86-64
# CHECK-EMPTY:
# CHECK-EMPTY:
# CHECK-NEXT: Disassembly of section .text:

View File

@ -7,7 +7,7 @@
# RUN: --implicit-check-not=other
# Match this line so the implicit check-nots don't match the path.
# CHECK: {{^.*}}file format ELF64-x86-64
# CHECK: {{^.*}}file format elf64-x86-64
# CHECK: 0000000000004000 first:
# CHECK: 0000000000004001 second:

View File

@ -6,7 +6,7 @@
# RUN: llvm-objdump --dynamic-reloc %t | FileCheck --implicit-check-not=R_X86 %s
# RUN: llvm-objdump -R %t | FileCheck --implicit-check-not=R_X86 %s
# CHECK: file format ELF64-x86-64
# CHECK: file format elf64-x86-64
# CHECK: DYNAMIC RELOCATION RECORDS
# CHECK-NEXT: 0000000000000000 R_X86_64_RELATIVE *ABS*
# CHECK-NEXT: 0000000000000000 R_X86_64_JUMP_SLOT bar

View File

@ -10,7 +10,7 @@
## --reloc, so we test them independently.
## File headers (-f)
# CHECK: file format ELF64-x86-64
# CHECK: file format elf64-x86-64
# CHECK: architecture: x86_64
# CHECK: start address: 0x0000000000000000
## Private headers (-p)

View File

@ -15,7 +15,7 @@ FileHeader:
# CHECK: warning: {{.*}}: failed to disassemble missing function foo
# MULTI: file format ELF64-x86-64
# MULTI: file format elf64-x86-64
# MULTI: warning: {{.*}}: failed to disassemble missing function foo
# MULTI: file format ELF64-x86-64
# MULTI: file format elf64-x86-64
# MULTI: warning: {{.*}}: failed to disassemble missing function foo

View File

@ -6,7 +6,7 @@
## --section-headers --private-headers --reloc --syms (-afhprt). Test for them
## in the following order which provides GNU objdump compatability.
# CHECK: file format ELF64-x86-64
# CHECK: file format elf64-x86-64
# CHECK-EMPTY:
# CHECK-NEXT: architecture: x86_64
# CHECK-NEXT: start address: 0x0000000000000000
@ -25,7 +25,7 @@
# RUN: llvm-ar rcs %t.a %t %t2
# RUN: llvm-objdump --all-headers %t.a | FileCheck %s --check-prefix=ARCHIVE
# ARCHIVE: {{.*}}.a({{.*}}): file format ELF64-x86-64
# ARCHIVE: {{.*}}.a({{.*}}): file format elf64-x86-64
# ARCHIVE: rw-r--r--
# ARCHIVE: architecture: x86_64
# ARCHIVE: start address: 0x0000000000000000
@ -34,7 +34,7 @@
# ARCHIVE: Sections:
# ARCHIVE: SYMBOL TABLE:
# ARCHIVE: RELOCATION RECORDS FOR [.text]:
# ARCHIVE: {{.*}}.a({{.*}}2): file format ELF64-x86-64
# ARCHIVE: {{.*}}.a({{.*}}2): file format elf64-x86-64
# ARCHIVE: rw-r--r--
# ARCHIVE: architecture: x86_64
# ARCHIVE: start address: 0x0000000000000000

View File

@ -1,21 +1,21 @@
# RUN: llvm-objdump -a %p/Inputs/liblong_filenames.a | FileCheck %s
# RUN: llvm-objdump -archive-headers %p/Inputs/liblong_filenames.a | FileCheck %s
# CHECK: {{.*}}liblong_filenames.a(1.o): file format ELF64-x86-64
# CHECK: {{.*}}liblong_filenames.a(1.o): file format elf64-x86-64
# CHECK: rw-r--r-- 204299/200 1416 {{.*}} 1.o
# CHECK: {{.*}}liblong_filenames.a(2.o): file format ELF64-x86-64
# CHECK: {{.*}}liblong_filenames.a(2.o): file format elf64-x86-64
# CHECK: rw-r--r-- 204299/200 1224 {{.*}} 2.o
# CHECK: {{.*}}liblong_filenames.a(3.o): file format ELF64-x86-64
# CHECK: {{.*}}liblong_filenames.a(3.o): file format elf64-x86-64
# CHECK: rw-r--r-- 204299/200 1312 {{.*}} 3.o
# CHECK: {{.*}}liblong_filenames.a(4.o): file format ELF64-x86-64
# CHECK: {{.*}}liblong_filenames.a(4.o): file format elf64-x86-64
# CHECK: rw-r--r-- 204299/200 957 {{.*}} 4.o
# CHECK: {{.*}}liblong_filenames.a(5.o): file format ELF64-x86-64
# CHECK: {{.*}}liblong_filenames.a(5.o): file format elf64-x86-64
# CHECK: rw-r--r-- 204299/200 951 {{.*}} 5.o
# CHECK: {{.*}}liblong_filenames.a(6.o): file format ELF64-x86-64
# CHECK: {{.*}}liblong_filenames.a(6.o): file format elf64-x86-64
# CHECK: rw-r--r-- 204299/200 951 {{.*}} 6.o
# CHECK: {{.*}}liblong_filenames.a(abcdefghijklmnopqrstuvwxyz1.o): file format ELF64-x86-64
# CHECK: {{.*}}liblong_filenames.a(abcdefghijklmnopqrstuvwxyz1.o): file format elf64-x86-64
# CHECK: rw-r--r-- 204299/200 977 {{.*}} abcdefghijklmnopqrstuvwxyz1.o
# CHECK: {{.*}}liblong_filenames.a(abcdefghijklmnopqrstuvwxyz2.o): file format ELF64-x86-64
# CHECK: {{.*}}liblong_filenames.a(abcdefghijklmnopqrstuvwxyz2.o): file format elf64-x86-64
# CHECK: rw-r--r-- 204299/200 1272 {{.*}} abcdefghijklmnopqrstuvwxyz2.o
# CHECK: {{.*}}liblong_filenames.a(abcdefghijklmnopq.o): file format ELF64-x86-64
# CHECK: {{.*}}liblong_filenames.a(abcdefghijklmnopq.o): file format elf64-x86-64
# CHECK: rw-r--r-- 204299/200 977 {{.*}} abcdefghijklmnopq.o

View File

@ -9,6 +9,6 @@ header: !Header
sections:
symbols:
# CHECK: [[FILE]]: file format COFF-i386
# CHECK: [[FILE]]: file format coff-i386
# CHECK: architecture: i386
# CHECK: start address: 0x00000000

View File

@ -10,7 +10,7 @@ FileHeader:
Machine: EM_X86_64
Entry: 0x123456789abcde
# ELF64: [[FILE]]: file format ELF64-x86-64
# ELF64: [[FILE]]: file format elf64-x86-64
# ELF64: architecture: x86_64
# ELF64: start address: 0x00123456789abcde
@ -18,7 +18,7 @@ FileHeader:
# RUN: llvm-objdump -f %t-i386 | FileCheck -DFILE=%t-i386 %s -check-prefix ELF32
# RUN: llvm-objdump -file-headers %t-i386 | FileCheck %s -DFILE=%t-i386 -check-prefix ELF32
# ELF32: [[FILE]]: file format ELF32-i386
# ELF32: [[FILE]]: file format elf32-i386
# ELF32: architecture: i386
# ELF32: start address: 0x12345678

View File

@ -2,7 +2,7 @@
# RUN: llvm-objdump -a %t | FileCheck %s
# If this test has not crashed, then this test passed.
# CHECK: file format ELF64-x86-64
# CHECK: file format elf64-x86-64
!ELF
FileHeader:

View File

@ -7,7 +7,7 @@
# RUN: yaml2obj --docnum=3 %s -o %t3
# RUN: llvm-objdump -r %t3 | FileCheck %s -DFILE=%t3 --check-prefixes=FMT,REL --implicit-check-not={{.}}
# FMT: [[FILE]]: file format ELF64-x86-64
# FMT: [[FILE]]: file format elf64-x86-64
# REL: RELOCATION RECORDS FOR []:
# REL-NEXT: OFFSET TYPE VALUE

View File

@ -2168,7 +2168,7 @@ static void dumpObject(ObjectFile *O, const Archive *A = nullptr,
outs() << A->getFileName() << "(" << O->getFileName() << ")";
else
outs() << O->getFileName();
outs() << ":\tfile format " << O->getFileFormatName() << "\n\n";
outs() << ":\tfile format " << O->getFileFormatName().lower() << "\n\n";
}
if (StartAddress.getNumOccurrences() || StopAddress.getNumOccurrences())