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/elfxx-mips.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/elfxx-mips.c')
-rw-r--r-- | bfd/elfxx-mips.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 2ff4941..919593d 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -3008,6 +3008,8 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, } else { + /* ??? Could we use RELOC_FOR_GLOBAL_SYMBOL here ? */ + /* For global symbols we look up the symbol in the hash-table. */ h = ((struct mips_elf_link_hash_entry *) elf_sym_hashes (input_bfd) [r_symndx - extsymoff]); @@ -3021,7 +3023,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, /* See if this is the special _gp_disp symbol. Note that such a symbol must always be a global symbol. */ - if (strcmp (h->root.root.root.string, "_gp_disp") == 0 + if (strcmp (*namep, "_gp_disp") == 0 && ! NEWABI_P (input_bfd)) { /* Relocations against _gp_disp are permitted only with @@ -3054,11 +3056,11 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, addresses. */ symbol = 0; else if (info->shared - && !info->no_undefined + && info->unresolved_syms_in_objects == RM_IGNORE && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) symbol = 0; - else if (strcmp (h->root.root.root.string, "_DYNAMIC_LINK") == 0 || - strcmp (h->root.root.root.string, "_DYNAMIC_LINKING") == 0) + else if (strcmp (*namep, "_DYNAMIC_LINK") == 0 || + strcmp (*namep, "_DYNAMIC_LINKING") == 0) { /* If this is a dynamic link, we should have created a _DYNAMIC_LINK symbol or _DYNAMIC_LINKING(for normal mips) symbol @@ -3075,7 +3077,8 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.root.string, input_bfd, input_section, relocation->r_offset, - (!info->shared || info->no_undefined + ((info->shared && info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR) + || (!info->shared && info->unresolved_syms_in_objects == RM_GENERATE_ERROR) || ELF_ST_VISIBILITY (h->root.other))))) return bfd_reloc_undefined; symbol = 0; |