<div dir="ltr">I think my take is that as this is clearly documented in the x86-64 psABI, we should keep it even if it seems redundant/useless.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 9, 2016 at 8:54 AM, H.J. Lu <span dir="ltr"><<a href="mailto:hjl.tools@gmail.com" target="_blank">hjl.tools@gmail.com</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 Mon, May 9, 2016 at 8:51 AM, H.J. Lu <<a href="mailto:hjl.tools@gmail.com">hjl.tools@gmail.com</a>> wrote:<br>
> On Mon, May 9, 2016 at 8:46 AM, Rafael EspĂ­ndola<br>
> <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br>
>> I was able to link and run the musl  dynamic linker with the patch that<br>
>> stops setting got[0].<br>
>><br>
>> So, Rui, what is your take on this? Should we leave that out of tree until<br>
>> it is time to try to link glibc's dynamic linker?<br>
>><br>
><br>
> If you do so, please state clearly that your linker doesn't follow<br>
> x86-64 psABI which says:<br>
><br>
> The tables first entry (number zero) is reserved to hold the address of the dy-<br>
> namic structure, referenced with the symbol _DYNAMIC. This allows a program,<br>
> such as the dynamic linker, to find its own dynamic structure without having yet<br>
> processed its relocation entries. This is especially important for the dynamic<br>
> linker, because it must initialize itself without relying on other<br>
> programs to re-<br>
> locate its memory image.<br>
<br>
</span>BTW, you also need to change the first entry of PLT to use<br>
GOT[0] and GOT[1] instead of GOT[1] and GOT[2].<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
H.J.<br>
</font></span></blockquote></div><br></div>