From 1062d224945bee6001d2500a4a83c9d7b659867e Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 18 Sep 2003 19:01:46 +0000 Subject: [PATCH] 2003-09-18 H.J. Lu * elflink.c (_bfd_elf_merge_symbol): Allow type change if the old symbol is undefined and the new symbol is defined. --- bfd/ChangeLog | 5 +++++ bfd/elflink.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index a7ead7e54d..49cfb2b411 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2003-09-18 H.J. Lu + + * elflink.c (_bfd_elf_merge_symbol): Allow type change if + the old symbol is undefined and the new symbol is defined. + 2003-09-18 Andreas Schwab * simple.c (bfd_simple_get_relocated_section_contents): Use diff --git a/bfd/elflink.c b/bfd/elflink.c index d53571d448..58acc144bc 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 -- 2.11.0