[PATCH] D31528: [ELF][MIPS] Multi-GOT implementation

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 06:21:13 PDT 2017


On Wed, Apr 12, 2017 at 4:16 PM, Alexander Richardson via Phabricator
<reviews at reviews.llvm.org> wrote:
> arichardson added a comment.
>
> In https://reviews.llvm.org/D31528#715906, @ruiu wrote:
>
>> This is not your fault, but I have to say that this MIPS GOT layout is very odd, too different from other architectures, and too complicated.  I want to avoid supporting this unless I'm convinced that it is absolutely necessary. It seems to me that MIPS needs a clean, common new ABI. Only the MIPS ABI imposes a lot of restrictions on the size of GOT sections and the order of GOT section members, even though MIPS as a processor is an ordinary RISC ISA. This change would really hurt maintainability of LLD which I already found some MIPS-specific behavior is hard to keep it right when editing code for all the other architectures.
>>
>> I wonder what is the performance penalty you would have to pay when you use the -mxgot option. With the option, you'll need three instructions as opposed to a single instruction to access an GOT entry. Does that actually make observable difference in performance?
>
>
> `-mxgot` does not seem to be enough to run many binaries on FreeBSD mips64. I think this is because local static variables are still accessed using a single 16 bit offset and for larger programs this is not sufficient. I am currently trying to build postgres for MIPS FreeBSD and without the multigot patch I can't link it although all source files are being compiled with -mxgot.

crt1.o, crti.o, ... files usually compiled without -mxgot but contains
relocations required GOT entries. Besides that some TLS relocations do
not have "-mxgot" counterparts like R_MIPS_CALL16 =>
R_MIPS_CALL_HI16/R_MIPS_CALL_LO16.

-- 
Simon Atanasyan


More information about the llvm-commits mailing list