* elf-m10300.c (mn10300_elf_relax_section): Use _bfd_merged_section_offset
authorNick Clifton <nickc@redhat.com>
Mon, 31 Dec 2007 11:29:31 +0000 (11:29 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 31 Dec 2007 11:29:31 +0000 (11:29 +0000)
  to compute the offset of a symbol in a merged section.

bfd/ChangeLog
bfd/elf-m10300.c

index d12d61556665cf3c709bbcbeeebcae3f70ce0176..a5567b0ff210aee7c4fe2057b6463b5db9594ec6 100644 (file)
@@ -1,3 +1,9 @@
+2007-12-31  Nick Clifton  <nickc@redhat.com>
+
+       * elf-m10300.c (mn10300_elf_relax_section): Use
+       _bfd_merged_section_offset to compute the offset of a symbol in a
+       merged section.
+
 2007-12-31  Nick Clifton  <nickc@redhat.com>
 
        * elf.c (_bfd_elf_find_segment_containing_section): New function:
index af2fff3c140714b87470efdb973010458f4e48a2..61ce3e167fe7eaaa851b103721e83e2b7e9e78ea 100644 (file)
@@ -2813,12 +2813,11 @@ mn10300_elf_relax_section (bfd *abfd,
              && ELF_ST_TYPE (isym->st_info) == STT_SECTION
              && sym_sec->sec_info_type == ELF_INFO_TYPE_MERGE)
            {
-             bfd_vma saved_addend;
-
-             saved_addend = irel->r_addend;
-             symval = _bfd_elf_rela_local_sym (abfd, isym, & sym_sec, irel);
-             symval += irel->r_addend;
-             irel->r_addend = saved_addend;
+             symval = isym->st_value + irel->r_addend;
+             symval = _bfd_merged_section_offset (abfd, & sym_sec,
+                                                  elf_section_data (sym_sec)->sec_info,
+                                                  symval);
+             symval += sym_sec->output_section->vma + sym_sec->output_offset - irel->r_addend;
            }
          else
            symval = (isym->st_value