<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I was just committing a patch that seemed to have a valid review. You want vit9696 to be involved here. I’ve added him to the thread.<div class=""><br class=""></div><div class="">Tim.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 10 Dec 2017, at 18:58, Rafael Avila de Espindola <<a href="mailto:rafael.espindola@gmail.com" class="">rafael.espindola@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Tim Northover via llvm-commits <</span><a href="mailto:llvm-commits@lists.llvm.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">llvm-commits@lists.llvm.org</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">> writes:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Author: tnorthover<br class="">Date: Sun Dec 10 00:42:34 2017<br class="">New Revision: 320286<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=320286&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=320286&view=rev</a><br class="">Log:<br class="">PPC32: Support R_PPC_PLTREL32 in static mode.<br class=""><br class="">See <a href="https://reviews.llvm.org/D39226" class="">https://reviews.llvm.org/D39226</a><br class=""><br class="">Patch by vit9696 <<a href="mailto:vit9696@avp.su" class="">vit9696@avp.su</a>><br class=""><br class="">Modified:<br class="">   lld/trunk/ELF/Arch/PPC.cpp<br class="">   lld/trunk/test/ELF/ppc-relocs.s<br class=""><br class="">Modified: lld/trunk/ELF/Arch/PPC.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Arch/PPC.cpp?rev=320286&r1=320285&r2=320286&view=diff" class="">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Arch/PPC.cpp?rev=320286&r1=320285&r2=320286&view=diff</a><br class="">==============================================================================<br class="">--- lld/trunk/ELF/Arch/PPC.cpp (original)<br class="">+++ lld/trunk/ELF/Arch/PPC.cpp Sun Dec 10 00:42:34 2017<br class="">@@ -34,6 +34,15 @@ RelExpr PPC::getRelExpr(RelType Type, co<br class="">  case R_PPC_REL24:<br class="">  case R_PPC_REL32:<br class="">    return R_PC;<br class="">+  // In general case R_PPC_PLTREL24 should result in R_PLT_PC, however, since<br class="">+  // PLT support is currently not available for PPC32 this workaround at least<span class="Apple-converted-space"> </span><br class="">+  // allows lld to resolve local symbols when performing static linkage after<br class="">+  // LLVM started to forcibly use PLT relocations by default (see D38554).<br class="">+  // Non-local symbols will need a full PLT implementation, but once it lands<br class="">+  // local symbols should still avoid PLT table with static relocation model.<br class="">+  // This is the optimisation that bfd and gold are doing by default as well.<br class="">+  case R_PPC_PLTREL24:<br class="">+    return R_PC;<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">The generic optimization (plt -> pc) is implemented in fromPlt in</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Relocations.cpp. If the desire is to support only local symbols, this</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">could return R_PLT_PC, no?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Cheers,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Rafael</span></div></blockquote></div><br class=""></div></body></html>