7142641: -Xshared:on fails on ARM

Map read-only pages MAP_PRIVATE instead of MAP_SHARED

Reviewed-by: dcubed, dholmes
This commit is contained in:
Dean Long 2012-02-29 12:58:49 -05:00 committed by Dean Long
parent 3e904497b1
commit 9cd12c0bcd

View File

@ -4690,14 +4690,12 @@ char* os::map_memory(int fd, const char* file_name, size_t file_offset,
char *addr, size_t bytes, bool read_only,
bool allow_exec) {
int prot;
int flags;
int flags = MAP_PRIVATE;
if (read_only) {
prot = PROT_READ;
flags = MAP_SHARED;
} else {
prot = PROT_READ | PROT_WRITE;
flags = MAP_PRIVATE;
}
if (allow_exec) {