bfd/
authorRichard Sandiford <rdsandiford@googlemail.com>
Sat, 14 Mar 2009 09:36:38 +0000 (09:36 +0000)
committerRichard Sandiford <rdsandiford@googlemail.com>
Sat, 14 Mar 2009 09:36:38 +0000 (09:36 +0000)
* xcofflink.c (xcoff_link_check_archive_element): Only free the
symbol table if it was created by the current call.

bfd/ChangeLog
bfd/xcofflink.c

index 25fce9fea38c31b32ac2d45b1384485b951a455c..77be5da7cc5fd15cf9130bbbe19314cd22e19152 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
+
+       * xcofflink.c (xcoff_link_check_archive_element): Only free the
+       symbol table if it was created by the current call.
+
 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
 
        * xcofflink.c (xcoff_build_ldsyms): Give imported descriptors
index f02f66862f0ce0755f56b9a98fad0c590e39cd6b..3752f7c867833354dd5724722e143bd31b0d94af 100644 (file)
@@ -2149,6 +2149,9 @@ xcoff_link_check_archive_element (bfd *abfd,
                                  struct bfd_link_info *info,
                                  bfd_boolean *pneeded)
 {
+  bfd_boolean keep_syms_p;
+
+  keep_syms_p = (obj_coff_external_syms (abfd) != NULL);
   if (! _bfd_coff_get_external_symbols (abfd))
     return FALSE;
 
@@ -2159,9 +2162,11 @@ xcoff_link_check_archive_element (bfd *abfd,
     {
       if (! xcoff_link_add_symbols (abfd, info))
        return FALSE;
+      if (info->keep_memory)
+       keep_syms_p = TRUE;
     }
 
-  if (! info->keep_memory || ! *pneeded)
+  if (!keep_syms_p)
     {
       if (! _bfd_coff_free_symbols (abfd))
        return FALSE;
This page took 0.029298 seconds and 4 git commands to generate.