[PATCH] D81033: [PowerPC] Fix incorrect PC Relative relocations for Big Endian
Stefan Pintilie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 8 18:50:46 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb4036329f163: [PowerPC] Fix incorrect PC Relative relocations for Big Endian (authored by stefanp).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81033/new/
https://reviews.llvm.org/D81033
Files:
llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
llvm/test/MC/PowerPC/future-reloc.s
Index: llvm/test/MC/PowerPC/future-reloc.s
===================================================================
--- llvm/test/MC/PowerPC/future-reloc.s
+++ llvm/test/MC/PowerPC/future-reloc.s
@@ -3,6 +3,11 @@
# RUN: llvm-mc -triple=powerpc64le-unknown-unknown -filetype=obj %s | \
# RUN: llvm-readobj -r | FileCheck %s -check-prefix=READOBJ
+# RUN: llvm-mc -triple=powerpc64-unknown-unknown -filetype=obj %s 2>&1 | \
+# RUN: FileCheck %s -check-prefix=MC
+# RUN: llvm-mc -triple=powerpc64-unknown-unknown -filetype=obj %s | \
+# RUN: llvm-readobj -r | FileCheck %s -check-prefix=READOBJ
+
# This test checks that on Power PC we can correctly convert @pcrel and
# @got at pcrel into R_PPC64_PCREL34 and R_PPC64_GOT_PCREL34.
Index: llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
===================================================================
--- llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
+++ llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
@@ -113,7 +113,7 @@
return getMachineOpValue(MI, MO, Fixups, STI);
// Add a fixup for the immediate field.
- Fixups.push_back(MCFixup::create(IsLittleEndian? 0 : 1, MO.getExpr(),
+ Fixups.push_back(MCFixup::create(0, MO.getExpr(),
(MCFixupKind)PPC::fixup_ppc_pcrel34));
return 0;
}
@@ -217,7 +217,7 @@
"VariantKind must be VK_PCREL or VK_PPC_GOT_PCREL");
// Generate the fixup for the relocation.
Fixups.push_back(
- MCFixup::create(IsLittleEndian ? 0 : 1, Expr,
+ MCFixup::create(0, Expr,
static_cast<MCFixupKind>(PPC::fixup_ppc_pcrel34)));
// There is no offset to return so just return 0.
return 0;
@@ -249,7 +249,7 @@
"VariantKind must be VK_PCREL or VK_PPC_GOT_PCREL");
// Generate the fixup for the relocation.
Fixups.push_back(
- MCFixup::create(IsLittleEndian ? 0 : 1, Expr,
+ MCFixup::create(0, Expr,
static_cast<MCFixupKind>(PPC::fixup_ppc_pcrel34)));
assert(isInt<34>(CE->getValue()) && "Value must fit in 34 bits.");
// Return the offset that should be added to the relocation by the linker.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81033.269399.patch
Type: text/x-patch
Size: 2182 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200609/0f463782/attachment.bin>
More information about the llvm-commits
mailing list