Merge changes made in Gnus trunk.
[bpt/emacs.git] / src / unexaix.c
index 41324ac..949616d 100644 (file)
@@ -1,13 +1,13 @@
 /* Dump an executable image.
    Copyright (C) 1985, 1986, 1987, 1988, 1999, 2001, 2002, 2003, 2004,
-                 2005, 2006, 2007  Free Software Foundation, Inc.
+                 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
-GNU Emacs is free software; you can redistribute it and/or modify
+GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +15,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.
+along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
+/*
 In other words, you are welcome to use, share and improve this program.
 You are forbidden to forbid anyone else to use, share and improve
 what you give them.   Help stamp out software-hoarding!  */
@@ -72,7 +71,7 @@ what you give them.   Help stamp out software-hoarding!  */
 #include <unistd.h>
 #include <fcntl.h>
 
-extern char *start_of_text (void);             /* Start of text */
+char *start_of_text (void);                    /* Start of text */
 extern char *start_of_data (void);             /* Start of initialized data */
 
 extern int _data;
@@ -104,15 +103,8 @@ static int adjust_lnnoptrs (int, int, char *);
 
 static int pagemask;
 
-/* Correct an int which is the bit pattern of a pointer to a byte
-   into an int which is the number of a byte.
-   This is a no-op on ordinary machines, but not on all.  */
-
-#ifndef ADDR_CORRECT   /* Let m-*.h files override this definition */
-#define ADDR_CORRECT(x) ((char *)(x) - (char*)0)
-#endif
-
 #ifdef emacs
+#include <setjmp.h>
 #include "lisp.h"
 
 static void
@@ -443,7 +435,6 @@ write_segment (int new, char *ptr, char *end)
 {
   int i, nwrite, ret;
   char buf[80];
-  extern int errno;
   char zeros[UnexBlockSz];
 
   for (i = 0; ptr < end;)
@@ -678,5 +669,18 @@ unrelocate_symbols (int new, int a_out, char *a_name, char *new_name)
   return 0;
 }
 
+/*
+ *     Return the address of the start of the text segment prior to
+ *     doing an unexec.  After unexec the return value is undefined.
+ *     See crt0.c for further explanation and _start.
+ *
+ */
+
+char *
+start_of_text (void)
+{
+  return ((char *) 0x10000000);
+}
+
 /* arch-tag: 0783857a-7c2d-456f-a426-58b722d69fd0
    (do not change this comment) */