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

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 18 12:53:31 PST 2017


Ed Maste <emaste at freebsd.org> writes:

> 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.

Gold and bfd don't write the value to the got. I found another differece
introduced by the patch and added a test in r321021. This one was a real
bug fix, maybe that is what was causing the crash?

I fixed lld to not write the got entry in r321023. Could you check that
freebsd is still working?

Thanks,
Rafael


More information about the llvm-commits mailing list