aboutsummaryrefslogtreecommitdiffstats
path: root/src/unexec.c
diff options
context:
space:
mode:
authorDan Nicolaescu2008-02-09 07:42:06 +0000
committerDan Nicolaescu2008-02-09 07:42:06 +0000
commitdeeaffe11d28ca1b42e4f59c33a30d0e58698044 (patch)
treeb2d4bda90d751726d1bc07dcbea41a97e252aa0a /src/unexec.c
parent05f2964e439fc44ceeaced760c7246fc966bf196 (diff)
downloademacs-deeaffe11d28ca1b42e4f59c33a30d0e58698044.tar.gz
emacs-deeaffe11d28ca1b42e4f59c33a30d0e58698044.zip
* Makefile.in (REGEXP_IN_LIBC): Remove reference to obsolete
variable. * s/gnu-linux.h: Remove commented out code. * unexec.c: Remove references to obsolete variable COFF_ENCAPSULATE. * Makefile.in: Update what RMS says about using autoconf. (C_COMPILER): (COFF_ENCAPSULATE): (MAKE_PARALLEL): Remove obsolete variable. (C_SWITCH_MACHINE_1, C_SWITCH_SYSTEM_1, C_SWITCH_SITE_1): (C_SWITCH_X_SITE_1, C_SWITCH_X_MACHINE_1) (C_SWITCH_X_SYSTEM_1): Move invariant code outside conditional.
Diffstat (limited to 'src/unexec.c')
-rw-r--r--src/unexec.c63
1 files changed, 1 insertions, 62 deletions
diff --git a/src/unexec.c b/src/unexec.c
index b0ef8fc4d51..4ecb239c137 100644
--- a/src/unexec.c
+++ b/src/unexec.c
@@ -77,14 +77,6 @@ Boston, MA 02110-1301, USA. */
77 77
78Define this if your system uses COFF for executables. 78Define this if your system uses COFF for executables.
79 79
80* COFF_ENCAPSULATE
81
82Define this if you are using the GNU coff encapsulated a.out format.
83This is closer to a.out than COFF. You should *not* define COFF if
84you define COFF_ENCAPSULATE
85
86Otherwise we assume you use Berkeley format.
87
88* NO_REMAP 80* NO_REMAP
89 81
90Define this if you do not want to try to save Emacs's pure data areas 82Define this if you do not want to try to save Emacs's pure data areas
@@ -199,12 +191,7 @@ struct aouthdr
199}; 191};
200#endif /* not MSDOS */ 192#endif /* not MSDOS */
201#else /* not COFF */ 193#else /* not COFF */
202#ifdef COFF_ENCAPSULATE
203int need_coff_header = 1;
204#include <coff-encap/a.out.encap.h> /* The location might be a poor assumption */
205#else /* not COFF_ENCAPSULATE */
206#include <a.out.h> 194#include <a.out.h>
207#endif /* not COFF_ENCAPSULATE */
208#endif /* not COFF */ 195#endif /* not COFF */
209 196
210/* Define getpagesize if the system does not. 197/* Define getpagesize if the system does not.
@@ -289,7 +276,7 @@ static EXEC_HDR_TYPE hdr, ohdr;
289 276
290#else /* not HPUX */ 277#else /* not HPUX */
291 278
292#if defined (USG) && !defined (IBMAIX) && !defined (IRIS) && !defined (COFF_ENCAPSULATE) && !defined (GNU_LINUX) 279#if defined (USG) && !defined (IBMAIX) && !defined (IRIS) && !defined (GNU_LINUX)
293static struct bhdr hdr, ohdr; 280static struct bhdr hdr, ohdr;
294#define a_magic fmagic 281#define a_magic fmagic
295#define a_text tsize 282#define a_text tsize
@@ -312,11 +299,6 @@ static EXEC_HDR_TYPE hdr, ohdr;
312static int unexec_text_start; 299static int unexec_text_start;
313static int unexec_data_start; 300static int unexec_data_start;
314 301
315#ifdef COFF_ENCAPSULATE
316/* coffheader is defined in the GNU a.out.encap.h file. */
317struct coffheader coffheader;
318#endif
319
320#endif /* not COFF */ 302#endif /* not COFF */
321 303
322static int pagemask; 304static int pagemask;
@@ -686,16 +668,6 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
686 /* Get symbol table info from header of a.out file if given one. */ 668 /* Get symbol table info from header of a.out file if given one. */
687 if (a_out >= 0) 669 if (a_out >= 0)
688 { 670 {
689#ifdef COFF_ENCAPSULATE
690 if (read (a_out, &coffheader, sizeof coffheader) != sizeof coffheader)
691 {
692 PERROR(a_name);
693 }
694 if (coffheader.f_magic != COFF_MAGIC)
695 {
696 ERROR1("%s doesn't have legal coff magic number\n", a_name);
697 }
698#endif
699 if (read (a_out, &ohdr, sizeof hdr) != sizeof hdr) 671 if (read (a_out, &ohdr, sizeof hdr) != sizeof hdr)
700 { 672 {
701 PERROR (a_name); 673 PERROR (a_name);
@@ -709,18 +681,11 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
709 } 681 }
710 else 682 else
711 { 683 {
712#ifdef COFF_ENCAPSULATE
713 /* We probably could without too much trouble. The code is in gld
714 * but I don't have that much time or incentive.
715 */
716 ERROR0 ("can't build a COFF file from scratch yet");
717#else
718#ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */ 684#ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
719 bzero ((void *)&hdr, sizeof hdr); 685 bzero ((void *)&hdr, sizeof hdr);
720#else 686#else
721 bzero (&hdr, sizeof hdr); 687 bzero (&hdr, sizeof hdr);
722#endif 688#endif
723#endif
724 } 689 }
725 690
726 unexec_text_start = (long) start_of_text (); 691 unexec_text_start = (long) start_of_text ();
@@ -749,32 +714,6 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
749 714
750#endif /* not NO_REMAP */ 715#endif /* not NO_REMAP */
751 716
752#ifdef COFF_ENCAPSULATE
753 /* We are encapsulating BSD format within COFF format. */
754 {
755 struct coffscn *tp, *dp, *bp;
756 tp = &coffheader.scns[0];
757 dp = &coffheader.scns[1];
758 bp = &coffheader.scns[2];
759 tp->s_size = hdr.a_text + sizeof(struct exec);
760 dp->s_paddr = data_start;
761 dp->s_vaddr = data_start;
762 dp->s_size = hdr.a_data;
763 bp->s_paddr = dp->s_vaddr + dp->s_size;
764 bp->s_vaddr = bp->s_paddr;
765 bp->s_size = hdr.a_bss;
766 coffheader.tsize = tp->s_size;
767 coffheader.dsize = dp->s_size;
768 coffheader.bsize = bp->s_size;
769 coffheader.text_start = tp->s_vaddr;
770 coffheader.data_start = dp->s_vaddr;
771 }
772 if (write (new, &coffheader, sizeof coffheader) != sizeof coffheader)
773 {
774 PERROR(new_name);
775 }
776#endif /* COFF_ENCAPSULATE */
777
778 if (write (new, &hdr, sizeof hdr) != sizeof hdr) 717 if (write (new, &hdr, sizeof hdr) != sizeof hdr)
779 { 718 {
780 PERROR (new_name); 719 PERROR (new_name);