This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[SH] Allow R_SH_TLS_LE_32 for PIE
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: binutils at sourceware dot org
- Date: Thu, 23 Jun 2011 07:04:12 +0900 (JST)
- Subject: [SH] Allow R_SH_TLS_LE_32 for PIE
Hi,
The attached patch for SH backend is very similar to the recent
patches for ARM and alpha. Tested on sh4-unknown-linux-gnu and
applied on head.
Regards,
kaz
--
2011-06-22 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* elf32-sh.c (sh_elf_relocate_section): Allow R_SH_TLS_LE_32 for PIE.
(sh_elf_check_relocs): Likewise.
--- ORIG/bfd/elf32-sh.c 2011-02-04 19:11:21.000000000 +0900
+++ bfd/elf32-sh.c 2011-06-18 09:43:53.000000000 +0900
@@ -5525,7 +5525,7 @@ sh_elf_relocate_section (bfd *output_bfd
check_segment[0] = check_segment[1] = -1;
- if (! info->shared)
+ if (! info->shared || info->pie)
{
relocation = tpoff (info, relocation);
addend = rel->r_addend;
@@ -6623,7 +6623,7 @@ sh_elf_check_relocs (bfd *abfd, struct b
break;
case R_SH_TLS_LE_32:
- if (info->shared)
+ if (info->shared && !info->pie)
{
(*_bfd_error_handler)
(_("%B: TLS local exec code cannot be linked into shared objects"),