public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Iain D Sandoe <iains@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-2969] Darwin: Reset section names table at the end of compile.
Date: Tue, 17 Aug 2021 18:48:47 +0000 (GMT)	[thread overview]
Message-ID: <20210817184847.EFDE339730EE@sourceware.org> (raw)

https://gcc.gnu.org/g:2d9da1c89778be1d6604cc1465b0dd50f241a352

commit r12-2969-g2d9da1c89778be1d6604cc1465b0dd50f241a352
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Fri Aug 13 20:20:04 2021 +0100

    Darwin: Reset section names table at the end of compile.
    
    For a single use (typical compile) this vector will be reclaimed
    as GGC.  For JIT this is not sufficient since it does not reset
    the pointer to NULL (and thus we think the the vector is already
    allocated when a context is reused).
    
    The clears the vector and sets the pointer to NULL at the end
    of object output.
    
    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
    
    gcc/ChangeLog:
    
            * config/darwin.c (darwin_file_end): Reset and reclaim the
            section names table at the end of compile.

Diff:
---
 gcc/config/darwin.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index b160c23ea56..5d1d13c80aa 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -3129,6 +3129,14 @@ darwin_file_end (void)
      re-arranging data.  */
   if (!DARWIN_SECTION_ANCHORS || !flag_section_anchors)
     fprintf (asm_out_file, "\t.subsections_via_symbols\n");
+
+  /* We rely on this being NULL at the start of compilation; reset it here
+     so that JIT can reuse a context.  */
+  if (dwarf_sect_names_table != NULL)
+    {
+      dwarf_sect_names_table->truncate (0);
+      dwarf_sect_names_table = NULL;
+    }
 }
 
 /* TODO: Add a language hook for identifying if a decl is a vtable.  */


                 reply	other threads:[~2021-08-17 18:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210817184847.EFDE339730EE@sourceware.org \
    --to=iains@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.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).