[PATCH] D14281: [ELF2] Sort dynamic symbols according to the MIPS requirements.

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 6 14:27:18 PST 2015


On Friday, 6 November 2015, Rafael EspĂ­ndola <rafael.espindola at gmail.com>
wrote:

> On 5 November 2015 at 14:42, Simon Atanasyan <simon at atanasyan.com
> <javascript:;>> wrote:
> > On Thu, Nov 5, 2015 at 9:06 PM, Rafael EspĂ­ndola
> > <rafael.espindola at gmail.com <javascript:;>> wrote:
> >> The question was more in line of: how does the dynamic linker take
> advantage
> >> of the got and dynamic symbols being in the same order? Why is that mips
> >> specific?
> >
> > Look at the "Global Offset Table" section in the following document.
> > It is the most complete description of MIPS GOT including stubs, quick
> start etc
> > ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/psABI_mips3.0.pdf
>
> Sorry, it is still not clear how the fact that the got and dynamic
> table are in the same order is used.


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.


> Other than the hi/lo pairing, do you know what other mips specific
> logic we will need? I am somewhat uncomfortable with how special mips
> linking is.
>

 - N64 ABI relocation record format where each rel/rela entry might contain
three different relocation
- hi/lo pairing
- .MIPS.options and .reginfo sections
- Validate and merging ELF header flags from input objects and write result
to the linked binary
- Handling mixed regular/microMIPS symbols where microMIPS symbols marked
using odd address and special flags in a symbol table
- Various stubs for cross-calling PIC-nonPIC code, regular/microMIPS code
etc
- Multy-GOT support

I am writing this from my iPad, later I will provide more details and links
to documentation.

Regards,
Simon


-- 
Simon Atanasyan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151107/f5c8baaa/attachment.html>


More information about the llvm-commits mailing list