aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorDave Anglin <dave.anglin@nrc.ca>2010-01-30 16:09:43 +0000
committerDave Anglin <dave.anglin@nrc.ca>2010-01-30 16:09:43 +0000
commitf6fd0237f57af0aecbff1d36c4f7e73c8caf0614 (patch)
tree6d02f03642696a296b66ce822c50657dc8050001 /bfd
parent11b861d510c23a2bf98e8bb909e922c98c9492e0 (diff)
downloadgdb-f6fd0237f57af0aecbff1d36c4f7e73c8caf0614.zip
gdb-f6fd0237f57af0aecbff1d36c4f7e73c8caf0614.tar.gz
gdb-f6fd0237f57af0aecbff1d36c4f7e73c8caf0614.tar.bz2
* elf32-hppa.c (final_link_relocate): Convert R_PARISC_TLS_GD21L,
R_PARISC_TLS_LDM21L and R_PARISC_TLS_IE21L relocations that use the linkage table pointer to use the global table pointer if not doing a shared link.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf32-hppa.c12
2 files changed, 15 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index efd8613..1f66207 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2010-01-30 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * elf32-hppa.c (final_link_relocate): Convert R_PARISC_TLS_GD21L,
+ R_PARISC_TLS_LDM21L and R_PARISC_TLS_IE21L relocations that use the
+ linkage table pointer to use the global table pointer if not doing
+ a shared link.
+
2010-01-29 Joel Brobecker <brobecker@adacore.com>
* elf.c (elfcore_grok_lwpstatus): Do not overwrite the core signal
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 2a5547b..babe9f2 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -3388,12 +3388,19 @@ final_link_relocate (asection *input_section,
case R_PARISC_DPREL21L:
case R_PARISC_DPREL14R:
case R_PARISC_DPREL14F:
+ case R_PARISC_TLS_GD21L:
+ case R_PARISC_TLS_LDM21L:
+ case R_PARISC_TLS_IE21L:
/* Convert instructions that use the linkage table pointer (r19) to
instructions that use the global data pointer (dp). This is the
most efficient way of using PIC code in an incomplete executable,
but the user must follow the standard runtime conventions for
accessing data for this to work. */
- if (orig_r_type == R_PARISC_DLTIND21L)
+ if (orig_r_type == R_PARISC_DLTIND21L
+ || (!info->shared
+ && (r_type == R_PARISC_TLS_GD21L
+ || r_type == R_PARISC_TLS_LDM21L
+ || r_type == R_PARISC_TLS_IE21L)))
{
/* Convert addil instructions if the original reloc was a
DLTIND21L. GCC sometimes uses a register other than r19 for
@@ -3444,11 +3451,8 @@ final_link_relocate (asection *input_section,
case R_PARISC_DLTIND21L:
case R_PARISC_DLTIND14R:
case R_PARISC_DLTIND14F:
- case R_PARISC_TLS_GD21L:
case R_PARISC_TLS_GD14R:
- case R_PARISC_TLS_LDM21L:
case R_PARISC_TLS_LDM14R:
- case R_PARISC_TLS_IE21L:
case R_PARISC_TLS_IE14R:
value -= elf_gp (input_section->output_section->owner);
break;