aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-10-10 05:30:17 +0000
committerIan Lance Taylor <ian@airs.com>1995-10-10 05:30:17 +0000
commit8235c11240245cae7c5f714d5e1a8990607c1aef (patch)
tree11cc8c57ad86ed0629744e35ffd8bef674b8bcac
parent5caef232bd39883502df77a39c1c6d1114620f56 (diff)
downloadgdb-8235c11240245cae7c5f714d5e1a8990607c1aef.zip
gdb-8235c11240245cae7c5f714d5e1a8990607c1aef.tar.gz
gdb-8235c11240245cae7c5f714d5e1a8990607c1aef.tar.bz2
* elflink.h (elf_link_add_object_symbols): Don't warn about
changing the size or type if the old definition was weak.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.h11
2 files changed, 14 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 864a86c..2b60d1c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+Tue Oct 10 01:28:29 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Don't warn about
+ changing the size or type if the old definition was weak.
+
Mon Oct 9 11:24:08 1995 Ian Lance Taylor <ian@cygnus.com>
* coffcode.h (combined_entry_type): Add fix_line field.
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 1aaa17e..dc2da5e 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -555,6 +555,7 @@ elf_link_add_object_symbols (abfd, info)
const char *name;
struct elf_link_hash_entry *h;
boolean definition;
+ boolean wasweak;
boolean new_weakdef;
elf_swap_symbol_in (abfd, esym, &sym);
@@ -641,6 +642,7 @@ elf_link_add_object_symbols (abfd, info)
else
definition = true;
+ wasweak = false;
if (info->hash->creator->flavour == bfd_target_elf_flavour)
{
/* We need to look up the symbol now in order to get some of
@@ -657,6 +659,10 @@ elf_link_add_object_symbols (abfd, info)
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ /* Remember whether this used to be a weak definition. */
+ wasweak = (h->root.type == bfd_link_hash_defweak
+ || h->root.type == bfd_link_hash_undefweak);
+
/* If we are looking at a dynamic object, and this is a
definition, we need to see if it has already been defined
by some other object. If it has, we want to use the
@@ -750,7 +756,7 @@ elf_link_add_object_symbols (abfd, info)
if (sym.st_size != 0
&& (definition || h->size == 0))
{
- if (h->size != 0 && h->size != sym.st_size)
+ if (h->size != 0 && h->size != sym.st_size && ! wasweak)
(*_bfd_error_handler)
("Warning: size of symbol `%s' changed from %lu to %lu in %s",
name, (unsigned long) h->size, (unsigned long) sym.st_size,
@@ -762,7 +768,8 @@ elf_link_add_object_symbols (abfd, info)
&& (definition || h->type == STT_NOTYPE))
{
if (h->type != STT_NOTYPE
- && h->type != ELF_ST_TYPE (sym.st_info))
+ && h->type != ELF_ST_TYPE (sym.st_info)
+ && ! wasweak)
(*_bfd_error_handler)
("Warning: type of symbol `%s' changed from %d to %d in %s",
name, h->type, ELF_ST_TYPE (sym.st_info),