[PATCH] D63238: [llvm-objcopy] Add elf32-sparc target
Seiya Nuta via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 12 17:11:42 PDT 2019
seiya created this revision.
Herald added subscribers: llvm-commits, MaskRay, jakehehrlich, fedor.sergeev, arichardson, emaste, jyknight.
Herald added a reviewer: espindola.
Herald added a reviewer: alexshap.
Herald added a reviewer: rupprecht.
Herald added a reviewer: jhenderson.
Herald added a project: LLVM.
The "sparc" architecture appears in ArchMap (used by -B option) but not in OutputFormatMap (used by -I/-O option). Add its target into OutputFormatMap for consistency.
https://reviews.llvm.org/D63238
Files:
llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test
llvm/tools/llvm-objcopy/CopyConfig.cpp
Index: llvm/tools/llvm-objcopy/CopyConfig.cpp
===================================================================
--- llvm/tools/llvm-objcopy/CopyConfig.cpp
+++ llvm/tools/llvm-objcopy/CopyConfig.cpp
@@ -305,6 +305,8 @@
{"elf32-tradlittlemips", {ELF::EM_MIPS, false, true}},
{"elf64-tradbigmips", {ELF::EM_MIPS, true, false}},
{"elf64-tradlittlemips", {ELF::EM_MIPS, true, true}},
+ // SPARC
+ {"elf32-sparc", {ELF::EM_SPARC, false, true}},
};
static Expected<MachineInfo> getOutputFormatMachineInfo(StringRef Format) {
Index: llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test
===================================================================
--- llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test
+++ llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test
@@ -97,6 +97,10 @@
# RUN: llvm-readobj --file-headers %t.elf64_tradlittlemips.o | FileCheck %s --check-prefixes=CHECK,LE,MIPS,MIPS64LE,64,SYSV
# RUN: llvm-readobj --file-headers %t.elf64_tradlittlemips.dwo | FileCheck %s --check-prefixes=CHECK,LE,MIPS,MIPS64LE,64,SYSV
+# RUN: llvm-objcopy %t.o -O elf32-sparc %t.elf32_sparc.o --split-dwo=%t.elf32_sparc.dwo
+# RUN: llvm-readobj --file-headers %t.elf32_sparc.o | FileCheck %s --check-prefixes=CHECK,LE,SPARC,32,SYSV
+# RUN: llvm-readobj --file-headers %t.elf32_sparc.dwo | FileCheck %s --check-prefixes=CHECK,LE,SPARC,32,SYSV
+
!ELF
FileHeader:
Class: ELFCLASS32
@@ -137,6 +141,7 @@
# PPC64LE-SAME: ppc64{{$}}
# RISCV32-SAME: riscv{{$}}
# RISCV64-SAME: riscv{{$}}
+# SPARC-SAME: sparc
# X86-64-SAME: x86-64
# DEFAULT-SAME: unknown
@@ -153,6 +158,7 @@
# PPC64LE-NEXT: Arch: powerpc64le
# RISCV32-NEXT: Arch: riscv32
# RISCV64-NEXT: Arch: riscv64
+# SPARC-NEXT: Arch: sparcel
# X86-64-NEXT: Arch: x86_64
# DEFAULT-NEXT: Arch: unknown
@@ -177,6 +183,7 @@
# PPC64: Machine: EM_PPC64 (0x15)
# RISCV32: Machine: EM_RISCV (0xF3)
# RISCV64: Machine: EM_RISCV (0xF3)
+# SPARC: Machine: EM_SPARC (0x2)
# X86-64: Machine: EM_X86_64 (0x3E)
# 32: HeaderSize: 52
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63238.204393.patch
Type: text/x-patch
Size: 2055 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190613/ffb36c22/attachment.bin>
More information about the llvm-commits
mailing list