[lld] r315658 - Slightly simplify code and add comment.

Ed Maste via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 18 09:53:54 PST 2017

On 18 December 2017 at 12:19, Rafael Avila de Espindola
<rafael.espindola at gmail.com> wrote:
> I have a testcase and it is trivial
> ------------------------------------
>         movl    bar at GOT(%eax), %eax
>         .data
>         .globl  bar
> bar:
>         .long   42
> ------------------------------------
> I will add it to lld, but I am trying to understand why writing the
> symbol value of a preemptible symbol is required.
> Since the value is preemptible, the dynamic linker has to lookup the
> symbol to implement R_386_GLOB_DAT, no?

Sigh, this looks like an equivalent issue to the one that affected
amd64, fixed by https://reviews.freebsd.org/rS312288 based on your
suggestion. That is, the failure comes from rtld before the dynamic
linker had an opportunity to populate the got.

So as a side effect of Rui's change i386 lld behaves as ld.bfd and
ld.gold do, even though nothing requires this as far as I know. That
said, other consumers might expect this and thus I suspect it's worth
keeping it and adding the test, but I should also change FreeBSD's
i386 rtld to avoid relying on underspecified behaviour.

More information about the llvm-commits mailing list