[PATCH] D58005: Recover elf32-bigmips and elf32-powerpc support in LLD
vit9696 via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 11 13:53:08 PST 2019
vit9696 updated this revision to Diff 186324.
vit9696 retitled this revision from "Recover elf32-powerpc support in LLD" to "Recover elf32-bigmips and elf32-powerpc support in LLD".
vit9696 edited the summary of this revision.
Herald added subscribers: atanasyan, kbarton, sdardis.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58005/new/
https://reviews.llvm.org/D58005
Files:
lld/ELF/Driver.cpp
lld/ELF/ScriptParser.cpp
lld/test/ELF/emulation-ppc.s
Index: lld/test/ELF/emulation-ppc.s
===================================================================
--- lld/test/ELF/emulation-ppc.s
+++ lld/test/ELF/emulation-ppc.s
@@ -103,5 +103,40 @@
# PPC64LE-NEXT: StringTableSectionIndex:
# PPC64LE-NEXT: }
+# RUN: llvm-mc -filetype=obj -triple=powerpc-unknown-linux %s -o %tppc32
+# RUN: ld.lld -m elf32ppc %tppc32 -o %t2ppc32
+# RUN: llvm-readobj -file-headers %t2ppc32 | FileCheck --check-prefix=PPC32 %s
+# RUN: ld.lld %tppc32 -o %t3ppc32
+# RUN: llvm-readobj -file-headers %t3ppc32 | FileCheck --check-prefix=PPC32 %s
+# RUN: echo 'OUTPUT_FORMAT(elf32-powerpc)' > %tppc32.script
+# RUN: ld.lld %tppc32.script %tppc32 -o %t4ppc32
+# RUN: llvm-readobj -file-headers %t4ppc32 | FileCheck --check-prefix=PPC32 %s
+
+# PPC32: ElfHeader {
+# PPC32-NEXT: Ident {
+# PPC32-NEXT: Magic: (7F 45 4C 46)
+# PPC32-NEXT: Class: 32-bit (0x1)
+# PPC32-NEXT: DataEncoding: BigEndian (0x2)
+# PPC32-NEXT: FileVersion: 1
+# PPC32-NEXT: OS/ABI: SystemV (0x0)
+# PPC32-NEXT: ABIVersion: 0
+# PPC32-NEXT: Unused: (00 00 00 00 00 00 00)
+# PPC32-NEXT: }
+# PPC32-NEXT: Type: Executable (0x2)
+# PPC32-NEXT: Machine: EM_PPC (0x14)
+# PPC32-NEXT: Version: 1
+# PPC32-NEXT: Entry:
+# PPC32-NEXT: ProgramHeaderOffset: 0x34
+# PPC32-NEXT: SectionHeaderOffset:
+# PPC32-NEXT: Flags [ (0x0)
+# PPC32-NEXT: ]
+# PPC32-NEXT: HeaderSize: 52
+# PPC32-NEXT: ProgramHeaderEntrySize: 32
+# PPC32-NEXT: ProgramHeaderCount:
+# PPC32-NEXT: SectionHeaderEntrySize: 40
+# PPC32-NEXT: SectionHeaderCount:
+# PPC32-NEXT: StringTableSectionIndex:
+# PPC32-NEXT: }
+
.globl _start
_start:
Index: lld/ELF/ScriptParser.cpp
===================================================================
--- lld/ELF/ScriptParser.cpp
+++ lld/ELF/ScriptParser.cpp
@@ -391,10 +391,11 @@
.Case("elf32-x86-64", {ELF32LEKind, EM_X86_64})
.Case("elf64-aarch64", {ELF64LEKind, EM_AARCH64})
.Case("elf64-littleaarch64", {ELF64LEKind, EM_AARCH64})
+ .Case("elf32-powerpc", {ELF32BEKind, EM_PPC})
.Case("elf64-powerpc", {ELF64BEKind, EM_PPC64})
.Case("elf64-powerpcle", {ELF64LEKind, EM_PPC64})
.Case("elf64-x86-64", {ELF64LEKind, EM_X86_64})
- .Case("elf32-tradbigmips", {ELF32BEKind, EM_MIPS})
+ .Cases("elf32-tradbigmips", "elf32-bigmips", {ELF32BEKind, EM_MIPS})
.Case("elf32-ntradbigmips", {ELF32BEKind, EM_MIPS})
.Case("elf32-tradlittlemips", {ELF32LEKind, EM_MIPS})
.Case("elf32-ntradlittlemips", {ELF32LEKind, EM_MIPS})
Index: lld/ELF/Driver.cpp
===================================================================
--- lld/ELF/Driver.cpp
+++ lld/ELF/Driver.cpp
@@ -129,7 +129,7 @@
.Cases("elf32btsmip", "elf32btsmipn32", {ELF32BEKind, EM_MIPS})
.Cases("elf32ltsmip", "elf32ltsmipn32", {ELF32LEKind, EM_MIPS})
.Case("elf32lriscv", {ELF32LEKind, EM_RISCV})
- .Case("elf32ppc", {ELF32BEKind, EM_PPC})
+ .Cases("elf32ppc", "elf32ppclinux", {ELF32BEKind, EM_PPC})
.Case("elf64btsmip", {ELF64BEKind, EM_MIPS})
.Case("elf64ltsmip", {ELF64LEKind, EM_MIPS})
.Case("elf64lriscv", {ELF64LEKind, EM_RISCV})
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58005.186324.patch
Type: text/x-patch
Size: 3214 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190211/b56779f6/attachment.bin>
More information about the llvm-commits
mailing list