aboutsummaryrefslogtreecommitdiff
path: root/binutils/rescoff.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1997-06-26 17:53:57 +0000
committerIan Lance Taylor <ian@airs.com>1997-06-26 17:53:57 +0000
commitd5a7bb530d6ea294848fa3c95181dc48648a4f33 (patch)
tree4e50cfb8521449a8b6cd92e36e5402499aff6623 /binutils/rescoff.c
parent907672ebb2cc46316f542e4ca0fd7185f729bfbf (diff)
downloadgdb-d5a7bb530d6ea294848fa3c95181dc48648a4f33.zip
gdb-d5a7bb530d6ea294848fa3c95181dc48648a4f33.tar.gz
gdb-d5a7bb530d6ea294848fa3c95181dc48648a4f33.tar.bz2
* windres.c (main): Quit if we didn't get any resources.
* rescoff.c (write_coff_file): Don't free the relocation array until after we've closed the BFD.
Diffstat (limited to 'binutils/rescoff.c')
-rw-r--r--binutils/rescoff.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/binutils/rescoff.c b/binutils/rescoff.c
index 0f83e54..6c7f21b 100644
--- a/binutils/rescoff.c
+++ b/binutils/rescoff.c
@@ -531,9 +531,6 @@ write_coff_file (filename, target, resources)
bfd_set_reloc (abfd, sec, cwi.relocs, cwi.reloc_count);
- /* We allocated the relocs array using malloc. */
- free (cwi.relocs);
-
offset = 0;
for (d = cwi.dirs.d; d != NULL; d = d->next)
{
@@ -564,6 +561,9 @@ write_coff_file (filename, target, resources)
if (! bfd_close (abfd))
bfd_fatal ("bfd_close");
+
+ /* We allocated the relocs array using malloc. */
+ free (cwi.relocs);
}
/* Work out the sizes of the various fixed size resource directory