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/elfxx-ia64.c | |
parent | d04e7b07c8d389527908c19a24a778185fac2c18 (diff) | |
download | gdb-8d7cab1f462b2032b5977c11a0ef57ba61107dbc.tar.gz |
Better handking for unresolved symbols
Diffstat (limited to 'bfd/elfxx-ia64.c')
-rw-r--r-- | bfd/elfxx-ia64.c | 55 |
1 files changed, 11 insertions, 44 deletions
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index 3175b815f31..5cc311086ba 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -2162,7 +2162,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) this may help reduce memory usage and processing time later. */ maybe_dynamic = FALSE; if (h && ((!info->executable - && (!info->symbolic || info->allow_shlib_undefined)) + && (!info->symbolic || info->unresolved_syms_in_shared_libs == RM_IGNORE)) || ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) || h->root.type == bfd_link_hash_defweak)) maybe_dynamic = TRUE; @@ -3852,52 +3852,19 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, } else { - long indx; + bfd_boolean unresolved_reloc; + bfd_boolean warned; - /* Reloc against global symbol. */ - indx = r_symndx - symtab_hdr->sh_info; - h = elf_sym_hashes (input_bfd)[indx]; - 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; - - value = 0; - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - sym_sec = h->root.u.def.section; - - /* Detect the cases that sym_sec->output_section is - expected to be NULL -- all cases in which the symbol - is defined in another shared module. This includes - PLT relocs for which we've created a PLT entry and - other relocs for which we're prepared to create - dynamic relocations. */ - /* ??? Just accept it NULL and continue. */ + RELOC_FOR_GLOBAL_SYMBOL (h, elf_sym_hashes (input_bfd), + r_symndx, + symtab_hdr, value, sym_sec, + unresolved_reloc, info, + warned); - if (sym_sec->output_section != NULL) - { - value = (h->root.u.def.value - + sym_sec->output_section->vma - + sym_sec->output_offset); - } - } - else if (h->root.type == bfd_link_hash_undefweak) + if (h->root.type == bfd_link_hash_undefweak) undef_weak_ref = TRUE; - else if (! info->executable - && !info->no_undefined - && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - ; - 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; - continue; - } + else if (warned) + continue; } hit_addr = contents + rel->r_offset; |