diff options
author | Nick Clifton <nickc@redhat.com> | 2005-12-23 12:29:36 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2005-12-23 12:29:36 +0000 |
commit | 12ac1cf5374e06e54207ad961bcd4b721d5843b5 (patch) | |
tree | b5ed8c6fdd5845c4aec07eaa58e39620ef87a8fe /bfd/elflink.c | |
parent | 69d246d9338a35e64b2244835ac6e77164be668a (diff) | |
download | gdb-12ac1cf5374e06e54207ad961bcd4b721d5843b5.zip gdb-12ac1cf5374e06e54207ad961bcd4b721d5843b5.tar.gz gdb-12ac1cf5374e06e54207ad961bcd4b721d5843b5.tar.bz2 |
PR 1150
* elf-bfd.h (struct elf_backend_data): New field 'elf_backend_ignore_undef_symbol'.
* elfxx-target.h (elf_backend_ignore_undef_symbol): Define to NULL if not
already defined.
(elfNN_bed): Initialise the elf_backend_ignore_undef_symbol field.
* elfxx-mips.c (_bfd_mips_elf_ignore_undef_symbol): New function.
* elfxx-mips.h (elf_backend_ignore_undef_symbol): Define and prototype.
* elflink.c (elf_link_output_extsym): Check elf_backend_ignore_undef_symbol
before reporting an undefined symbol in a shared library.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r-- | bfd/elflink.c | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c index 127f002..a065dca 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -6346,22 +6346,32 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data) bed = get_elf_backend_data (finfo->output_bfd); - /* If we have an undefined symbol reference here then it must have - come from a shared library that is being linked in. (Undefined - references in regular files have already been handled). If we - are reporting errors for this situation then do so now. */ - if (h->root.type == bfd_link_hash_undefined - && h->ref_dynamic - && !h->ref_regular - && ! elf_link_check_versioned_symbol (finfo->info, bed, h) - && finfo->info->unresolved_syms_in_shared_libs != RM_IGNORE) - { - if (! ((*finfo->info->callbacks->undefined_symbol) - (finfo->info, h->root.root.string, h->root.u.undef.abfd, - NULL, 0, finfo->info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR))) - { - eoinfo->failed = TRUE; - return FALSE; + if (h->root.type == bfd_link_hash_undefined) + { + /* If we have an undefined symbol reference here then it must have + come from a shared library that is being linked in. (Undefined + references in regular files have already been handled). */ + bfd_boolean ignore_undef = FALSE; + + /* Some symbols may be special in that the fact that they're + undefined can be safely ignored - let backend determine that. */ + if (bed->elf_backend_ignore_undef_symbol) + ignore_undef = bed->elf_backend_ignore_undef_symbol (h); + + /* If we are reporting errors for this situation then do so now. */ + if (ignore_undef == FALSE + && h->ref_dynamic + && ! h->ref_regular + && ! elf_link_check_versioned_symbol (finfo->info, bed, h) + && finfo->info->unresolved_syms_in_shared_libs != RM_IGNORE) + { + if (! (finfo->info->callbacks->undefined_symbol + (finfo->info, h->root.root.string, h->root.u.undef.abfd, + NULL, 0, finfo->info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR))) + { + eoinfo->failed = TRUE; + return FALSE; + } } } |