[PATCH] D25560: [ELF] Emit relocation for GOT entry even if it is an absolute symbol

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 27 11:11:28 PDT 2016

On 27 October 2016 at 10:44, Eugene Leviant <evgeny.leviant at gmail.com> wrote:
> The problem is that such kind of bugs very quickly become "features" :)
> Here is the real use case:
> 1) There is an undefined 'MySym' symbol in a shared library, which has GOT entry
> 2) You link this shared library using this script:
>    /* .... */
>    PROVIDE_HIDDEN(MySym = .);
>    /* ... */
> }
> After library is loaded MySym will have incorrect value, because it is
> actually an absolute symbol.

I guess the error in here is that MySym should not actually be
absolute, which I guess is also the underlying problem in pr30406.

> I think every GOT entry should be relocated, shouldn't it?

Not if it should contain an absolute value.


More information about the llvm-commits mailing list