From 5293fdcb6440773d242bae7205485ef771be1cb3 Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 1 Aug 2005 17:43:33 +0000 Subject: * config/host-linux.c (linux_gt_pch_get_address): Add new name randomize_va_space for virtual address randomization control. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102636 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/host-linux.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gcc/config/host-linux.c') diff --git a/gcc/config/host-linux.c b/gcc/config/host-linux.c index a1ec046e036..795bb552234 100644 --- a/gcc/config/host-linux.c +++ b/gcc/config/host-linux.c @@ -114,8 +114,13 @@ linux_gt_pch_get_address (size_t size, int fd) if (TRY_EMPTY_VM_SPACE && addr == (void *) TRY_EMPTY_VM_SPACE) return addr; - /* If we didn't, then we need to look to see if randomization is on. */ - f = fopen ("/proc/sys/kernel/exec-shield-randomize", "r"); + /* If we didn't, then we need to look to see if virtual address + randomization is on. That is recorded in + kernel.randomize_va_space. An older implementation used + kernel.exec-shield-randomize. */ + f = fopen ("/proc/sys/kernel/randomize_va_space", "r"); + if (f == NULL) + f = fopen ("/proc/sys/kernel/exec-shield-randomize", "r"); randomize_on = false; if (f != NULL) { -- cgit v1.2.1