From f57718b4c3a59a16940b6b300a6b20237631686c Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 29 Jun 2008 12:56:41 +0000 Subject: * 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. --- bfd/ChangeLog | 5 +++++ bfd/elf32-m68k.c | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d87568b..3f6f5c7 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2008-06-29 Andreas Schwab + + * elf32-m68k.c (elf_m68k_relocate_section): Don't ignore existing + addend on _GLOBAL_OFFSET_TABLE_. + 2008-06-24 Daniel Jacobowitz * elf32-arm.c (STUB_ENTRY_NAME): Define. 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); -- cgit v1.1