From cdc05dac56df2daabc8414b5488be7bc6a541c94 Mon Sep 17 00:00:00 2001 From: kkojima Date: Wed, 22 Jun 2011 22:02:15 +0000 Subject: [PATCH] * elf32-sh.c (sh_elf_relocate_section): Allow R_SH_TLS_LE_32 for PIE. (sh_elf_check_relocs): Likewise. --- bfd/ChangeLog | 5 +++++ bfd/elf32-sh.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 59cfd13b1f..877f0c8a69 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2011-06-22 Kaz Kojima + + * elf32-sh.c (sh_elf_relocate_section): Allow R_SH_TLS_LE_32 for PIE. + (sh_elf_check_relocs): Likewise. + 2011-06-22 Richard Henderson * elf64-alpha.c (elf64_alpha_check_relocs): No dynamic reloc for diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index b85b7c2111..ca2c4af905 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -5516,7 +5516,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, check_segment[0] = check_segment[1] = -1; - if (! info->shared) + if (! info->shared || info->pie) { relocation = tpoff (info, relocation); addend = rel->r_addend; @@ -6614,7 +6614,7 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, 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"), -- 2.11.0