(Fsubr_name): New fun.
[bpt/emacs.git] / src / unexec.c
index 7dac732..dadea56 100644 (file)
@@ -134,7 +134,7 @@ before writing it (above and beyond the number of bytes of actual
 program text).  HDR's standard fields are already correct, except that
 this adjustment to the `a_text' field has not yet been made;
 thus, the amount of offset can depend on the data in the file.
-  
+
 * A_TEXT_SEEK(HDR)
 
 If defined, this macro specifies the number of bytes to seek into the
@@ -171,7 +171,7 @@ pointer looks like an int) but not on all machines.
 
 #ifndef CANNOT_DUMP  /* all rest of file!  */
 
-#ifdef COFF
+#if defined(COFF) && defined(HAVE_COFF_H)
 #include <coff.h>
 #ifdef MSDOS
 #if __DJGPP__ > 1
@@ -288,7 +288,7 @@ static EXEC_HDR_TYPE hdr, ohdr;
 
 #else /* not HPUX */
 
-#if defined (USG) && !defined (IBMAIX) && !defined (IRIS) && !defined (COFF_ENCAPSULATE) && !defined (LINUX)
+#if defined (USG) && !defined (IBMAIX) && !defined (IRIS) && !defined (COFF_ENCAPSULATE) && !defined (GNU_LINUX)
 static struct bhdr hdr, ohdr;
 #define a_magic fmagic
 #define a_text tsize
@@ -399,7 +399,7 @@ unexec (new_name, a_name, data_start, bss_start, entry_address)
     {
       close (new);
       /* unlink (new_name);            /* Failed, unlink new a.out */
-      return -1;       
+      return -1;
     }
 
   close (new);
@@ -821,7 +821,7 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
       PERROR (new_name);
     }
 
-#if 0 /* This #ifndef caused a bug on Linux when using QMAGIC.  */
+#if 0 /* This #ifndef caused a bug on GNU/Linux when using QMAGIC.  */
   /* This adjustment was done above only #ifndef NO_REMAP,
      so only undo it now #ifndef NO_REMAP.  */
   /* #ifndef NO_REMAP  */
@@ -992,7 +992,7 @@ copy_text_and_data (new, a_out)
     char c;
     int mcount_address, mcount_offset, count;
     extern char *_execname;
-   
+
 
     /* The use of _execname is incompatible with RISCiX 1.1 */
     sprintf (command, "nm %s | fgrep mcount", _execname);
@@ -1012,7 +1012,7 @@ copy_text_and_data (new, a_out)
     {
       sprintf (errbuf, "Failed to execute the command '%s'\n", command);
       PERROR (errbuf);
-    }  
+    }
 
     sscanf(address_text, "%x", &mcount_address);
     ptr = (char *) unexec_text_start;
@@ -1067,7 +1067,9 @@ write_segment (new, ptr, end)
 {
   register int i, nwrite, ret;
   char buf[80];
+#ifndef USE_CRT_DLL
   extern int errno;
+#endif
   /* This is the normal amount to write at once.
      It is the size of block that NFS uses.  */
   int writesize = 1 << 13;
@@ -1263,3 +1265,6 @@ adjust_lnnoptrs (writedesc, readdesc, new_name)
 #endif /* COFF */
 
 #endif /* not CANNOT_DUMP */
+
+/* arch-tag: 62409b69-e27a-4a7c-9413-0210d6b54e7f
+   (do not change this comment) */