[llvm] r358667 - [llvm-objcopy] Add -B mips
Jordan Rupprecht via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 18 07:22:38 PDT 2019
Author: rupprecht
Date: Thu Apr 18 07:22:37 2019
New Revision: 358667
URL: http://llvm.org/viewvc/llvm-project?rev=358667&view=rev
Log:
[llvm-objcopy] Add -B mips
Modified:
llvm/trunk/test/tools/llvm-objcopy/ELF/binary-input-arch.test
llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp
Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/binary-input-arch.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/binary-input-arch.test?rev=358667&r1=358666&r2=358667&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/binary-input-arch.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/binary-input-arch.test Thu Apr 18 07:22:37 2019
@@ -1,30 +1,34 @@
# RUN: echo abcd > %t.txt
# RUN: llvm-objcopy -I binary -B aarch64 %t.txt %t.aarch64.o
-# RUN: llvm-readobj --file-headers %t.aarch64.o | FileCheck %s --check-prefixes=CHECK,AARCH64,64
+# RUN: llvm-readobj --file-headers %t.aarch64.o | FileCheck %s --check-prefixes=CHECK,LE,AARCH64,64
# RUN: llvm-objcopy -I binary -B arm %t.txt %t.arm.o
-# RUN: llvm-readobj --file-headers %t.arm.o | FileCheck %s --check-prefixes=CHECK,ARM,32
+# RUN: llvm-readobj --file-headers %t.arm.o | FileCheck %s --check-prefixes=CHECK,LE,ARM,32
# RUN: llvm-objcopy -I binary -B i386 %t.txt %t.i386.o
-# RUN: llvm-readobj --file-headers %t.i386.o | FileCheck %s --check-prefixes=CHECK,I386,32
+# RUN: llvm-readobj --file-headers %t.i386.o | FileCheck %s --check-prefixes=CHECK,LE,I386,32
# RUN: llvm-objcopy -I binary -B i386:x86-64 %t.txt %t.i386_x86-64.o
-# RUN: llvm-readobj --file-headers %t.i386_x86-64.o | FileCheck %s --check-prefixes=CHECK,X86-64,64
+# RUN: llvm-readobj --file-headers %t.i386_x86-64.o | FileCheck %s --check-prefixes=CHECK,LE,X86-64,64
+
+# RUN: llvm-objcopy -I binary -B mips %t.txt %t.mips.o
+# RUN: llvm-readobj --file-headers %t.mips.o | FileCheck %s --check-prefixes=CHECK,BE,MIPS,32
# RUN: llvm-objcopy -I binary -B powerpc:common64 %t.txt %t.powerpc_common64.o
-# RUN: llvm-readobj --file-headers %t.powerpc_common64.o | FileCheck %s --check-prefixes=CHECK,PPC,64
+# RUN: llvm-readobj --file-headers %t.powerpc_common64.o | FileCheck %s --check-prefixes=CHECK,LE,PPC,64
# RUN: llvm-objcopy -I binary -B sparc %t.txt %t.sparc.o
-# RUN: llvm-readobj --file-headers %t.sparc.o | FileCheck %s --check-prefixes=CHECK,SPARC,32
+# RUN: llvm-readobj --file-headers %t.sparc.o | FileCheck %s --check-prefixes=CHECK,LE,SPARC,32
# RUN: llvm-objcopy -I binary -B x86-64 %t.txt %t.x86-64.o
-# RUN: llvm-readobj --file-headers %t.x86-64.o | FileCheck %s --check-prefixes=CHECK,X86-64,64
+# RUN: llvm-readobj --file-headers %t.x86-64.o | FileCheck %s --check-prefixes=CHECK,LE,X86-64,64
# CHECK: Format:
# AARCH64-SAME: ELF64-aarch64-little
# ARM-SAME: ELF32-arm-little
# I386-SAME: ELF32-i386
+# MIPS-SAME: ELF32-mips{{$}}
# PPC-SAME: ELF64-ppc64
# SPARC-SAME: ELF32-sparc
# X86-64-SAME: ELF64-x86-64
@@ -32,6 +36,7 @@
# AARCH64-NEXT: Arch: aarch64
# ARM-NEXT: Arch: arm
# I386-NEXT: Arch: i386
+# MIPS-NEXT: Arch: mips{{$$}}
# PPC-NEXT: Arch: powerpc64le
# SPARC-NEXT: Arch: sparcel
# X86-64-NEXT: Arch: x86_64
@@ -44,7 +49,8 @@
# CHECK-NEXT: Magic: (7F 45 4C 46)
# 32-NEXT: Class: 32-bit (0x1)
# 64-NEXT: Class: 64-bit (0x2)
-# CHECK-NEXT: DataEncoding: LittleEndian (0x1)
+# LE-NEXT: DataEncoding: LittleEndian (0x1)
+# BE-NEXT: DataEncoding: BigEndian (0x2)
# CHECK-NEXT: FileVersion: 1
# CHECK-NEXT: OS/ABI: SystemV (0x0)
# CHECK-NEXT: ABIVersion: 0
@@ -54,6 +60,7 @@
# AARCH64-NEXT: Machine: EM_AARCH64 (0xB7)
# ARM-NEXT: Machine: EM_ARM (0x28)
# I386-NEXT: Machine: EM_386 (0x3)
+# MIPS-NEXT: Machine: EM_MIPS (0x8)
# PPC-NEXT: Machine: EM_PPC64 (0x15)
# SPARC-NEXT: Machine: EM_SPARC (0x2)
# X86-64-NEXT: Machine: EM_X86_64 (0x3E)
Modified: llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp?rev=358667&r1=358666&r2=358667&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp (original)
+++ llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp Thu Apr 18 07:22:37 2019
@@ -258,6 +258,7 @@ static const StringMap<MachineInfo> Arch
{"arm", {ELF::EM_ARM, false, true}},
{"i386", {ELF::EM_386, false, true}},
{"i386:x86-64", {ELF::EM_X86_64, true, true}},
+ {"mips", {ELF::EM_MIPS, false, false}},
{"powerpc:common64", {ELF::EM_PPC64, true, true}},
{"sparc", {ELF::EM_SPARC, false, true}},
{"x86-64", {ELF::EM_X86_64, true, true}},
More information about the llvm-commits
mailing list