1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[llvm-objcopy] Add elf32-sparc and elf32-sparcel target

Summary:
The "sparc"/"sparcel" architectures appears in ArchMap (used by -B option) but not in OutputFormatMap (used by -I/-O option). Add their targets into OutputFormatMap for consistency.

Note that AFAIK there're no targets for 32-bit little-endian SPARC ("elf32-sparcel") in GNU binutils.

Reviewers: espindola, alexshap, rupprecht, jhenderson, compnerd, jakehehrlich

Reviewed By: jhenderson, compnerd, jakehehrlich

Subscribers: jyknight, emaste, arichardson, fedor.sergeev, jakehehrlich, MaskRay, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63238

llvm-svn: 363524
This commit is contained in:
Seiya Nuta 2019-06-17 02:03:45 +00:00
parent 8d6f3601df
commit d44769e77f
2 changed files with 15 additions and 0 deletions

View File

@ -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 @@ Symbols:
# PPC64LE-SAME: ppc64{{$}}
# RISCV32-SAME: riscv{{$}}
# RISCV64-SAME: riscv{{$}}
# SPARC-SAME: sparc
# X86-64-SAME: x86-64
# DEFAULT-SAME: unknown
@ -153,6 +162,8 @@ Symbols:
# 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 @@ Symbols:
# 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

View File

@ -306,6 +306,9 @@ static const StringMap<MachineInfo> OutputFormatMap{
{"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) {