bfd/
[deliverable/binutils-gdb.git] / bfd / elf32-v850.c
index 45bb4f6eb7cea64271d508e0dc91f340cd29a6d0..0218ddcb57d5ccc59789860d2fd4e90a3814ccc0 100644 (file)
@@ -1696,43 +1696,11 @@ v850_elf_relocate_section (output_bfd, info, input_bfd, input_section,
        }
       else
        {
-         h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+         bfd_boolean unresolved_reloc, warned;
 
-         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);
-#if 0
-             fprintf (stderr, "defined: sec: %s, name: %s, value: %x + %x + %x gives: %x\n",
-                      sec->name, h->root.root.string, h->root.u.def.value, sec->output_section->vma, sec->output_offset, relocation);
-#endif
-           }
-         else if (h->root.type == bfd_link_hash_undefweak)
-           {
-#if 0
-             fprintf (stderr, "undefined: sec: %s, name: %s\n",
-                      sec->name, h->root.root.string);
-#endif
-             relocation = 0;
-           }
-         else
-           {
-             if (! ((*info->callbacks->undefined_symbol)
-                    (info, h->root.root.string, input_bfd,
-                     input_section, rel->r_offset, TRUE)))
-               return FALSE;
-#if 0
-             fprintf (stderr, "unknown: name: %s\n", h->root.root.string);
-#endif
-             relocation = 0;
-           }
+         RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx, symtab_hdr,
+                                  relocation, sec, unresolved_reloc,
+                                  info, warned);
        }
 
       /* FIXME: We should use the addend, but the COFF relocations don't.  */
This page took 0.028969 seconds and 4 git commands to generate.