From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 29B4F3858D32; Sun, 14 Jan 2024 21:55:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 29B4F3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705269349; bh=kreXjZBBjMmOHKTIBVlrnuupdlsGohH4+Tg71J7Hk6A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=e2uokC5kYeEJARZnGjl0a6eeSVVVzhVjhAgjL4R1ewwHbpKAYfsql8ADlyW9l15/l 9lVVHBs1uVEI4Pzndnjsj/anaMCps1xjqw7NfT68UuKXHLMoeC/Nc2Dig5hXG8huO0 ZIlJYgNT+iywVlE+sRNlui5YOfRx1NYdYxyTTT5k= From: "LpSolit at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95637] Read-only data assigned to `.sdata' rather than `.rodata' Date: Tue, 30 Jun 2020 00:05:10 +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: LpSolit at gmail dot com 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95637 --- Comment #6 from Maciej W. Rozycki --- Thanks WRT Ada clarification. Otherwise I don't think there's anything stopping a language definition from requiring an attempt to modify read-only data to be trapped as an exceptional condition, leaving it up to the implementation as to whether to use a hardware feature if available, or whether to rely purely on software mechanisms, such as manually validating pointers to ensure they refer to a location within the boundaries of a memory region designated for writable data before any dereference for the purpose of a write. For example the Linux kernel while it still supported the original 80386 processor used to manually validate kernel write accesses to user pages, because crippled hardware would not trap on kernel writes to read-only pages (this limitation was lifted with the CR0.WP bit from the 80486 on). >From the Linux user ABI's point of view the solution was transparent.=