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

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 5 11:42:25 PST 2015


On Thu, Nov 5, 2015 at 9:06 PM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> 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

> Also, could the got be sorted to match the symbol table? That way the gnu
> hash table would still work. I have asked the same question on the binutils
> list where a mips only gnu hash is being discussed.

I thinks it is impossible to get a symbol table with arbitrary order of entries
and sort GOT in a such way that the following predicate is satisfied:

"GOT entry address" = DT_PLTGOT + DT_MIPS_LOCAL_GOTNO + "symbol index
in .dynsym" - DT_MIPS_GOTSYM

The first problem is two different part of GOT local/global. They
cannot be mixed.
The second problem is that number of GOT entries is not equal to
number of .dynsym entries.

-- 
Simon Atanasyan


More information about the llvm-commits mailing list