Backport 22782 fix to 2.30 branch?

H.J. Lu hjl.tools@gmail.com
Sat Apr 21 03:13:00 GMT 2018


On Fri, Apr 20, 2018 at 7:17 PM, Roland McGrath <mcgrathr@google.com> wrote:
> https://sourceware.org/bugzilla/show_bug.cgi?id=22782 is biting me in
> trying to update to 2.30.
>
> In my case (which I'm not sure how to reproduce in a small case off
> hand), this bug was not present in 2.27 or 2.28 but is present in 2.29
> and 2.30, and fixed on trunk.
>
> commit cd04836359da82ae1dc67e5a05565536f4427b51 is HJ's fix on trunk.
> An unattended cherry-pick onto 2.30 branch applied cleanly and fixed
> the regression for me.
> It caused no check-ld failures for --target=x86_64-elf.  The log entry
> is below for reference.
>
> Can we put this onto the 2.30 branch?
>
>
> Thanks,
> Roland
>
>
> commit cd04836359da82ae1dc67e5a05565536f4427b51
> Author: H.J. Lu <hjl.tools@gmail.com>
> Date:   Mon Feb 5 08:38:16 2018 -0800
>
>     x86: Remove the unused _GLOBAL_OFFSET_TABLE_
>
>     Since _GLOBAL_OFFSET_TABLE_ may be referenced implicitly on x86,
>     checking ref_regular_nonweak leaves the unused _GLOBAL_OFFSET_TABLE_
>     in output.  This patch checks explicit GOT references instead.
>
>     ld-i386/discarded1.s and ld-x86-64/discarded1.s are updated to avoid
>     linker optimization which removes GOT references.
>

I prefer not to backport this patch alone since this will break Solaris.  There
are 2 followup patches:

commit 3b4c384407ebbdd9ed4ad5057080b3be038b8748
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Feb 9 08:44:42 2018 -0800

    x86: Add is_solaris to elf_x86_target_os

    Add is_solaris to elf_x86_target_os since Solaris is quite different.

commit dc11dea21281758b71113c03a8d8be92d175a46c
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Feb 8 13:52:22 2018 -0800

    x86: Keep the unused _GLOBAL_OFFSET_TABLE_ for Solaris

    Solaris requires to keep _GLOBAL_OFFSET_TABLE_ even if it isn't used.
    This patch detects Solaris target and keeps _GLOBAL_OFFSET_TABLE_ for
    Solaris.


-- 
H.J.



More information about the Binutils mailing list