This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Use STT_TLS for all TLS symbols (even SHN_UNDEF) (take 2)
- From: kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: jakub at redhat dot com
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 20 Nov 2002 08:21:31 +0900
- Subject: Re: [PATCH] Use STT_TLS for all TLS symbols (even SHN_UNDEF) (take 2)
- References: <20021119145850.J14760@sunsite.ms.mff.cuni.cz>
Jakub Jelinek <jakub@redhat.com> wrote:
> Here is a fixed patch (plus I've added IA-64 and Alpha changes too).
> Is it ok?
>
> 2002-11-19 Jakub Jelinek <jakub@redhat.com>
>
> * symbols.c (S_SET_THREAD_LOCAL): New function.
> * symbols.h (S_SET_THREAD_LOCAL): New prototype.
> * config/tc-i386.c (md_apply_fix3): Call S_SET_THREAD_LOCAL
> for TLS relocations.
> * config/tc-ia64.c (md_apply_fix3): Likewise.
> * config/tc-alpha.c (md_apply_fix3): Likewise.
>
> * ld-i386/tlsnopic.rd: Change NOTYPE to TLS for UND sg* symbols.
This fixes the problem. Thanks a lot.
I'll commit the attached for SH once your patch is applied.
It is tested on sh-unknown-linux-gnu and passes tls tests of
libc.
Regards,
kaz
--
2002-11-20 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* config/tc-i386.c (md_apply_fix3): Call S_SET_THREAD_LOCAL
for TLS relocations.
--- ORIG/src/gas/config/tc-sh.c Fri Oct 11 22:01:49 2002
+++ LOCAL/src/gas/config/tc-sh.c Mon Nov 18 17:52:41 2002
@@ -3550,18 +3550,22 @@ md_apply_fix3 (fixP, valP, seg)
md_number_to_chars (buf, val, 4);
break;
- case BFD_RELOC_32_GOT_PCREL:
- case BFD_RELOC_SH_GOTPLT32:
case BFD_RELOC_SH_TLS_GD_32:
case BFD_RELOC_SH_TLS_LD_32:
case BFD_RELOC_SH_TLS_IE_32:
+ S_SET_THREAD_LOCAL (fixP->fx_addsy);
+ /* Fallthrough */
+ case BFD_RELOC_32_GOT_PCREL:
+ case BFD_RELOC_SH_GOTPLT32:
* valP = 0; /* Fully resolved at runtime. No addend. */
md_number_to_chars (buf, 0, 4);
break;
- case BFD_RELOC_32_GOTOFF:
case BFD_RELOC_SH_TLS_LDO_32:
case BFD_RELOC_SH_TLS_LE_32:
+ S_SET_THREAD_LOCAL (fixP->fx_addsy);
+ /* Fallthrough */
+ case BFD_RELOC_32_GOTOFF:
md_number_to_chars (buf, val, 4);
break;
#endif