aboutsummaryrefslogtreecommitdiff
path: root/bfd/xcofflink.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2009-03-14 09:36:38 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2009-03-14 09:36:38 +0000
commitf95942a33e236084c7f39d6af199e6b46f6bdbea (patch)
tree6b16ca96ef97aab01d7f70f12d925d54b5a4c250 /bfd/xcofflink.c
parent670562e9d1d1a37e6287a291b8873218be0944cb (diff)
downloadbinutils-f95942a33e236084c7f39d6af199e6b46f6bdbea.zip
binutils-f95942a33e236084c7f39d6af199e6b46f6bdbea.tar.gz
binutils-f95942a33e236084c7f39d6af199e6b46f6bdbea.tar.bz2
bfd/
* xcofflink.c (xcoff_link_check_archive_element): Only free the symbol table if it was created by the current call.
Diffstat (limited to 'bfd/xcofflink.c')
-rw-r--r--bfd/xcofflink.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index f02f668..3752f7c 100644
--- a/bfd/xcofflink.c
+++ b/bfd/xcofflink.c
@@ -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;