This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [SPARC] Fix PR ld/22727
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Sun, 21 Jan 2018 08:03:05 -0800
- Subject: Re: [SPARC] Fix PR ld/22727
- Authentication-results: sourceware.org; auth=none
- References: <2902817.B1rpxRzq8I@polaris>
On Sun, Jan 21, 2018 at 1:39 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> this is the breakage of TLS in PIC/PIE mode on SPARC present on the mainline
> and 2.30 branch. There are actually 2 different bugs:
> 1. TLS transition is broken in PIE mode because of the PR ld/22263 change.
GD access should be optimized to IE or LE access in PIE. Dynamic relocation
shouldn't be needed. Can you try to revert my PR ld/22263 change one at a
time to see which single change cause the regression? Maybe
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index 4bf91fb30a..a52734cb31 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -1511,7 +1511,7 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct
bfd_link_info *info,
case R_SPARC_TLS_IE_HI22:
case R_SPARC_TLS_IE_LO10:
- if (!bfd_link_executable (info))
+ if (bfd_link_pic (info))
info->flags |= DF_STATIC_TLS;
/* Fall through */
is sufficient.
--
H.J.