<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 7, 2016 at 11:52 AM, Joerg Sonnenberger via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, May 07, 2016 at 10:58:51AM -0700, Xinliang David Li via llvm-commits wrote:<br>
> To be clear, assuming copyrelocs (support in linker) allows compiler to<br>
> generate efficient code (speculatively) to access external globals which<br>
> compiler has no idea where they are going to be defined. For most of the<br>
> cases, the most of globals end up in the main program, so copyrelocs is<br>
> only a fallback mechanism in case that is not the case.<br>
<br>
</span>I think your reasoning is confusing cause and effect. Copy relocations<br>
exist, because people didn't want to change things when shared linkage<br>
was introduced.</blockquote><div><br></div><div>What do you mean by 'people didn't want to change things'? </div><div><br></div><div>For executable, copy reloc is introduced so that global access without GOT can be used without requiring text relocation when the reference is truly external.  Are you saying this is not the case?  History aside, this is certainly how copyreloc is used today.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> It is a horrible hack and everyone seriously involved<br>
with ELF acknowledges that it is a horrible hack only comparible to text<br>
relocatiions </blockquote><div><br></div><div>You can certainly feel this way, but making claims about 'everyone involved ..' seems to have no basis and is not relevant here.</div><div><br></div><div>David</div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There are cleaner ways to address the problem for PIE<br>
without readding this nightmare. You can mark symbols as hidden. You can<br>
mark symbols as protected. Both can allow better code generation.</blockquote><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> The<br>
reduced register pressure is a myth IMO, the difference between a GOT<br>
load and a direct reference to a symbol for PIC and PIE is being able to<br>
fold an index computation. That's it.<br>
<br>
Joerg<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>