https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95637

--- Comment #6 from Maciej W. Rozycki <macro at orcam dot me.uk> ---
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.

Reply via email to