From: Ian Lance Taylor Date: Sat, 15 Feb 1997 00:12:47 +0000 (+0000) Subject: * elflink.h (elf_link_add_object_symbols): Don't issue a warning X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=54626f1aa47e7251e1f966f5e9711ff74379bf6c;p=binutils-gdb.git * elflink.h (elf_link_add_object_symbols): Don't issue a warning about a symbol defined in a dynamic object if it has already been defined in a regular object. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 174a41e6f35..e29ba2e94d3 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,9 +1,41 @@ +Fri Feb 14 19:08:03 1997 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Don't issue a warning + about a symbol defined in a dynamic object if it has already been + defined in a regular object. + Thu Feb 13 20:53:22 1997 Klaus Kaempf (kkaempf@progis.de) * makefile.vms: Add gcc flags to allow compiling with current gcc snapshot (targmatch.h): New dependency. + * reloc.c (BFD_RELOC_ALPHA_CODEADDR): New relocation for + openVMS/Alpha. + * evax.h (ALPHA_R_CODEADDR): New relocation. + * evax-alpha.c (ALPHA_R_CODEADDR): 64 bit procedure relocation for + openVMS/Alpha. + * evax-etir.c (ALPHA_R_CODEADDR): Output object code for this + relocation. + * bfd-in2.h, libbfd.h: Rebuild. + + Restrict symbol length to 64 bytes, case preserving: + * evax-emh.c (_bfd_evax_write_emh): Remove case hacking. + * evax-misc.c (_bfd_evax_case_hack_symbol): Remove. + (_bfd_evax_length_hash_symbol): Added. + * evax-etir.c (_bfd_evax_write_etir): Call + _bfd_evax_length_hash_symbol before output of symbol. + * evax-egsd.c (_bfd_evax_write_egsd): Likewise. + * evax.h (flag_hash_long_names, flag_show_after_trunc): Remove. + + * evax-emh.c: Output filename to object file without path. + + * evax-egsd.c: New sections for local and global commons. + + * evax-alpha.c, evax-emh.c, evax-egsd.c, evax-etir.c, + evax-misc.c, evax.h: Remove 8 bit characters from copyright + notices. Replace AXP with Alpha. + Wed Feb 12 18:10:30 1997 Ian Lance Taylor * sunos.c (sunos_create_dynamic_sections): We need the dynamic diff --git a/bfd/elflink.h b/bfd/elflink.h index 53362ab27d6..bbd8fb2b952 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -272,6 +272,38 @@ elf_link_add_object_symbols (abfd, info) char *msg; bfd_size_type sz; + name += sizeof ".gnu.warning." - 1; + + /* If this is a shared object, then look up the symbol + in the hash table. If it is there, and it is already + been defined, then we will not be using the entry + from this shared object, so we don't need to warn. + FIXME: If we see the definition in a regular object + later on, we will warn, but we shouldn't. The only + fix is to keep track of what warnings we are supposed + to emit, and then handle them all at the end of the + link. */ + if ((abfd->flags & DYNAMIC) != 0 + && abfd->xvec == info->hash->creator) + { + struct elf_link_hash_entry *h; + + h = elf_link_hash_lookup (elf_hash_table (info), name, + false, false, true); + + /* FIXME: What about bfd_link_hash_common? */ + if (h != NULL + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak)) + { + /* We don't want to issue this warning. Clobber + the section size so that the warning does not + get copied into the output file. */ + s->_raw_size = 0; + continue; + } + } + sz = bfd_section_size (abfd, s); msg = (char *) bfd_alloc (abfd, sz); if (msg == NULL) @@ -281,10 +313,8 @@ elf_link_add_object_symbols (abfd, info) goto error_return; if (! (_bfd_generic_link_add_one_symbol - (info, abfd, - name + sizeof ".gnu.warning." - 1, - BSF_WARNING, s, (bfd_vma) 0, msg, false, collect, - (struct bfd_link_hash_entry **) NULL))) + (info, abfd, name, BSF_WARNING, s, (bfd_vma) 0, msg, + false, collect, (struct bfd_link_hash_entry **) NULL))) goto error_return; if (! info->relocateable)