summaryrefslogtreecommitdiff
path: root/bfd/coffgen.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2007-07-31 03:53:24 +0000
committerMichael Snyder <msnyder@vmware.com>2007-07-31 03:53:24 +0000
commit9ee2139f60a79a6619a7ee96c00552ad038f6981 (patch)
tree6c4726dac59f8b127745db8d56652a7e012e9d7b /bfd/coffgen.c
parent615c7d515bfd80679d3b56997edfeb73eeefe433 (diff)
downloadbinutils-gdb-9ee2139f60a79a6619a7ee96c00552ad038f6981.tar.gz
2007-07-30 Michael Snyder <msnyder@access-company.com>
* coffgen.c (_bfd_coff_read_internal_relocs): Revert change of 2007-07-26. Buffer still in use, can't be freed.
Diffstat (limited to 'bfd/coffgen.c')
-rw-r--r--bfd/coffgen.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index e5fb6454d34..0ecc6023e6d 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -460,22 +460,17 @@ _bfd_coff_read_internal_relocs (bfd *abfd,
free_external = NULL;
}
- if (free_internal != NULL)
+ if (cache && free_internal != NULL)
{
- if (cache)
- free (free_internal);
- else
+ if (coff_section_data (abfd, sec) == NULL)
{
- if (coff_section_data (abfd, sec) == NULL)
- {
- amt = sizeof (struct coff_section_tdata);
- sec->used_by_bfd = bfd_zalloc (abfd, amt);
- if (sec->used_by_bfd == NULL)
- goto error_return;
- coff_section_data (abfd, sec)->contents = NULL;
- }
- coff_section_data (abfd, sec)->relocs = free_internal;
+ amt = sizeof (struct coff_section_tdata);
+ sec->used_by_bfd = bfd_zalloc (abfd, amt);
+ if (sec->used_by_bfd == NULL)
+ goto error_return;
+ coff_section_data (abfd, sec)->contents = NULL;
}
+ coff_section_data (abfd, sec)->relocs = free_internal;
}
return internal_relocs;