Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jul 2017 15:14:33 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   A powerpc64 clang 4 vs. clang 5 patch difference for PltRel and GotRel for ELF
Message-ID:  <BA8C9880-A5D2-4D33-A2B3-D0A472921BF0@dsl-only.net>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BA8C9880-A5D2-4D33-A2B3-D0A472921BF0>