summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2005-05-02 03:12:46 +0000
committerPaul Brook <paul@codesourcery.com>2005-05-02 03:12:46 +0000
commit520c5f6ca4bc5172512e8af4425793c852f9068a (patch)
treef8d177956d2c3ea3fd6be0bfa32ffd5d73939354
parent31e4a2eaab8352ca1a33bc25f8cc1b01ce39c6e2 (diff)
downloadbinutils-gdb-520c5f6ca4bc5172512e8af4425793c852f9068a.tar.gz
2005-05-01 Paul Brook <paul@codesourcery.com>binutils-csl-arm-2005q1b
* bfd/elflink.c (_bfd_elf_merge_symbol): Skip weak definitions if a strong definition has already been seen.
-rw-r--r--ChangeLog.csl5
-rw-r--r--bfd/elflink.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl
index c381846f044..6978c1cefac 100644
--- a/ChangeLog.csl
+++ b/ChangeLog.csl
@@ -1,5 +1,10 @@
2005-05-01 Paul Brook <paul@codesourcery.com>
+ * bfd/elflink.c (_bfd_elf_merge_symbol): Skip weak definitions if a
+ strong definition has already been seen.
+
+2005-05-01 Paul Brook <paul@codesourcery.com>
+
* bfd/elf32-arm.c (bfd_elf32_arm_process_before_allocation): Treat
R_ARM_PLT32 the same as R_ARM_PC24.
(arm_add_to_rel): Ditto.
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 0554a0fdc32..37272c64edb 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -1075,6 +1075,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