[lld] r263228 - Simplify now that local symbols can use getVA.

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 05:54:48 PST 2016


On Fri, Mar 11, 2016 at 4:04 PM, Rafael Espindola via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> It is really odd that Mips differentiates symbols that are born local
> and those that become local because of hidden visibility. I don't know
> enough mips to known if this is a bug or not.

Do you mean the fact that "true" local symbols got one kind of GOT
entries with "page" address while symbols with hidden visibility got
another kind of GOT entries with full address?

If so it is not a bug, just an ABI requirement. In case of "true"
local symbols compiler generates instructions that expect to retrieve
page address of symbol from GOT. For non-local symbols the
instructions expect to get full symbol address. But if the symbol
cannot be preempted, we do not have to put it in the "global" part of
GOT and ask dynamic linker to determine its actual address. That is
why such symbols go to the "local" part of GOT.

[...]

> +      if (Config->EMachine == EM_MIPS && !CBP) {
> +        if (Body.isLocal()) {
>            // R_MIPS_GOT16 relocation against local symbol requires index of
>            // a local GOT entry which contains page address corresponds
>            // to sum of the symbol address and addend. The addend in that

-- 
Simon Atanasyan


More information about the llvm-commits mailing list