aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Anglin <dave.anglin@nrc.ca>2003-01-08 02:19:23 +0000
committerDave Anglin <dave.anglin@nrc.ca>2003-01-08 02:19:23 +0000
commit95d0f04a0b7b84ec4deb74cbe28917b0477da4d0 (patch)
treef22c9592792a28f247b8efb7506754cbcce0bf9d
parent1e2330ba1fbf486c2851272e2aa09dd57ad367e6 (diff)
downloadgdb-95d0f04a0b7b84ec4deb74cbe28917b0477da4d0.zip
gdb-95d0f04a0b7b84ec4deb74cbe28917b0477da4d0.tar.gz
gdb-95d0f04a0b7b84ec4deb74cbe28917b0477da4d0.tar.bz2
* elf32-hppa.c (final_link_relocate): For all DP relative relocations,
adjust addil instructions if the symbol has no section.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-hppa.c13
2 files changed, 11 insertions, 7 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index fde02c8..81f78a0 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2003-01-07 John David Anglin <dave.anglin@nrc.gc.ca>
+
+ * elf32-hppa.c (final_link_relocate): For all DP relative relocations,
+ adjust addil instructions if the symbol has no section.
+
2003-01-07 DJ Delorie <dj@redhat.com>
* elf32-xstormy16.c (xstormy16_elf_howto_table): Make REL_12 not
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index f8c88b1..2646f3d 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -3416,15 +3416,14 @@ final_link_relocate (input_section, contents, rel, value, htab, sym_sec, h)
case R_PARISC_DPREL14R:
case R_PARISC_DPREL14F:
/* For all the DP relative relocations, we need to examine the symbol's
- section. If it's a code section, then "data pointer relative" makes
- no sense. In that case we don't adjust the "value", and for 21 bit
- addil instructions, we change the source addend register from %dp to
- %r0. This situation commonly arises when a variable's "constness"
+ section. If it has no section or if it's a code section, then
+ "data pointer relative" makes no sense. In that case we don't
+ adjust the "value", and for 21 bit addil instructions, we change the
+ source addend register from %dp to %r0. This situation commonly
+ arises for undefined weak symbols and when a variable's "constness"
is declared differently from the way the variable is defined. For
instance: "extern int foo" with foo defined as "const int foo". */
- if (sym_sec == NULL)
- break;
- if ((sym_sec->flags & SEC_CODE) != 0)
+ if (sym_sec == NULL || (sym_sec->flags & SEC_CODE) != 0)
{
if ((insn & ((0x3f << 26) | (0x1f << 21)))
== (((int) OP_ADDIL << 26) | (27 << 21)))