host-linux.c (linux_gt_pch_get_address): Add new name randomize_va_space for virtual...
authorIan Lance Taylor <ian@airs.com>
Mon, 1 Aug 2005 17:43:33 +0000 (17:43 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 1 Aug 2005 17:43:33 +0000 (17:43 +0000)
* config/host-linux.c (linux_gt_pch_get_address): Add new name
randomize_va_space for virtual address randomization control.

From-SVN: r102636

gcc/ChangeLog
gcc/config/host-linux.c

index 297fca10fb1d630f2cb9cb553f297b4c8dca9a37..042da8678bc6b4c364d0f2fd0f12ad0596c34d6e 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-01  Ian Lance Taylor  <ian@airs.com>
+
+       * config/host-linux.c (linux_gt_pch_get_address): Add new name
+       randomize_va_space for virtual address randomization control.
+
 2005-08-01  Steven Bosscher  <stevenb@suse.de>
 
        * common.opt (flag_ipa_cp): Put in right place to maintain
index a1ec046e03646fec8e78f020db54575fefe1df94..795bb552234002cdbccec9ead739f73fe685537d 100644 (file)
@@ -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)
     {