]> code.delx.au - gnu-emacs/blobdiff - src/unexec.c
(Fwhile): If mocklisp, test for nonzeroness.
[gnu-emacs] / src / unexec.c
index 4d4cf20fd554c276760fe757af4cf8a9c90d50e8..d14103f1dd5cfecc9a192e5008106fc190716341 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc.
+/* Copyright (C) 1985, 1986, 1987, 1988, 1992 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -207,7 +207,15 @@ static long data_scnptr;
 
 #else /* not COFF */
 
+#ifdef HPUX
+extern void *sbrk ();
+#else
+#ifdef __STDC__
+extern void *sbrk ();
+#else
 extern char *sbrk ();
+#endif /* __STDC__ */
+#endif /* HPUX */
 
 #define SYMS_START ((long) N_SYMOFF (ohdr))
 
@@ -231,7 +239,7 @@ static EXEC_HDR_TYPE hdr, ohdr;
 
 #else /* not HPUX */
 
-#if defined (USG) && !defined (IBMAIX) && !defined (IRIS) && !defined (COFF_ENCAPSULATE)
+#if defined (USG) && !defined (IBMAIX) && !defined (IRIS) && !defined (COFF_ENCAPSULATE) && !defined (LINUX)
 static struct bhdr hdr, ohdr;
 #define a_magic fmagic
 #define a_text tsize
@@ -475,7 +483,7 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
    * space.
    */
 
-  bias = bss_end - (f_ohdr.data_start + f_dhdr.s_size);
+  bias = bss_start - (f_ohdr.data_start + f_dhdr.s_size);
 
 #endif
 
@@ -599,7 +607,7 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
    * .lib), adjust the address of where the section data is in the
    * file, and write out the header.
    *
-   * If any section preceeds .text or .data in the file, this code
+   * If any section precedes .text or .data in the file, this code
    * will not adjust the file pointer for that section correctly.
    */
 
@@ -804,7 +812,7 @@ copy_text_and_data (new, a_out)
            {
              n = size > sizeof (page) ? sizeof (page) : size;
              if (read (a_out, page, n) != n || write (new, page, n) != n)
-               PERROR ("xemacs");
+               PERROR ("emacs");
            }
          lseek (a_out, old_a_out_ptr, 0);
        }
@@ -942,7 +950,7 @@ copy_sym (new, a_out, a_name, new_name)
 /* ****************************************************************
  * mark_x
  *
- * After succesfully building the new a.out, mark it executable
+ * After successfully building the new a.out, mark it executable
  */
 static void
 mark_x (name)
@@ -995,7 +1003,7 @@ adjust_lnnoptrs (writedesc, readdesc, new_name)
 {
   register int nsyms;
   register int new;
-#ifdef amdahl_uts
+#if defined (amdahl_uts) || defined (pfa)
   SYMENT symentry;
   AUXENT auxentry;
 #else
@@ -1020,11 +1028,12 @@ adjust_lnnoptrs (writedesc, readdesc, new_name)
        {
          read (new, &auxentry, AUXESZ);
          nsyms++;
-         if (ISFCN (symentry.n_type)) {
-           auxentry.x_sym.x_fcnary.x_fcn.x_lnnoptr += bias;
-           lseek (new, -AUXESZ, 1);
-           write (new, &auxentry, AUXESZ);
-         }
+         if (ISFCN (symentry.n_type) || symentry.n_type == 0x2400)
+           {
+             auxentry.x_sym.x_fcnary.x_fcn.x_lnnoptr += bias;
+             lseek (new, -AUXESZ, 1);
+             write (new, &auxentry, AUXESZ);
+           }
        }
     }
   close (new);