From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B2B45385740B; Tue, 17 May 2022 17:34:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B2B45385740B From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105169] Compiling C++ code with -fpatchable-function-entry=16,14 results in references to discarded sections Date: Tue, 17 May 2022 17:34:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.2.1 X-Bugzilla-Keywords: link-failure X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2022 17:34:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105169 --- Comment #13 from CVS Commits --- The trunk branch has been updated by Giuliano Belinassi : https://gcc.gnu.org/g:7a3f38a966a52893fb5bae301a1a3d56961358fb commit r13-566-g7a3f38a966a52893fb5bae301a1a3d56961358fb Author: Giuliano Belinassi Date: Fri May 6 23:37:52 2022 -0300 PR105169 Fix references to discarded sections When -fpatchable-function-entry=3D is enabled, certain C++ codes fails = to link because of generated references to discarded sections in __patchable_function_entry section. This commit fixes this problem by puting those references in a COMDAT section. 2022-05-06 Giuliano Belinassi gcc/ChangeLog PR c++/105169 * targhooks.cc (default_print_patchable_function_entry_1): Hand= le COMDAT case. * varasm.cc (switch_to_comdat_section): New (handle_vtv_comdat_section): Call switch_to_comdat_section. * varasm.h: Declare switch_to_comdat_section. gcc/testsuite/ChangeLog 2022-05-06 Giuliano Belinassi PR c++/105169 * g++.dg/modules/pr105169.h: New file. * g++.dg/modules/pr105169_a.C: New test. * g++.dg/modules/pr105169_b.C: New file.=