<br><br>On Friday, 6 November 2015, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 5 November 2015 at 14:42, Simon Atanasyan <<a href="javascript:;" onclick="_e(event, 'cvml', 'simon@atanasyan.com')">simon@atanasyan.com</a>> wrote:<br>
> On Thu, Nov 5, 2015 at 9:06 PM, Rafael Espíndola<br>
> <<a href="javascript:;" onclick="_e(event, 'cvml', 'rafael.espindola@gmail.com')">rafael.espindola@gmail.com</a>> wrote:<br>
>> The question was more in line of: how does the dynamic linker take advantage<br>
>> of the got and dynamic symbols being in the same order? Why is that mips<br>
>> specific?<br>
><br>
> Look at the "Global Offset Table" section in the following document.<br>
> It is the most complete description of MIPS GOT including stubs, quick start etc<br>
> <a href="ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/psABI_mips3.0.pdf" target="_blank">ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/psABI_mips3.0.pdf</a><br>
<br>
Sorry, it is still not clear how the fact that the got and dynamic<br>
table are in the same order is used.</blockquote><div><br></div><div>On x86 dynamic linker fills GOT using R_386_GLOB_DAT relocations. Each relocation contains a symbol index and GOT entry address. On MIPS dynamic linker fills GOT without relocations. It enumerates GOT entries one by one, calculates .dynsym index of the corresponding symbol using the GOT entry index and DT_MIPS_xxx tags, and fills the GOT entry by absolute symbol's value.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Other than the hi/lo pairing, do you know what other mips specific<br>
logic we will need? I am somewhat uncomfortable with how special mips<br>
linking is.<br>
</blockquote><div><br></div><div> - N64 ABI relocation record format where each rel/rela entry might contain three different relocation</div><div>- hi/lo pairing</div><div>- .MIPS.options and .reginfo sections</div><div>- Validate and merging ELF header flags from input objects and write result to the linked binary</div><div>- Handling mixed regular/microMIPS symbols where microMIPS symbols marked using odd address and special flags in a symbol table</div><div>- Various stubs for cross-calling PIC-nonPIC code, regular/microMIPS code etc</div><div>- Multy-GOT support</div><div><br></div><div>I am writing this from my iPad, later I will provide more details and links to documentation.</div><div><br></div><div>Regards,</div><div>Simon</div><br><br>-- <br>Simon Atanasyan<br>