A powerpc64 clang 4 vs. clang 5 patch difference for PltRel and GotRel for ELF
Mark Millard
markmi at dsl-only.net
Sat Jul 22 22:21:17 UTC 2017
I have been using the following personal patch for the
clang 4 environment:
# svnlite diff contrib/llvm/tools/lld/ELF/Target.cpp
Index: contrib/llvm/tools/lld/ELF/Target.cpp
===================================================================
--- contrib/llvm/tools/lld/ELF/Target.cpp (revision 321109)
+++ contrib/llvm/tools/lld/ELF/Target.cpp (working copy)
@@ -1070,7 +1070,8 @@
}
PPC64TargetInfo::PPC64TargetInfo() {
- PltRel = GotRel = R_PPC64_GLOB_DAT;
+ GotRel = R_PPC64_GLOB_DAT;
+ PltRel = R_PPC64_JMP_SLOT;
RelativeRel = R_PPC64_RELATIVE;
GotEntrySize = 8;
GotPltEntrySize = 8;
(This was not sufficient for lld to work
overall but was definitely required --possibly
it should have some sort conditional status
making the change FreeBSD specific.)
In clang 5 the code has moved:
# svnlite diff /usr/src/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp
Index: /usr/src/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp
===================================================================
--- /usr/src/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp (revision 321371)
+++ /usr/src/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp (working copy)
@@ -60,7 +60,8 @@
static uint16_t applyPPCHighesta(uint64_t V) { return (V + 0x8000) >> 48; }
PPC64::PPC64() {
- PltRel = GotRel = R_PPC64_GLOB_DAT;
+ GotRel = R_PPC64_GLOB_DAT;
+ PltRel = R_PPC64_JMP_SLOT;
RelativeRel = R_PPC64_RELATIVE;
GotEntrySize = 8;
GotPltEntrySize = 8;
(So far I'm just guessing that the patch would still
be required. I've barely started rebuilds.)
===
Mark Millard
markmi at dsl-only.net
More information about the freebsd-toolchain
mailing list