aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2005-05-04 13:13:22 +0000
committerH.J. Lu <hjl.tools@gmail.com>2005-05-04 13:13:22 +0000
commitc5e2ceadb7216936dcc3d9dec73de31075460765 (patch)
tree08838c233dd0a96193a8f030768c215e2393afc6
parent8423293d34986cfa218f79b2b2f1ff9bf77d468f (diff)
downloadgdb-c5e2ceadb7216936dcc3d9dec73de31075460765.zip
gdb-c5e2ceadb7216936dcc3d9dec73de31075460765.tar.gz
gdb-c5e2ceadb7216936dcc3d9dec73de31075460765.tar.bz2
2005-05-04 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (_bfd_elf_merge_symbol): Only skip weak definitions at the end, if a strong definition has already been seen.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.c11
2 files changed, 9 insertions, 7 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index de82e20..2b010e8 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2005-05-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elflink.c (_bfd_elf_merge_symbol): Only skip weak definitions
+ at the end, if a strong definition has already been seen.
+
2005-05-04 Alan Modra <amodra@bigpond.net.au>
* section.c (struct bfd_section): Replace link_order_head and
diff --git a/bfd/elflink.c b/bfd/elflink.c
index bc71e98..370a9b7 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -1078,13 +1078,6 @@ _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
@@ -1211,6 +1204,10 @@ _bfd_elf_merge_symbol (bfd *abfd,
*size_change_ok = TRUE;
}
+ /* Skip weak definitions of symbols that are already defined. */
+ if (newdef && olddef && newweak && !oldweak)
+ *skip = TRUE;
+
/* If the old symbol is from a dynamic object, and the new symbol is
a definition which is not from a dynamic object, then the new
symbol overrides the old symbol. Symbols from regular files