[PATCH] D27276: [ELF, WIP] Allow defined symbols to be assigned from linker script

Simon Atanasyan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 13:53:58 PST 2016


atanasyan added a comment.

> _gp gets a value of &.got + 0x100. The *new* definition from the linker script gets defined in .got too.
> 
> FWIW, in most MIPS toolchains I have work with _gp is an absolute symbol and *not* a .got relative one

You are right. It's an old bug in LLD and I regularly postpone to fix it. The _gp symbol should be an absolute symbol. If it is not defined in a linker script we need to assign default value .got + 0x7ff0. It looks like it's time to fix this problem.

To Rui: The _gp symbol marks the base of the small data area. Not only GOT relocations depend on _gp. Users of bare-metal toolchains might want to place small data to specific address.


https://reviews.llvm.org/D27276





More information about the llvm-commits mailing list