diff options
author | Alan Modra <amodra@gmail.com> | 2020-01-30 17:06:35 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-01-30 17:06:35 +1030 |
commit | 72913831fc585ffa2bed866fb32532513ec10f8e (patch) | |
tree | 271d17d778fe2bafdae039815c5245aa93f34f35 /bfd/coffgen.c | |
parent | 03fe9cfb9834c9552348a4967c0ca53116b6d2b1 (diff) | |
download | gdb-72913831fc585ffa2bed866fb32532513ec10f8e.zip gdb-72913831fc585ffa2bed866fb32532513ec10f8e.tar.gz gdb-72913831fc585ffa2bed866fb32532513ec10f8e.tar.bz2 |
Remove need to clear obj_coff_keep_syms in coff object_p
* coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
or obj_coff_keep_strings here.
(coff_get_normalized_symtab): Free external syms directly.
* xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
on error exit path.
Diffstat (limited to 'bfd/coffgen.c')
-rw-r--r-- | bfd/coffgen.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c index 3ddd2d8..31e6fa7 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -302,14 +302,10 @@ coff_real_object_p (bfd *abfd, } } - obj_coff_keep_syms (abfd) = FALSE; - obj_coff_keep_strings (abfd) = FALSE; _bfd_coff_free_symbols (abfd); return abfd->xvec; fail: - obj_coff_keep_syms (abfd) = FALSE; - obj_coff_keep_strings (abfd) = FALSE; _bfd_coff_free_symbols (abfd); bfd_release (abfd, tdata); fail2: @@ -1877,10 +1873,13 @@ coff_get_normalized_symtab (bfd *abfd) } } - /* Free the raw symbols, but not the strings (if we have them). */ - obj_coff_keep_strings (abfd) = TRUE; - if (! _bfd_coff_free_symbols (abfd)) - return NULL; + /* Free the raw symbols. */ + if (obj_coff_external_syms (abfd) != NULL + && ! obj_coff_keep_syms (abfd)) + { + free (obj_coff_external_syms (abfd)); + obj_coff_external_syms (abfd) = NULL; + } for (internal_ptr = internal; internal_ptr < internal_end; internal_ptr++) |