On Tue, 19 Jan 2021, Bruno Haible wrote:
MAP_FIXED is a portability nightmare nowadays, where most OSes implement
address space randomization and put the shared libraries at arbitrary
and random locations in the address space. You better stay away from it.
The implementation I pointed to therefore doesn't use MAP_FIXED, just
plain MAP_SHARED.
The problem is, without a fixed offset between the mutable and immutable
spaces, certain desirable semantics become harder to implement. For
example, we want mutable and immutable references to the same object to
compare equal.
One potential solution is to rely on overcommit. Map a giant memory
region, and then remap the second portion (using MAP_FIXED) to alias the
first half. (Using MAP_FIXED to overwrite existing address space mappings
_is_ a supported usage.)
-E
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel