X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felf32-openrisc.c;h=7a4d5ece9d204cec15d89de29e4a41457e3ecc61;hb=59c2e50f2900f1256ee5b00551afd084a68a900b;hp=62f86d419a14b13f057cdc2ce2b50b357a7b754f;hpb=023aaf9519725736042c2b233622ddfac1745596;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-openrisc.c b/bfd/elf32-openrisc.c index 62f86d419a..7a4d5ece9d 100644 --- a/bfd/elf32-openrisc.c +++ b/bfd/elf32-openrisc.c @@ -383,33 +383,12 @@ openrisc_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; + RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx, symtab_hdr, + relocation, sec, unresolved_reloc, + info, warned); - name = h->root.root.string; - - 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; - } } r = openrisc_final_link_relocate (howto, input_bfd, input_section,