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

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 11 04:01:09 PST 2015


On Wed, Nov 11, 2015 at 12:29 AM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
>> 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.
>
> The problem is that it is not "X86 X Mips". It is "Mips X every other
> architecture".

Agreed. I just used X86 as concrete example. And you are right - the
most part of `if (Config->EMachine == EM_xxx)` statements in the LLD
code will probably be related to EM_MIPS.

> Is there any hope of moving mips towards a more mainstream ABI?
> Powerpc got a new one recently. I understand that abi transitions are
> slow things, but I would really like to see a path forward that
> doesn't involve keeping all this mips specific logic forever.

As far as I know there is no plan on significant changes of MIPS ABI
in the near future. In fact we need to design completely new MIPS ABI
to eliminate all these strange, ancient MIPS specific requirements.

The best think we can do is to critically consider each part of MIPS
ABI specific requirements and implement only really necessary and
widely used things. That allows us to escape support of really
outdated things.

Unfortunately specific handling of HI/LO relocations, MIPS GOT, and
N64 relocation format are necessary and used everywhere.

-- 
Simon Atanasyan


More information about the llvm-commits mailing list