aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-s390.c
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>2014-09-19 12:44:54 +0200
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2014-09-19 12:46:50 +0200
commite00d879a2e9169759518dd419d19f1b3dcb6f709 (patch)
treebfff3c6e17e806ab560cd95ddb67ce4b8fe49ccc /bfd/elf64-s390.c
parent00ba3162ed1633f9b27f3fdd450e076d3a3f2e90 (diff)
downloadgdb-e00d879a2e9169759518dd419d19f1b3dcb6f709.zip
gdb-e00d879a2e9169759518dd419d19f1b3dcb6f709.tar.gz
gdb-e00d879a2e9169759518dd419d19f1b3dcb6f709.tar.bz2
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.
Diffstat (limited to 'bfd/elf64-s390.c')
-rw-r--r--bfd/elf64-s390.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index d7b2f08..b2f1aa5 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -1183,6 +1183,12 @@ elf_s390_check_relocs (bfd *abfd,
/* Fall through */
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)
break;
info->flags |= DF_STATIC_TLS;
@@ -3074,7 +3080,7 @@ elf_s390_relocate_section (bfd *output_bfd,
break;
case R_390_TLS_LE64:
- if (info->shared)
+ if (info->shared && !info->pie)
{
/* Linking a shared library with non-fpic code requires
a R_390_TLS_TPOFF relocation. */