summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2005-02-10 03:07:46 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2005-02-10 03:07:46 +0000
commitcc3416193ab7f5bf201d4270bc169c751acd0a14 (patch)
tree9648fc31e9e97fc2368e37cbcf182cfa38ed70ef
parent6d9cddd56b2179b05041275364a36cd7069c5d83 (diff)
downloadbinutils-redhat-cc3416193ab7f5bf201d4270bc169c751acd0a14.tar.gz
* elf64-mips.c (mips16_gprel_reloc): Update a comment.
* elfn32-mips.c (mips16_gprel_reloc): Keep R_MIPS16_GPREL relocations against external symbols unchanged.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf64-mips.c4
-rw-r--r--bfd/elfn32-mips.c10
3 files changed, 18 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index bc6b5852d9..889411f523 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2005-02-10 Maciej W. Rozycki <macro@mips.com>
+
+ * elf64-mips.c (mips16_gprel_reloc): Update a comment.
+ * elfn32-mips.c (mips16_gprel_reloc): Keep R_MIPS16_GPREL
+ relocations against external symbols unchanged.
+
2005-02-08 Paul Brook <paul@codesourcery.com>
* elflink.c (elf_link_input_bfd): Ignore symbols from null input
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index ce37ad2148..74ec7cbc47 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -1709,8 +1709,8 @@ mips16_gprel_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
bfd_signed_vma val;
bfd_vma relocation;
- /* If we're relocating, and this is an external symbol with no
- addend, we don't want to change anything. */
+ /* If we're relocating, and this is an external symbol, we don't want
+ to change anything. */
if (output_bfd != NULL
&& (symbol->flags & BSF_SECTION_SYM) == 0
&& (symbol->flags & BSF_LOCAL) != 0)
diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c
index 48c2579bef..d87c45c076 100644
--- a/bfd/elfn32-mips.c
+++ b/bfd/elfn32-mips.c
@@ -1507,6 +1507,16 @@ mips16_gprel_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
bfd_signed_vma val;
bfd_vma relocation;
+ /* If we're relocating, and this is an external symbol, we don't want
+ to change anything. */
+ if (output_bfd != NULL
+ && (symbol->flags & BSF_SECTION_SYM) == 0
+ && (symbol->flags & BSF_LOCAL) != 0)
+ {
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
if (output_bfd != NULL)
relocatable = TRUE;
else