From: Tom Rix Date: Tue, 30 Apr 2002 04:32:51 +0000 (+0000) Subject: Fix a problem with static linking with cross tools. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=07b678c0c3408cebd7515a53a9631b5b2610164c;p=binutils-gdb.git Fix a problem with static linking with cross tools. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index bd2d1f5eef7..a776d87d4cd 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2002-04-30 Tom Rix + + * xcofflink.c (xcoff_link_add_symbols): Always copy undef C_EXT + symbol names into the hash table. + 2002-04-28 Tom Rix * coff-rs6000.c (xcoff_calculate_relocation) : Function table for diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 07698267520..9d66243478c 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -1778,12 +1778,19 @@ xcoff_link_add_symbols (abfd, info) if (info->hash->creator == abfd->xvec) { if (! bfd_is_und_section (section)) - *sym_hash = xcoff_link_hash_lookup (xcoff_hash_table (info), - name, true, copy, false); + { + *sym_hash = xcoff_link_hash_lookup (xcoff_hash_table (info), + name, true, copy, false); + } else - *sym_hash = ((struct xcoff_link_hash_entry *) - bfd_wrapped_link_hash_lookup (abfd, info, name, - true, copy, false)); + { + /* Make a copy of the symbol name to prevent problems with + merging symbols. */ + *sym_hash = ((struct xcoff_link_hash_entry *) + bfd_wrapped_link_hash_lookup (abfd, info, name, + true, true, + false)); + } if (*sym_hash == NULL) goto error_return; if (((*sym_hash)->root.type == bfd_link_hash_defined