[PATCH] D53652: [PPC64] Handle powerpc64 in OUTPUT_FORMAT
Sean Fertile via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 30 07:40:50 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLD345604: [PPC64] Handle powerpc64 in OUTPUT_FORMAT. (authored by sfertile, committed by ).
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D53652
Files:
ELF/ScriptParser.cpp
test/ELF/emulation-ppc.s
Index: test/ELF/emulation-ppc.s
===================================================================
--- test/ELF/emulation-ppc.s
+++ test/ELF/emulation-ppc.s
@@ -4,6 +4,10 @@
# RUN: llvm-readobj -file-headers %t2ppc64 | FileCheck --check-prefix=PPC64 %s
# RUN: ld.lld %tppc64 -o %t3ppc64
# RUN: llvm-readobj -file-headers %t3ppc64 | FileCheck --check-prefix=PPC64 %s
+# RUN: echo 'OUTPUT_FORMAT(elf64-powerpc)' > %tppc64.script
+# RUN: ld.lld %tppc64.script %tppc64 -o %t4ppc64
+# RUN: llvm-readobj -file-headers %t4ppc64 | FileCheck --check-prefix=PPC64 %s
+
# PPC64: ElfHeader {
# PPC64-NEXT: Ident {
# PPC64-NEXT: Magic: (7F 45 4C 46)
@@ -36,6 +40,10 @@
# RUN: llvm-readobj -file-headers %t2ppc64le | FileCheck --check-prefix=PPC64LE %s
# RUN: ld.lld %tppc64le -o %t3ppc64le
# RUN: llvm-readobj -file-headers %t3ppc64le | FileCheck --check-prefix=PPC64LE %s
+# RUN: echo 'OUTPUT_FORMAT(elf64-powerpcle)' > %tppc64le.script
+# RUN: ld.lld %tppc64le.script %tppc64le -o %t4ppc64le
+# RUN: llvm-readobj -file-headers %t4ppc64le | FileCheck --check-prefix=PPC64LE %s
+
# PPC64LE: ElfHeader {
# PPC64LE-NEXT: Ident {
# PPC64LE-NEXT: Magic: (7F 45 4C 46)
Index: ELF/ScriptParser.cpp
===================================================================
--- ELF/ScriptParser.cpp
+++ ELF/ScriptParser.cpp
@@ -395,6 +395,10 @@
return {ELF32LEKind, EM_X86_64};
if (S == "elf64-littleaarch64")
return {ELF64LEKind, EM_AARCH64};
+ if (S == "elf64-powerpc")
+ return {ELF64BEKind, EM_PPC64};
+ if (S == "elf64-powerpcle")
+ return {ELF64LEKind, EM_PPC64};
if (S == "elf64-x86-64")
return {ELF64LEKind, EM_X86_64};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53652.171693.patch
Type: text/x-patch
Size: 1669 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181030/5f94de23/attachment.bin>
More information about the llvm-commits
mailing list