aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1997-05-15 21:38:26 +0000
committerIan Lance Taylor <ian@airs.com>1997-05-15 21:38:26 +0000
commit77bd8dfa1f3678ea3c3d05f40de29a36802d21f5 (patch)
tree4f00e5b0fb4602ab252694f5d012e690b627aff7
parent4c4badea812b0ebf1cb9b3068eeb4d3185690dfb (diff)
downloadgdb-77bd8dfa1f3678ea3c3d05f40de29a36802d21f5.zip
gdb-77bd8dfa1f3678ea3c3d05f40de29a36802d21f5.tar.gz
gdb-77bd8dfa1f3678ea3c3d05f40de29a36802d21f5.tar.bz2
* elflink.h (elf_link_add_object_symbols): Consistently treat
uninitialized symbols in shared objects as common symbols.
-rw-r--r--bfd/ChangeLog3
-rw-r--r--bfd/elflink.h28
2 files changed, 11 insertions, 20 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6bcd44a..84f3d40 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -11,7 +11,8 @@ Thu May 15 14:31:28 1997 Nick Clifton <nickc@cygnus.com>
Thu May 15 16:40:20 1997 Ian Lance Taylor <ian@cygnus.com>
* elflink.h (elf_link_add_object_symbols): Force ELF symbol size
- to common symbol size.
+ to common symbol size. Consistently treat uninitialized symbols
+ in shared objects as common symbols.
Fri May 9 10:15:27 1997 Nick Clifton <nickc@cygnus.com>
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 43425c0..78f57ff 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -913,26 +913,16 @@ elf_link_add_object_symbols (abfd, info)
&& definition
&& h->root.type == bfd_link_hash_common
&& (sec->flags & SEC_ALLOC) != 0
- && (sec->flags & SEC_LOAD) == 0)
+ && (sec->flags & SEC_LOAD) == 0
+ && sym.st_size > 0
+ && bind != STB_WEAK
+ && ELF_ST_TYPE (sym.st_info) != STT_FUNC)
{
- if (! ((*info->callbacks->multiple_common)
- (info, h->root.root.string,
- h->root.u.c.p->section->owner, bfd_link_hash_common,
- h->root.u.c.size, abfd, bfd_link_hash_common,
- sym.st_size)))
- goto error_return;
-
- /* If the symbol in the shared library is smaller than
- the one we already have, then override it to stick
- with the larger symbol. Set SIZE_CHANGE_OK because
- we only want to warn if requested with --warn-common. */
- if (sym.st_size < h->size)
- {
- override = true;
- sec = bfd_und_section_ptr;
- definition = false;
- size_change_ok = true;
- }
+ override = true;
+ sec = bfd_com_section_ptr;
+ definition = false;
+ value = sym.st_size;
+ size_change_ok = true;
}
/* Similarly, if we are not looking at a dynamic object, and