From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id DEB453858C50; Fri, 14 Oct 2022 10:26:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DEB453858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665743178; bh=+Y5smJ46Y1XYgsP/vD9y6DBHASvXNkq4Xkok36GIw7E=; h=From:To:Subject:Date:From; b=s59ITzFTpSIQrFy2aLsM2UYJ48KM7/8FBhg+Adhz041qTJ5TGlVrrYNS0GcYYdXWQ szu7WXFzT765eaCHVrmR5gwhBC8HCmHeYogIx/tbedF7Q1j+s7WmFx5XtTnYdzOJPJ wSthtuoxNM2RDcuyCTgblwE2RZFzPeiwLoLE0EgU= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/experiment-asm-file)] Emit to lto-debug.s file the early debug info. X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/users/marxin/heads/experiment-asm-file X-Git-Oldrev: 9094bb4c02ac617b997f35cdbe81cafd35ad1b4e X-Git-Newrev: 252410eaac633ec4d9491ee4d4211ce81200dcf0 Message-Id: <20221014102618.DEB453858C50@sourceware.org> Date: Fri, 14 Oct 2022 10:26:18 +0000 (GMT) List-Id: https://gcc.gnu.org/g:252410eaac633ec4d9491ee4d4211ce81200dcf0 commit 252410eaac633ec4d9491ee4d4211ce81200dcf0 Author: Martin Liska Date: Thu Oct 13 21:48:20 2022 +0200 Emit to lto-debug.s file the early debug info. Diff: --- gcc/dwarf2out.cc | 9 +++++++++ gcc/output.h | 1 + gcc/varasm.cc | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index e81044b8c48..6fde9e56868 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -33044,6 +33044,10 @@ dwarf2out_early_finish (const char *filename) || TARGET_PECOFF || TARGET_COFF) return; + FILE *current_asm_file = asm_out_file; + asm_out_file = fopen ("/tmp/lto-debug.s", "w"); + targetm.asm_out.file_start (); + /* Now as we are going to output for LTO initialize sections and labels to the LTO variants. We don't need a random-seed postfix as other LTO sections as linking the LTO debug sections into one in a partial @@ -33168,6 +33172,11 @@ dwarf2out_early_finish (const char *filename) output_indirect_string> (form); } + targetm.asm_out.file_end (); + fclose (asm_out_file); + asm_out_file = current_asm_file; + wipe_section_cache (); + /* Switch back to the text section. */ switch_to_section (text_section); } diff --git a/gcc/output.h b/gcc/output.h index 6936bdeeb6c..e464efce1d5 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -540,6 +540,7 @@ extern section *get_section (const char *, unsigned int, tree, bool not_existing = false); extern section *get_named_section (tree, const char *, int); extern section *get_variable_section (tree, bool); +extern void wipe_section_cache (void); extern void place_block_symbol (rtx); extern rtx get_section_anchor (struct object_block *, HOST_WIDE_INT, enum tls_model); diff --git a/gcc/varasm.cc b/gcc/varasm.cc index a11184584a2..b7662f2a3d5 100644 --- a/gcc/varasm.cc +++ b/gcc/varasm.cc @@ -6658,6 +6658,12 @@ init_varasm_once (void) #endif } +void +wipe_section_cache () +{ + section_htab->empty (); +} + enum tls_model decl_default_tls_model (const_tree decl) {