aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2005-05-02 03:12:21 +0000
committerPaul Brook <paul@codesourcery.com>2005-05-02 03:12:21 +0000
commita67b080b92d0a11fbd16fe00a896e8376f0ba9a1 (patch)
tree3f1e418aac22ea046ca995d1b766eca9be739973 /bfd/elflink.c
parentf341cbc179219de6eae68361b5c92d964302b685 (diff)
downloadgdb-a67b080b92d0a11fbd16fe00a896e8376f0ba9a1.zip
gdb-a67b080b92d0a11fbd16fe00a896e8376f0ba9a1.tar.gz
gdb-a67b080b92d0a11fbd16fe00a896e8376f0ba9a1.tar.bz2
2005-05-01 Paul Brook <paul@codesourcery.com>
* elflink.c (_bfd_elf_merge_symbol): Skip weak definitions if a strong definition has already been seen.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 23eafc0..7b33ae6 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -1078,6 +1078,13 @@ _bfd_elf_merge_symbol (bfd *abfd,
|| h->root.type == bfd_link_hash_undefined)
*size_change_ok = TRUE;
+ /* Skip weak definitions of symbols that are already defined. */
+ if (newdef && olddef && newweak && !oldweak)
+ {
+ *skip = TRUE;
+ return TRUE;
+ }
+
/* NEWDYNCOMMON and OLDDYNCOMMON indicate whether the new or old
symbol, respectively, appears to be a common symbol in a dynamic
object. If a symbol appears in an uninitialized section, and is