[lld] r354016 - Merging r353968:
Hans Wennborg via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 14 02:49:15 PST 2019
Author: hans
Date: Thu Feb 14 02:49:15 2019
New Revision: 354016
URL: http://llvm.org/viewvc/llvm-project?rev=354016&view=rev
Log:
Merging r353968:
------------------------------------------------------------------------
r353968 | ruiu | 2019-02-13 19:51:15 +0100 (Wed, 13 Feb 2019) | 10 lines
Recover elf32-bigmips and elf32-powerpc support in LLD
This fixes a 7.0 -> 8.0 regression when parsing
OUTPUT_FORMAT("elf32-powerpc"); or elf32-bigmips directive in ldscripts
as well as an unknown emulation error when lld is invoked by clang due
to missed elf32ppclinux case.
Patch by vit9696
Differential Revision: https://reviews.llvm.org/D58005
------------------------------------------------------------------------
Modified:
lld/branches/release_80/ (props changed)
lld/branches/release_80/ELF/Driver.cpp
lld/branches/release_80/ELF/ScriptParser.cpp
lld/branches/release_80/test/ELF/emulation-mips.s
lld/branches/release_80/test/ELF/emulation-ppc.s
Propchange: lld/branches/release_80/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb 14 02:49:15 2019
@@ -1 +1 @@
-/lld/trunk:351326,351335,351898-351899,352068,352082,352257,352302,352407,352413,352435,352459,352482,352606,352928-352929,353250,353399
+/lld/trunk:351326,351335,351898-351899,352068,352082,352257,352302,352407,352413,352435,352459,352482,352606,352928-352929,353250,353399,353968
Modified: lld/branches/release_80/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_80/ELF/Driver.cpp?rev=354016&r1=354015&r2=354016&view=diff
==============================================================================
--- lld/branches/release_80/ELF/Driver.cpp (original)
+++ lld/branches/release_80/ELF/Driver.cpp Thu Feb 14 02:49:15 2019
@@ -130,7 +130,7 @@ static std::tuple<ELFKind, uint16_t, uin
.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})
Modified: lld/branches/release_80/ELF/ScriptParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_80/ELF/ScriptParser.cpp?rev=354016&r1=354015&r2=354016&view=diff
==============================================================================
--- lld/branches/release_80/ELF/ScriptParser.cpp (original)
+++ lld/branches/release_80/ELF/ScriptParser.cpp Thu Feb 14 02:49:15 2019
@@ -392,10 +392,11 @@ static std::pair<ELFKind, uint16_t> pars
.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})
Modified: lld/branches/release_80/test/ELF/emulation-mips.s
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_80/test/ELF/emulation-mips.s?rev=354016&r1=354015&r2=354016&view=diff
==============================================================================
--- lld/branches/release_80/test/ELF/emulation-mips.s (original)
+++ lld/branches/release_80/test/ELF/emulation-mips.s Thu Feb 14 02:49:15 2019
@@ -7,6 +7,9 @@
# RUN: echo 'OUTPUT_FORMAT(elf32-tradbigmips)' > %tmips.script
# RUN: ld.lld %tmips.script -e _start %tmips -o %t4mips
# RUN: llvm-readobj -file-headers %t4mips | FileCheck --check-prefix=MIPS %s
+# RUN: echo 'OUTPUT_FORMAT(elf32-bigmips)' > %tmips2.script
+# RUN: ld.lld %tmips2.script -e _start %tmips -o %t5mips
+# RUN: llvm-readobj -file-headers %t5mips | FileCheck --check-prefix=MIPS %s
# MIPS: ElfHeader {
# MIPS-NEXT: Ident {
# MIPS-NEXT: Magic: (7F 45 4C 46)
Modified: lld/branches/release_80/test/ELF/emulation-ppc.s
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_80/test/ELF/emulation-ppc.s?rev=354016&r1=354015&r2=354016&view=diff
==============================================================================
--- lld/branches/release_80/test/ELF/emulation-ppc.s (original)
+++ lld/branches/release_80/test/ELF/emulation-ppc.s Thu Feb 14 02:49:15 2019
@@ -103,5 +103,42 @@
# 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
+# RUN: ld.lld -m elf32ppclinux %tppc32 -o %t5ppc32
+# RUN: llvm-readobj -file-headers %t5ppc32 | 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:
More information about the llvm-commits
mailing list