From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 13F563858C36; Mon, 26 Feb 2024 17:06:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13F563858C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708967171; bh=foiu4MJEEp/H+qmrth4MQOIImh/c470XgXlsoIDLgn8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OYRUtMXtvOpjVuoPzbdV70zLdLwqIXgRo6cSBEt9vvxwySsPe7OUoX4hazCSmNjo7 5ZwjW1NtAYLAvEomT/KQELWvDtmxNrlQ00W/WfXgSH5AjRxN8Vhyt6y+4cQ+CGYRnr 8mwwu1ZFJDtgUvYhYA8ARFxssy5wPIjrefjvVCz0= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/113617] [14 Regression] Symbol ... referenced in section `.data.rel.ro.local' of ...: defined in discarded section ... since r14-4944 Date: Mon, 26 Feb 2024 17:06:08 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: link-failure, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113617 --- Comment #17 from GCC Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:1931c40364bb9fb0a7c4b650917e3ac0e88bf6f4 commit r14-9185-g1931c40364bb9fb0a7c4b650917e3ac0e88bf6f4 Author: Jakub Jelinek Date: Mon Feb 26 17:55:07 2024 +0100 varasm: Handle private COMDAT function symbol reference in readonly data section [PR113617] If default_elf_select_rtx_section is called to put a reference to some local symbol defined in a comdat section into memory, which happens more often since the r14-4944 RA change, linking might fail. default_elf_select_rtx_section puts such constants into .data.rel.ro.lo= cal etc. sections and if linker chooses comdat sections from some other TU and discards the one to which a relocation in .data.rel.ro.local remain= s, linker diagnoses error. References to private comdat symbols can only appear from functions or data objects in the same comdat group, so the followi= ng patch arranges using .data.rel.ro.local.pool. and similar sections. 2024-02-26 Jakub Jelinek H.J. Lu PR rtl-optimization/113617 * varasm.cc (default_elf_select_rtx_section): For references to private symbols in comdat sections use .data.relro.local.pool., .data.relro.pool. or .rodata. comdat sections. * g++.dg/other/pr113617.C: New test. * g++.dg/other/pr113617.h: New test. * g++.dg/other/pr113617-aux.cc: New test.=