[PATCH] D77579: [llvm-objcopy] Add output support for elf32-hexagon
Sid Manning via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 6 13:04:45 PDT 2020
sidneym created this revision.
sidneym added reviewers: jhenderson, MaskRay, rupprecht, bcain.
Herald added subscribers: abrachet, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: alexshap.
Herald added a project: LLVM.
Adds elf32-hexagon support and updates testcases.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D77579
Files:
llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test
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
@@ -273,6 +273,7 @@
// SPARC
{"elf32-sparc", {ELF::EM_SPARC, false, false}},
{"elf32-sparcel", {ELF::EM_SPARC, false, true}},
+ {"elf32-hexagon", {ELF::EM_HEXAGON, false, true}},
};
static Expected<TargetInfo>
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
@@ -105,6 +105,10 @@
# 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
+# RUN: llvm-objcopy %t.o -O elf32-hexagon %t.elf32_hexagon.o --split-dwo=%t.elf32_hexagon.dwo
+# RUN: llvm-readobj --file-headers %t.elf32_hexagon.o | FileCheck %s --check-prefixes=CHECK,LE,HEXAGON,32,SYSV
+# RUN: llvm-readobj --file-headers %t.elf32_hexagon.dwo | FileCheck %s --check-prefixes=CHECK,LE,HEXAGON,32,SYSV
+
!ELF
FileHeader:
Class: ELFCLASS32
@@ -139,6 +143,7 @@
# IAMCU-SAME: iamcu
# AARCH-SAME: aarch64
# ARM-SAME: littlearm
+# HEXAGON-SAME: hexagon
# MIPS-SAME: mips
# PPC-SAME: powerpc{{$}}
# PPC64BE-SAME: powerpc{{$}}
@@ -153,6 +158,7 @@
# IAMCU-NEXT: Arch: i386
# AARCH-NEXT: Arch: aarch64
# ARM-NEXT: Arch: arm
+# HEXAGON-NEXT: Arch: hexagon
# MIPSBE-NEXT: Arch: mips{{$}}
# MIPSLE-NEXT: Arch: mipsel{{$}}
# MIPS64BE-NEXT: Arch: mips64{{$}}
@@ -181,6 +187,7 @@
# AARCH: Machine: EM_AARCH64 (0xB7)
# ARM: Machine: EM_ARM (0x28)
+# HEXAGON: Machine: EM_HEXAGON (0xA4)
# I386: Machine: EM_386 (0x3)
# IAMCU: Machine: EM_IAMCU (0x6)
# MIPS: Machine: EM_MIPS (0x8)
Index: llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test
===================================================================
--- llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test
+++ llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test
@@ -30,11 +30,15 @@
# RUN: llvm-objcopy -I binary -O elf32-sparcel %t.txt %t.sparcel.o
# RUN: llvm-readobj --file-headers %t.sparcel.o | FileCheck %s --check-prefixes=CHECK,LE,SPARCEL,32
+# RUN: llvm-objcopy -I binary -O elf32-hexagon %t.txt %t.hexagon.o
+# RUN: llvm-readobj --file-headers %t.hexagon.o | FileCheck %s --check-prefixes=CHECK,LE,HEXAGON,32
+
# CHECK: Format:
# 32-SAME: elf32-
# 64-SAME: elf64-
# AARCH64-SAME: littleaarch64
# ARM-SAME: littlearm
+# HEXAGON-SAME: hexagon
# I386-SAME: i386
# MIPS-SAME: mips{{$}}
# RISCV32-SAME: riscv{{$}}
@@ -47,6 +51,7 @@
# AARCH64-NEXT: Arch: aarch64
# ARM-NEXT: Arch: arm
+# HEXAGON-NEXT: Arch: hexagon
# I386-NEXT: Arch: i386
# MIPS-NEXT: Arch: mips{{$}}
# PPC-NEXT: Arch: powerpc{{$}}
@@ -79,6 +84,7 @@
## We fill in the field regardless of -B.
# AARCH64-NEXT: Machine: EM_AARCH64 (0xB7)
# ARM-NEXT: Machine: EM_ARM (0x28)
+# HEXAGON-NEXT: Machine: EM_HEXAGON (0xA4)
# I386-NEXT: Machine: EM_386 (0x3)
# MIPS-NEXT: Machine: EM_MIPS (0x8)
# PPC-NEXT: Machine: EM_PPC (0x14)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77579.255438.patch
Type: text/x-patch
Size: 3371 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200406/6cc14fed/attachment.bin>
More information about the llvm-commits
mailing list