aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2003-09-18 19:01:46 +0000
committerH.J. Lu <hjl.tools@gmail.com>2003-09-18 19:01:46 +0000
commit9e4d8df3409e397a45dfb6af5a6a4c78c58618b0 (patch)
treeb25ca9e3d14bb5c4523ac3b5552541fad3a84b8f /bfd/elflink.c
parent228ce0641967a78da5120ebb878e467475cbbbda (diff)
downloadgdb-9e4d8df3409e397a45dfb6af5a6a4c78c58618b0.zip
gdb-9e4d8df3409e397a45dfb6af5a6a4c78c58618b0.tar.gz
gdb-9e4d8df3409e397a45dfb6af5a6a4c78c58618b0.tar.bz2
2003-09-18 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (_bfd_elf_merge_symbol): Allow type change if the old symbol is undefined and the new symbol is defined.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index d53571d..58acc14 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -962,12 +962,16 @@ _bfd_elf_merge_symbol (bfd *abfd,
/* It's OK to change the type if either the existing symbol or the
new symbol is weak unless it comes from a DT_NEEDED entry of
a shared object, in which case, the DT_NEEDED entry may not be
- required at the run time. */
+ required at the run time. The type change is also OK if the
+ old symbol is undefined and the new symbol is defined. */
if ((! dt_needed && oldweakdef)
|| oldweakundef
|| newweakdef
- || newweakundef)
+ || newweakundef
+ || (newdef
+ && (h->root.type == bfd_link_hash_undefined
+ || h->root.type == bfd_link_hash_undefweak)))
*type_change_ok = TRUE;
/* It's OK to change the size if either the existing symbol or the