<p dir="ltr"><br>
On May 27, 2016 12:18 PM, "Simon Atanasyan" <<a href="mailto:simon@atanasyan.com">simon@atanasyan.com</a>> wrote:<br>
><br>
> atanasyan added a comment.<br>
><br>
> In <a href="http://reviews.llvm.org/D20664#442189">http://reviews.llvm.org/D20664#442189</a>, @rafael wrote:<br>
><br>
> > Any idea why gpword is used with a global?<br>
><br>
><br>
> It's my mistake. I select a wrong test case to show the problem (it was easier to copy-paste existing test code). A real case is R_MIPS_GPREL16. This relocation is used to setup GP offset in a function's prologue. That is why it should be always resolved locally. Here is an example. I am going to update the test case before commit.<br>
><br>
>     .text<br>
>     .global  entry<br>
>   entry:<br>
>     lui     $gp,%hi(%neg(%gp_rel(foo)))<br>
>     daddu   $gp,$gp,$t9<br>
>     daddiu  $gp,$gp,%lo(%neg(%gp_rel(foo)))<br>
><br>
> R_MIPS_GPREL32 is for local symbols. But GNU linker does not show any error if R_MIPS_GPREL32's target is preemptible symbol. So I still think it is better to handle them uniformly too.<br></p>
<p dir="ltr">If it doesn't show up in the wild, please don't check for it.</p>
<p dir="ltr">Cheers,<br>
Rafael<br></p>
<p dir="ltr">> And thanks for review.<br>
><br>
><br>
> Repository:<br>
>   rL LLVM<br>
><br>
> <a href="http://reviews.llvm.org/D20664">http://reviews.llvm.org/D20664</a><br>
><br>
><br>
><br>
</p>