aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2008-10-21 06:32:39 +0000
committerJan Djärv2008-10-21 06:32:39 +0000
commitfd75ddb283632c593665a345df194ff2f0a40a72 (patch)
treea99462def4a12f2dd2af685ad3e72c8e29302307
parent279299b0b11e075720b593e1fae5bf3a48dfd3f3 (diff)
downloademacs-fd75ddb283632c593665a345df194ff2f0a40a72.tar.gz
emacs-fd75ddb283632c593665a345df194ff2f0a40a72.zip
(main): Unconditionally set PER_LINUX32 and exec
temacs when dumping if HAVE_PERSONALITY_LINUX32 is defined
-rw-r--r--src/ChangeLog5
-rw-r--r--src/emacs.c27
2 files changed, 16 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 64b988e7de4..ea52334bb07 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12008-10-21 Jan Djärv <jan.h.d@swipnet.se>
2
3 * emacs.c (main): Unconditionally set PER_LINUX32 and exec
4 temacs when dumping if HAVE_PERSONALITY_LINUX32 is defined
5
12008-10-21 Kenichi Handa <handa@m17n.org> 62008-10-21 Kenichi Handa <handa@m17n.org>
2 7
3 * coding.c (detect_coding_charset): For iso-8859-* coding systems, 8 * coding.c (detect_coding_charset): For iso-8859-* coding systems,
diff --git a/src/emacs.c b/src/emacs.c
index 56ddb733432..4712e9c1d0b 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -212,8 +212,8 @@ static void *my_heap_start;
212/* The gap between BSS end and heap start as far as we can tell. */ 212/* The gap between BSS end and heap start as far as we can tell. */
213static unsigned long heap_bss_diff; 213static unsigned long heap_bss_diff;
214 214
215/* If the gap between BSS end and heap start is larger than this we try to 215/* If the gap between BSS end and heap start is larger than this
216 work around it, and if that fails, output a warning in dump-emacs. */ 216 output a warning in dump-emacs. */
217#define MAX_HEAP_BSS_DIFF (1024*1024) 217#define MAX_HEAP_BSS_DIFF (1024*1024)
218 218
219 219
@@ -861,29 +861,24 @@ main (int argc, char **argv)
861 } 861 }
862 862
863#ifdef HAVE_PERSONALITY_LINUX32 863#ifdef HAVE_PERSONALITY_LINUX32
864 /* See if there is a gap between the end of BSS and the heap.
865 In that case, set personality and exec ourself again. */
866 if (!initialized 864 if (!initialized
867 && (strcmp (argv[argc-1], "dump") == 0 865 && (strcmp (argv[argc-1], "dump") == 0
868 || strcmp (argv[argc-1], "bootstrap") == 0) 866 || strcmp (argv[argc-1], "bootstrap") == 0)
869 && heap_bss_diff > MAX_HEAP_BSS_DIFF) 867 && ! getenv ("EMACS_HEAP_EXEC"))
870 { 868 {
871 if (! getenv ("EMACS_HEAP_EXEC")) 869 /* Set this so we only do this once. */
872 { 870 putenv("EMACS_HEAP_EXEC=true");
873 /* Set this so we only do this once. */
874 putenv("EMACS_HEAP_EXEC=true");
875 871
876 /* A flag to turn off address randomization which is introduced 872 /* A flag to turn off address randomization which is introduced
877 in linux kernel shipped with fedora core 4 */ 873 in linux kernel shipped with fedora core 4 */
878#define ADD_NO_RANDOMIZE 0x0040000 874#define ADD_NO_RANDOMIZE 0x0040000
879 personality (PER_LINUX32 | ADD_NO_RANDOMIZE); 875 personality (PER_LINUX32 | ADD_NO_RANDOMIZE);
880#undef ADD_NO_RANDOMIZE 876#undef ADD_NO_RANDOMIZE
881 877
882 execvp (argv[0], argv); 878 execvp (argv[0], argv);
883 879
884 /* If the exec fails, try to dump anyway. */ 880 /* If the exec fails, try to dump anyway. */
885 perror ("execvp"); 881 perror ("execvp");
886 }
887 } 882 }
888#endif /* HAVE_PERSONALITY_LINUX32 */ 883#endif /* HAVE_PERSONALITY_LINUX32 */
889 884