<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Nov 20, 2015 at 10:13 PM, Simon Atanasyan <span dir="ltr"><<a href="mailto:simon@atanasyan.com" target="_blank">simon@atanasyan.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
There are more than one MIPS relocations which need GOT entry<br>
creation. Let's consider two of them R_MIPS_GOT16 and R_MIPS_CALL16<br>
[1]. R_MIPS_GOT16 is applicable to local and external symbols and<br>
performs a different calculation in each cases [2]. R_MIPS_CALL16 is<br>
applicable to external symbols only and a linker should show an error<br>
if it finds R_MIPS_CALL16 with a local target. Now LLD in the<br>
`InputSectionBase<ELFT>::relocate` methods hides original type of GOT<br>
relocations and always use the result of `Target->getGotRefReloc()`<br>
call. In case of MIPS it is R_MIPS_GOT16. It makes impossible to<br>
perform target symbol type checking and the error generation in the<br>
`MipsTargetInfo<ELFT>::relocateOne` method.<br></blockquote><div><br></div><div>I guess there's no need to hide the type. It's just that because it works for x86, x86-64 or aarch64. If mips requires more info, it should be ok to change that.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is it really necessary to hide original relocation type? If a target<br>
has multiple GOT related relocations it might just add more `cases` to<br>
its `relocateOne` method.<br>
<br>
[1] <a href="ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf" rel="noreferrer" target="_blank">ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf</a> page 4-19<br>
[2] <a href="ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf" rel="noreferrer" target="_blank">ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf</a> page 4-20<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Simon Atanasyan<br>
</font></span></blockquote></div><br></div></div>