[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/unexec.c,v
From: |
Dan Nicolaescu |
Subject: |
[Emacs-diffs] Changes to emacs/src/unexec.c,v |
Date: |
Sat, 09 Feb 2008 18:03:13 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Dan Nicolaescu <dann> 08/02/09 18:03:11
Index: src/unexec.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/unexec.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- src/unexec.c 9 Feb 2008 07:42:04 -0000 1.46
+++ src/unexec.c 9 Feb 2008 18:03:07 -0000 1.47
@@ -133,11 +133,6 @@
If defined, this macro specifies the number of bytes to seek into the
a.out file before starting to write the text segment.
-* EXEC_MAGIC
-
-For machines using COFF, this macro, if defined, is a value stored
-into the magic number field of the output file.
-
* ADJUST_EXEC_HEADER
This macro can be used to generate statements to adjust or
@@ -157,7 +152,6 @@
#ifndef emacs
#define PERROR(arg) perror (arg); return -1
#else
-#define IN_UNEXEC
#include <config.h>
#define PERROR(file) report_error (file, new)
#endif
@@ -256,11 +250,6 @@
#define SYMS_START ((long) N_SYMOFF (ohdr))
-/* Some machines override the structure name for an a.out header. */
-#ifndef EXEC_HDR_TYPE
-#define EXEC_HDR_TYPE struct exec
-#endif
-
#ifdef HPUX
#ifdef HP9000S200_ID
#define MY_ID HP9000S200_ID
@@ -272,11 +261,11 @@
static MAGIC NEWMAGIC = {MY_ID, DEMAND_MAGIC};
#define N_TXTOFF(x) TEXT_OFFSET(x)
#define N_SYMOFF(x) LESYM_OFFSET(x)
-static EXEC_HDR_TYPE hdr, ohdr;
+static struct exec hdr, ohdr;
#else /* not HPUX */
-#if defined (USG) && !defined (IBMAIX) && !defined (IRIS) && !defined
(GNU_LINUX)
+#if defined (USG) && !defined (IRIS) && !defined (GNU_LINUX)
static struct bhdr hdr, ohdr;
#define a_magic fmagic
#define a_text tsize
@@ -290,10 +279,10 @@
(((x).fmagic)!=OMAGIC && ((x).fmagic)!=NMAGIC &&\
((x).fmagic)!=FMAGIC && ((x).fmagic)!=IMAGIC)
#define NEWMAGIC FMAGIC
-#else /* IRIS or IBMAIX or not USG */
-static EXEC_HDR_TYPE hdr, ohdr;
+#else /* IRIS or not USG */
+static struct exec hdr, ohdr;
#define NEWMAGIC ZMAGIC
-#endif /* IRIS or IBMAIX not USG */
+#endif /* IRIS or not USG */
#endif /* not HPUX */
static int unexec_text_start;
@@ -504,12 +493,6 @@
#endif
f_hdr.f_flags |= (F_RELFLG | F_EXEC);
-#ifdef TPIX
- f_hdr.f_nscns = 3;
-#endif
-#ifdef EXEC_MAGIC
- f_ohdr.magic = EXEC_MAGIC;
-#endif
#ifndef NO_REMAP
f_ohdr.text_start = (long) start_of_text ();
f_ohdr.tsize = data_start - f_ohdr.text_start;
@@ -517,13 +500,11 @@
#endif /* NO_REMAP */
f_ohdr.dsize = bss_start - f_ohdr.data_start;
f_ohdr.bsize = bss_end - bss_start;
-#ifndef KEEP_OLD_TEXT_SCNPTR
/* On some machines, the old values are right.
??? Maybe on all machines with NO_REMAP. */
f_thdr.s_size = f_ohdr.tsize;
f_thdr.s_scnptr = sizeof (f_hdr) + sizeof (f_ohdr);
f_thdr.s_scnptr += (f_hdr.f_nscns) * (sizeof (f_thdr));
-#endif /* KEEP_OLD_TEXT_SCNPTR */
#ifdef ADJUST_TEXT_SCNHDR_SIZE
/* On some machines, `text size' includes all headers. */
f_thdr.s_size -= f_thdr.s_scnptr;
@@ -535,16 +516,8 @@
f_thdr.s_scnptr
= (f_thdr.s_scnptr + SECTION_ALIGNMENT) & ~SECTION_ALIGNMENT;
#endif /* SECTION_ALIGNMENT */
-#ifdef TPIX
- f_thdr.s_scnptr = 0xd0;
-#endif
text_scnptr = f_thdr.s_scnptr;
-#ifdef ADJUST_TEXTBASE
- text_scnptr = sizeof (f_hdr) + sizeof (f_ohdr) + (f_hdr.f_nscns) * (sizeof
(f_thdr));
-#endif
-#ifndef KEEP_OLD_PADDR
f_dhdr.s_paddr = f_ohdr.data_start;
-#endif /* KEEP_OLD_PADDR */
f_dhdr.s_vaddr = f_ohdr.data_start;
f_dhdr.s_size = f_ohdr.dsize;
f_dhdr.s_scnptr = f_thdr.s_scnptr + f_thdr.s_size;
@@ -561,9 +534,7 @@
= (f_dhdr.s_scnptr + DATA_SECTION_ALIGNMENT) & ~DATA_SECTION_ALIGNMENT;
#endif /* DATA_SECTION_ALIGNMENT */
data_scnptr = f_dhdr.s_scnptr;
-#ifndef KEEP_OLD_PADDR
f_bhdr.s_paddr = f_ohdr.data_start + f_ohdr.dsize;
-#endif /* KEEP_OLD_PADDR */
f_bhdr.s_vaddr = f_ohdr.data_start + f_ohdr.dsize;
f_bhdr.s_size = f_ohdr.bsize;
f_bhdr.s_scnptr = 0L;
@@ -874,10 +845,6 @@
lseek (new, (long) text_scnptr, 0);
ptr = (char *) f_ohdr.text_start;
-#ifdef HEADER_INCL_IN_TEXT
- /* For Gould UTX/32, text starts after headers */
- ptr = (char *) (ptr + text_scnptr);
-#endif /* HEADER_INCL_IN_TEXT */
end = ptr + f_ohdr.tsize;
write_segment (new, ptr, end);