public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] coff_close_and_cleanup
Date: Sun, 29 Dec 2019 12:48:00 -0000	[thread overview]
Message-ID: <f5d35bb7a5789950efd5f03b270d4c5f774eaba9@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT f5d35bb7a5789950efd5f03b270d4c5f774eaba9 ***

commit f5d35bb7a5789950efd5f03b270d4c5f774eaba9
Author:     Alan Modra <amodra@gmail.com>
AuthorDate: Sun Dec 29 12:55:20 2019 +1030
Commit:     Alan Modra <amodra@gmail.com>
CommitDate: Sun Dec 29 21:26:00 2019 +1030

    coff_close_and_cleanup
    
    Fixes leaks in _bfd_coff_get_external_symbols and
    _bfd_coff_read_string_table.
    
            * coffcode.h (coff_close_and_cleanup): Redefine to..
            * coffgen.c (_bfd_coff_close_and_cleanup): ..this.  New function.
            * libcoff-in.h (_bfd_coff_close_and_cleanup): Declare.
            * libcoff.h: Regenerate.

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index af2ddfa5e0..de79b5eb23 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2019-12-29  Alan Modra  <amodra@gmail.com>
+
+	* coffcode.h (coff_close_and_cleanup): Redefine to..
+	* coffgen.c (_bfd_coff_close_and_cleanup): ..this.  New function.
+	* libcoff-in.h (_bfd_coff_close_and_cleanup): Declare.
+	* libcoff.h: Regenerate.
+
 2019-12-29  Hannes Domani  <ssbssa@yahoo.de>
 	    Alan Modra  <amodra@gmail.com>
 
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index ac5312fdb0..7bf7d68e03 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -5642,7 +5642,7 @@ static bfd_coff_backend_data bigobj_swap_table =
 #endif /* COFF_WITH_PE_BIGOBJ */
 
 #ifndef coff_close_and_cleanup
-#define coff_close_and_cleanup		    _bfd_generic_close_and_cleanup
+#define coff_close_and_cleanup		    _bfd_coff_close_and_cleanup
 #endif
 
 #ifndef coff_bfd_free_cached_info
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index 7f26e18c45..57a18b02dc 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -3161,3 +3161,18 @@ bfd_coff_group_name (bfd *abfd, const asection *sec)
     return ci->name;
   return NULL;
 }
+
+bfd_boolean
+_bfd_coff_close_and_cleanup (bfd *abfd)
+{
+  if (abfd->format == bfd_object
+      && bfd_family_coff (abfd)
+      && coff_data (abfd) != NULL)
+    {
+      obj_coff_keep_syms (abfd) = FALSE;
+      obj_coff_keep_strings (abfd) = FALSE;
+      if (!_bfd_coff_free_symbols (abfd))
+	return FALSE;
+    }
+  return _bfd_generic_close_and_cleanup (abfd);
+}
diff --git a/bfd/libcoff-in.h b/bfd/libcoff-in.h
index 031622f018..a4623dd903 100644
--- a/bfd/libcoff-in.h
+++ b/bfd/libcoff-in.h
@@ -367,6 +367,8 @@ extern bfd_vma bfd_coff_reloc16_get_value
   (arelent *, struct bfd_link_info *, asection *);
 extern void bfd_perform_slip
   (bfd *, unsigned int, asection *, bfd_vma);
+extern bfd_boolean _bfd_coff_close_and_cleanup
+  (bfd *);
 
 /* Functions and types in cofflink.c.  */
 
diff --git a/bfd/libcoff.h b/bfd/libcoff.h
index 093f1b4159..e9cade86bb 100644
--- a/bfd/libcoff.h
+++ b/bfd/libcoff.h
@@ -371,6 +371,8 @@ extern bfd_vma bfd_coff_reloc16_get_value
   (arelent *, struct bfd_link_info *, asection *);
 extern void bfd_perform_slip
   (bfd *, unsigned int, asection *, bfd_vma);
+extern bfd_boolean _bfd_coff_close_and_cleanup
+  (bfd *);
 
 /* Functions and types in cofflink.c.  */
 


             reply	other threads:[~2019-12-29 12:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-29 12:48 gdb-buildbot [this message]
2019-12-29 12:47 ` Failures on Ubuntu-Aarch64-m64, branch master gdb-buildbot
2019-12-29 13:28 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot
2019-12-29 14:12 ` Failures on Fedora-i686, " gdb-buildbot
2019-12-29 14:26 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2019-12-29 14:39 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2019-12-29 14:44 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2019-12-29 14:55 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2019-12-29 15:00 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2019-12-29 15:13 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f5d35bb7a5789950efd5f03b270d4c5f774eaba9@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).