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 | 560e09e9cc912370081be5cccb8d3179a78928b2 (patch) | |
tree | 9191f0c21af30761875fd1741d540eacdea7b88f /bfd/elf32-hppa.c | |
parent | 04d1ab347d16d701221fa1b49185d096e3158138 (diff) | |
download | gdb-560e09e9cc912370081be5cccb8d3179a78928b2.zip gdb-560e09e9cc912370081be5cccb8d3179a78928b2.tar.gz gdb-560e09e9cc912370081be5cccb8d3179a78928b2.tar.bz2 |
Better handking for unresolved symbols
Diffstat (limited to 'bfd/elf32-hppa.c')
-rw-r--r-- | bfd/elf32-hppa.c | 64 |
1 files changed, 27 insertions, 37 deletions
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index ae09096..3c03a06 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -2853,7 +2853,7 @@ elf32_hppa_size_stubs else if (hash->elf.root.type == bfd_link_hash_undefined) { if (! (info->shared - && !info->no_undefined + && info->unresolved_syms_in_objects == RM_IGNORE && (ELF_ST_VISIBILITY (hash->elf.other) == STV_DEFAULT) && hash->elf.type != STT_PARISC_MILLI)) @@ -3444,43 +3444,33 @@ elf32_hppa_relocate_section (bfd *output_bfd, } else { - int indx; - - /* It's a global; Find its entry in the link hash. */ - indx = r_symndx - symtab_hdr->sh_info; - h = ((struct elf32_hppa_link_hash_entry *) - elf_sym_hashes (input_bfd)[indx]); - while (h->elf.root.type == bfd_link_hash_indirect - || h->elf.root.type == bfd_link_hash_warning) - h = (struct elf32_hppa_link_hash_entry *) h->elf.root.u.i.link; - - relocation = 0; - if (h->elf.root.type == bfd_link_hash_defined - || h->elf.root.type == bfd_link_hash_defweak) - { - sym_sec = h->elf.root.u.def.section; - /* If sym_sec->output_section is NULL, then it's a - symbol defined in a shared library. */ - if (sym_sec->output_section != NULL) - relocation = (h->elf.root.u.def.value - + sym_sec->output_offset - + sym_sec->output_section->vma); - } - else if (h->elf.root.type == bfd_link_hash_undefweak) - ; - else if (info->shared - && !info->no_undefined - && ELF_ST_VISIBILITY (h->elf.other) == STV_DEFAULT - && h->elf.type != STT_PARISC_MILLI) - ; - else - { - if (!((*info->callbacks->undefined_symbol) - (info, h->elf.root.root.string, input_bfd, - input_section, rel->r_offset, TRUE))) - return FALSE; - warned_undef = TRUE; + struct elf_link_hash_entry *hh; + bfd_boolean unresolved_reloc; + + RELOC_FOR_GLOBAL_SYMBOL (hh, elf_sym_hashes (input_bfd), r_symndx, symtab_hdr, + relocation, sym_sec, unresolved_reloc, info, + warned_undef); + + if (relocation == 0 + && hh->root.type != bfd_link_hash_defined + && hh->root.type != bfd_link_hash_defweak + && hh->root.type != bfd_link_hash_undefweak) + { + if (!info->executable + && info->unresolved_syms_in_objects == RM_IGNORE + && ELF_ST_VISIBILITY (hh->other) == STV_DEFAULT + && hh->type == STT_PARISC_MILLI) + { + if (! info->callbacks->undefined_symbol + (info, hh->root.root.string, input_bfd, + input_section, rel->r_offset, + ((info->shared && info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR) + || (!info->shared && info->unresolved_syms_in_objects == RM_GENERATE_ERROR)))) + return FALSE; + warned_undef = TRUE; + } } + h = (struct elf32_hppa_link_hash_entry *) hh; } /* Do any required modifications to the relocation value, and |