From 8235c11240245cae7c5f714d5e1a8990607c1aef Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 10 Oct 1995 05:30:17 +0000 Subject: [PATCH] * elflink.h (elf_link_add_object_symbols): Don't warn about changing the size or type if the old definition was weak. --- bfd/ChangeLog | 5 +++++ bfd/elflink.h | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 864a86c4c23..2b60d1c9da6 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +Tue Oct 10 01:28:29 1995 Ian Lance Taylor + + * 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 * coffcode.h (combined_entry_type): Add fix_line field. diff --git a/bfd/elflink.h b/bfd/elflink.h index 1aaa17ed08e..dc2da5ef3dc 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), -- 2.30.2