bfd/
[deliverable/binutils-gdb.git] / bfd / elf-m10200.c
index 09d7d993ba1982420b818aac5446f99185d68271..92cea80dbaefc1cf3abf4fc47322fffebdd74ca5 100644 (file)
@@ -373,32 +373,15 @@ mn10200_elf_relocate_section (output_bfd, info, input_bfd, input_section,
        {
          sym = local_syms + r_symndx;
          sec = local_sections[r_symndx];
-         relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
+         relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
        }
       else
        {
-         h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-         while (h->root.type == bfd_link_hash_indirect
-                || h->root.type == bfd_link_hash_warning)
-           h = (struct elf_link_hash_entry *) h->root.u.i.link;
-         if (h->root.type == bfd_link_hash_defined
-             || h->root.type == bfd_link_hash_defweak)
-           {
-             sec = h->root.u.def.section;
-             relocation = (h->root.u.def.value
-                           + sec->output_section->vma
-                           + sec->output_offset);
-           }
-         else if (h->root.type == bfd_link_hash_undefweak)
-           relocation = 0;
-         else
-           {
-             if (! ((*info->callbacks->undefined_symbol)
-                    (info, h->root.root.string, input_bfd,
-                     input_section, rel->r_offset, TRUE)))
-               return FALSE;
-             relocation = 0;
-           }
+         bfd_boolean unresolved_reloc, warned;
+
+         RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx, symtab_hdr,
+                                  relocation, sec, unresolved_reloc,
+                                  info, warned);
        }
 
       r = mn10200_elf_final_link_relocate (howto, input_bfd, output_bfd,
@@ -469,7 +452,7 @@ mn10200_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 
 /* This function handles relaxing for the mn10200.
 
-   There's quite a few relaxing opportunites available on the mn10200:
+   There are quite a few relaxing opportunities available on the mn10200:
 
        * jsr:24 -> jsr:16                                         2 bytes
 
@@ -918,7 +901,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
                  if (value & 0x8000)
                    continue;
 
-                 /* Note that we've changed the reldection contents, etc.  */
+                 /* Note that we've changed the relocation contents, etc.  */
                  elf_section_data (sec)->relocs = internal_relocs;
                  elf_section_data (sec)->this_hdr.contents = contents;
                  symtab_hdr->contents = (unsigned char *) isymbuf;
@@ -957,7 +940,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
                case 0x40:
                case 0x44:
                case 0xc8:
-                 /* Note that we've changed the reldection contents, etc.  */
+                 /* Note that we've changed the relocation contents, etc.  */
                  elf_section_data (sec)->relocs = internal_relocs;
                  elf_section_data (sec)->this_hdr.contents = contents;
                  symtab_hdr->contents = (unsigned char *) isymbuf;
@@ -1040,7 +1023,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
                      && (value & 0x8000) != 0)
                    continue;
 
-                 /* Note that we've changed the reldection contents, etc.  */
+                 /* Note that we've changed the relocation contents, etc.  */
                  elf_section_data (sec)->relocs = internal_relocs;
                  elf_section_data (sec)->this_hdr.contents = contents;
                  symtab_hdr->contents = (unsigned char *) isymbuf;
This page took 0.025444 seconds and 4 git commands to generate.