Fix a problem with static linking with cross tools.
authorTom Rix <trix@redhat.com>
Tue, 30 Apr 2002 04:32:51 +0000 (04:32 +0000)
committerTom Rix <trix@redhat.com>
Tue, 30 Apr 2002 04:32:51 +0000 (04:32 +0000)
bfd/ChangeLog
bfd/xcofflink.c

index bd2d1f5eef727e3b82417a174ec72f4c2e1fd1ec..a776d87d4cd357c8a83a45faf71bc1c5832dac0d 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-30  Tom Rix  <trix@redhat.com>
+
+       * xcofflink.c (xcoff_link_add_symbols): Always copy undef C_EXT
+       symbol names into the hash table.
+
 2002-04-28  Tom Rix  <trix@redhat.com>
 
        * coff-rs6000.c (xcoff_calculate_relocation) : Function table for
index 076982675209727985c20a60454e181063fe626b..9d66243478c6d6e95bd913f80497f93947f3565b 100644 (file)
@@ -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