diff options
| -rw-r--r-- | src/emacs.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/emacs.c b/src/emacs.c index 5c187e76ba1..2480dfc603a 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -674,6 +674,26 @@ main (int argc, char **argv) | |||
| 674 | 674 | ||
| 675 | stack_base = &dummy; | 675 | stack_base = &dummy; |
| 676 | 676 | ||
| 677 | #if defined HAVE_PERSONALITY_LINUX32 && defined __PPC64__ | ||
| 678 | /* This code partly duplicates the HAVE_PERSONALITY_LINUX32 code | ||
| 679 | below. This duplication is planned to be fixed in a later | ||
| 680 | Emacs release. */ | ||
| 681 | # define ADD_NO_RANDOMIZE 0x0040000 | ||
| 682 | int pers = personality (0xffffffff); | ||
| 683 | if (! (pers & ADD_NO_RANDOMIZE) | ||
| 684 | && 0 <= personality (pers | ADD_NO_RANDOMIZE)) | ||
| 685 | { | ||
| 686 | /* Address randomization was enabled, but is now disabled. | ||
| 687 | Re-execute Emacs to get a clean slate. */ | ||
| 688 | execvp (argv[0], argv); | ||
| 689 | |||
| 690 | /* If the exec fails, warn the user and then try without a | ||
| 691 | clean slate. */ | ||
| 692 | perror (argv[0]); | ||
| 693 | } | ||
| 694 | # undef ADD_NO_RANDOMIZE | ||
| 695 | #endif | ||
| 696 | |||
| 677 | #ifndef CANNOT_DUMP | 697 | #ifndef CANNOT_DUMP |
| 678 | might_dump = !initialized; | 698 | might_dump = !initialized; |
| 679 | #endif | 699 | #endif |
| @@ -784,7 +804,7 @@ main (int argc, char **argv) | |||
| 784 | dumping = !initialized && (strcmp (argv[argc - 1], "dump") == 0 | 804 | dumping = !initialized && (strcmp (argv[argc - 1], "dump") == 0 |
| 785 | || strcmp (argv[argc - 1], "bootstrap") == 0); | 805 | || strcmp (argv[argc - 1], "bootstrap") == 0); |
| 786 | 806 | ||
| 787 | #ifdef HAVE_PERSONALITY_LINUX32 | 807 | #if defined HAVE_PERSONALITY_LINUX32 && !defined __PPC64__ |
| 788 | if (dumping && ! getenv ("EMACS_HEAP_EXEC")) | 808 | if (dumping && ! getenv ("EMACS_HEAP_EXEC")) |
| 789 | { | 809 | { |
| 790 | /* Set this so we only do this once. */ | 810 | /* Set this so we only do this once. */ |
| @@ -801,7 +821,7 @@ main (int argc, char **argv) | |||
| 801 | /* If the exec fails, try to dump anyway. */ | 821 | /* If the exec fails, try to dump anyway. */ |
| 802 | emacs_perror (argv[0]); | 822 | emacs_perror (argv[0]); |
| 803 | } | 823 | } |
| 804 | #endif /* HAVE_PERSONALITY_LINUX32 */ | 824 | #endif |
| 805 | 825 | ||
| 806 | #if defined (HAVE_SETRLIMIT) && defined (RLIMIT_STACK) && !defined (CYGWIN) | 826 | #if defined (HAVE_SETRLIMIT) && defined (RLIMIT_STACK) && !defined (CYGWIN) |
| 807 | /* Extend the stack space available. Don't do that if dumping, | 827 | /* Extend the stack space available. Don't do that if dumping, |