aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-m68k.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2008-06-29 12:56:41 +0000
committerAndreas Schwab <schwab@linux-m68k.org>2008-06-29 12:56:41 +0000
commitf57718b4c3a59a16940b6b300a6b20237631686c (patch)
tree39926487b05f7e26b21d469694f6a6c6472aa8d7 /bfd/elf32-m68k.c
parent240c00d201736b76208df956190091b477e18e10 (diff)
downloadgdb-f57718b4c3a59a16940b6b300a6b20237631686c.zip
gdb-f57718b4c3a59a16940b6b300a6b20237631686c.tar.gz
gdb-f57718b4c3a59a16940b6b300a6b20237631686c.tar.bz2
* elf32-m68k.c (elf_m68k_relocate_section): Don't ignore existing
addend on _GLOBAL_OFFSET_TABLE_. ld/testsuite/: * ld-m68k/got-1.s: New file. * ld-m68k/got-1.d: New dump test. * ld-m68k/m68k.exp: Run it.
Diffstat (limited to 'bfd/elf32-m68k.c')
-rw-r--r--bfd/elf32-m68k.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 7d46fff..0b6fff3 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -3135,8 +3135,6 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
if (h != NULL
&& strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
{
- BFD_ASSERT (rel->r_addend == 0);
-
if (elf_m68k_hash_table (info)->local_gp_p)
{
bfd_vma sgot_output_offset;
@@ -3185,7 +3183,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
/* Adjust GOT pointer to point to the GOT
assigned to input_bfd. */
- rel->r_addend = sgot_output_offset + got_offset;
+ rel->r_addend += sgot_output_offset + got_offset;
}
else
BFD_ASSERT (got == NULL || got->offset == 0);