diff options
author | Nick Clifton <nickc@redhat.com> | 2003-08-20 08:37:19 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2003-08-20 08:37:19 +0000 |
commit | 8d7cab1f462b2032b5977c11a0ef57ba61107dbc (patch) | |
tree | 29043610c2d2b8bf639c77148b60c7022c893bee /bfd/elf64-x86-64.c | |
parent | d04e7b07c8d389527908c19a24a778185fac2c18 (diff) | |
download | gdb-8d7cab1f462b2032b5977c11a0ef57ba61107dbc.tar.gz |
Better handking for unresolved symbols
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r-- | bfd/elf64-x86-64.c | 43 |
1 files changed, 5 insertions, 38 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 970d742d0d1..8aed4982337 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1827,45 +1827,12 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, } 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; + bfd_boolean warned; - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - sec = h->root.u.def.section; - if (sec->output_section == NULL) - { - /* Set a flag that will be cleared later if we find a - relocation value for this symbol. output_section - is typically NULL for symbols satisfied by a shared - library. */ - unresolved_reloc = TRUE; - relocation = 0; - } - else - 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->executable - && !info->no_undefined - && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - relocation = 0; - else - { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.string, input_bfd, - input_section, rel->r_offset, - (info->executable || info->no_undefined - || ELF_ST_VISIBILITY (h->other))))) - return FALSE; - relocation = 0; - } + RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx, + symtab_hdr, relocation, sec, + unresolved_reloc, info, + warned); } /* When generating a shared object, the relocations handled here are copied into the output file to be resolved at run time. */ |