From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0209F384A033; Thu, 11 Jun 2020 21:06:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0209F384A033 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591909592; bh=SiPEHx7p31wwQ+ZZYaIXq4Jk7FN0q+AF38nz9/2Re/c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nX7qYc+vNvTUMq8Q8J6fBIExeC8mbuiIRv9ws+j3fCHNTAp710M+Vk569LkO+cTkz mRAR6TLBb04E4pIaD3mHDDptA3zPuy2yjhlAHPJp4Ull8GAt7q1K3H7SJCzunTak5B NAfw4fjJLPJD3voBRYv5lpNWD4xMh7D+QUuNON2A= From: "wilson at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95637] Read-only data assigned to `.sdata' rather than `.rodata' Date: Thu, 11 Jun 2020 21:06:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: wilson at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: cc 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: Thu, 11 Jun 2020 21:06:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95637 Jim Wilson changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wilson at gcc dot gnu.org --- Comment #1 from Jim Wilson --- The RISC-V backend puts small read-only data in the srodata section. RISC-= V is not the only target that supports srodata. I agree that this might be surprising for targets with memory protection that are expecting writes to read-only data to trap but I don't think that standards require traps here.= =20 And for targets without memory protection this is a useful code size and performance optimization. We could perhaps disable srodata support for the riscv linux and freebsd targets. I think those are the only ones with memory protection that we support. Maybe make this controlled by an option so people can choose betw= een getting traps and getting smaller faster code.=