[PATCH] D63238: [llvm-objcopy] Add elf32-sparc and elf32-sparcel target
Seiya Nuta via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 13 16:34:51 PDT 2019
seiya updated this revision to Diff 204658.
seiya added a comment.
- FIx endianess: see https://reviews.llvm.org/rL363336
- Add elf32-sparcel for 32-bit little endian SPARC.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63238/new/
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
@@ -306,6 +306,9 @@
{"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, false}},
+ {"elf32-sparcel", {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,14 @@
# 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,BE,SPARC,32,SYSV
+# RUN: llvm-readobj --file-headers %t.elf32_sparc.dwo | FileCheck %s --check-prefixes=CHECK,BE,SPARC,32,SYSV
+
+# RUN: llvm-objcopy %t.o -O elf32-sparcel %t.elf32_sparcel.o --split-dwo=%t.elf32_sparcel.dwo
+# RUN: llvm-readobj --file-headers %t.elf32_sparcel.o | FileCheck %s --check-prefixes=CHECK,LE,SPARCEL,32,SYSV
+# RUN: llvm-readobj --file-headers %t.elf32_sparcel.dwo | FileCheck %s --check-prefixes=CHECK,LE,SPARCEL,32,SYSV
+
!ELF
FileHeader:
Class: ELFCLASS32
@@ -137,6 +145,7 @@
# PPC64LE-SAME: ppc64{{$}}
# RISCV32-SAME: riscv{{$}}
# RISCV64-SAME: riscv{{$}}
+# SPARC-SAME: sparc
# X86-64-SAME: x86-64
# DEFAULT-SAME: unknown
@@ -153,6 +162,8 @@
# PPC64LE-NEXT: Arch: powerpc64le
# RISCV32-NEXT: Arch: riscv32
# RISCV64-NEXT: Arch: riscv64
+# SPARC-NEXT: Arch: sparc{{$}}
+# SPARCEL-NEXT: Arch: sparcel
# X86-64-NEXT: Arch: x86_64
# DEFAULT-NEXT: Arch: unknown
@@ -177,6 +188,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.204658.patch
Type: text/x-patch
Size: 2468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190613/585e8069/attachment.bin>
More information about the llvm-commits
mailing list