S/390: Don't replace R_390_TLS_LE32/64 with R_390_TLS_TPOFF for PIE.

bfd:

2014-09-19  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* elf32-s390.c: Don't replace R_390_TLS_LE32 with R_390_TLS_TPOFF
	for PIE.
	* elf64-s390.c: Don't replace R_390_TLS_LE64 with R_390_TLS_TPOFF
	for PIE.
This commit is contained in:
Andreas Krebbel 2014-09-19 12:44:54 +02:00
parent 00ba3162ed
commit e00d879a2e
3 changed files with 21 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2014-09-19 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* elf32-s390.c: Don't replace R_390_TLS_LE32 with R_390_TLS_TPOFF
for PIE.
* elf64-s390.c: Don't replace R_390_TLS_LE64 with R_390_TLS_TPOFF
for PIE.
2014-09-18 Jan Kratochvil <jan.kratochvil@redhat.com> 2014-09-18 Jan Kratochvil <jan.kratochvil@redhat.com>
PR gdb/17407 PR gdb/17407

View File

@ -1250,6 +1250,12 @@ elf_s390_check_relocs (bfd *abfd,
/* Fall through. */ /* Fall through. */
case R_390_TLS_LE32: case R_390_TLS_LE32:
/* For static linking and executables this reloc will be
calculated at linktime otherwise a TLS_TPOFF runtime
reloc will be generated. */
if (r_type == R_390_TLS_LE32 && info->pie)
break;
if (!info->shared) if (!info->shared)
break; break;
info->flags |= DF_STATIC_TLS; info->flags |= DF_STATIC_TLS;
@ -3104,7 +3110,7 @@ elf_s390_relocate_section (bfd *output_bfd,
break; break;
case R_390_TLS_LE32: case R_390_TLS_LE32:
if (info->shared) if (info->shared && !info->pie)
{ {
/* Linking a shared library with non-fpic code requires /* Linking a shared library with non-fpic code requires
a R_390_TLS_TPOFF relocation. */ a R_390_TLS_TPOFF relocation. */

View File

@ -1183,6 +1183,12 @@ elf_s390_check_relocs (bfd *abfd,
/* Fall through */ /* Fall through */
case R_390_TLS_LE64: case R_390_TLS_LE64:
/* For static linking and executables this reloc will be
calculated at linktime otherwise a TLS_TPOFF runtime
reloc will be generated. */
if (r_type == R_390_TLS_LE64 && info->pie)
break;
if (!info->shared) if (!info->shared)
break; break;
info->flags |= DF_STATIC_TLS; info->flags |= DF_STATIC_TLS;
@ -3074,7 +3080,7 @@ elf_s390_relocate_section (bfd *output_bfd,
break; break;
case R_390_TLS_LE64: case R_390_TLS_LE64:
if (info->shared) if (info->shared && !info->pie)
{ {
/* Linking a shared library with non-fpic code requires /* Linking a shared library with non-fpic code requires
a R_390_TLS_TPOFF relocation. */ a R_390_TLS_TPOFF relocation. */