1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-15 09:47:20 +00:00

Port to glibc 2.24 (pre-release) + ppc64

Backport from master (Bug#24033).
Inspired by a suggestion by Florian Weimer in:
https://sourceware.org/ml/libc-alpha/2016-07/msg00425.html
* src/emacs.c (main) [__PPC64__]:
Special case for __PPC64__, which needs ASLR disabled in
dumped Emacs too.
This commit is contained in:
Paul Eggert 2016-07-19 15:23:14 +02:00
parent eb9d461a8e
commit ff3fc21e24

View File

@ -674,6 +674,26 @@ main (int argc, char **argv)
stack_base = &dummy;
#if defined HAVE_PERSONALITY_LINUX32 && defined __PPC64__
/* This code partly duplicates the HAVE_PERSONALITY_LINUX32 code
below. This duplication is planned to be fixed in a later
Emacs release. */
# define ADD_NO_RANDOMIZE 0x0040000
int pers = personality (0xffffffff);
if (! (pers & ADD_NO_RANDOMIZE)
&& 0 <= personality (pers | ADD_NO_RANDOMIZE))
{
/* Address randomization was enabled, but is now disabled.
Re-execute Emacs to get a clean slate. */
execvp (argv[0], argv);
/* If the exec fails, warn the user and then try without a
clean slate. */
perror (argv[0]);
}
# undef ADD_NO_RANDOMIZE
#endif
#ifndef CANNOT_DUMP
might_dump = !initialized;
#endif
@ -784,7 +804,7 @@ main (int argc, char **argv)
dumping = !initialized && (strcmp (argv[argc - 1], "dump") == 0
|| strcmp (argv[argc - 1], "bootstrap") == 0);
#ifdef HAVE_PERSONALITY_LINUX32
#if defined HAVE_PERSONALITY_LINUX32 && !defined __PPC64__
if (dumping && ! getenv ("EMACS_HEAP_EXEC"))
{
/* Set this so we only do this once. */
@ -801,7 +821,7 @@ main (int argc, char **argv)
/* If the exec fails, try to dump anyway. */
emacs_perror (argv[0]);
}
#endif /* HAVE_PERSONALITY_LINUX32 */
#endif
#if defined (HAVE_SETRLIMIT) && defined (RLIMIT_STACK) && !defined (CYGWIN)
/* Extend the stack space available. Don't do that if dumping,