aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan Nicolaescu2010-04-02 17:06:38 -0700
committerDan Nicolaescu2010-04-02 17:06:38 -0700
commitc435b43224dd85c1c13cc982349a009e6d007d0e (patch)
tree3cec7204e9e49da63dbca2ae24f0837decba644f /src
parent9c13a46e078433f59c6e7e0532c13a1fa3340ec9 (diff)
downloademacs-c435b43224dd85c1c13cc982349a009e6d007d0e.tar.gz
emacs-c435b43224dd85c1c13cc982349a009e6d007d0e.zip
* ecrt0.c: Remove MSDOS, m68k and __sparc__ conditionals, file not
used on those platforms.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/ecrt0.c67
2 files changed, 6 insertions, 66 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 8859a10ad7a..8287e453ba3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12010-04-03 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * ecrt0.c: Remove MSDOS, m68k and __sparc__ conditionals, file not
4 used on those platforms.
5
12010-04-02 Dan Nicolaescu <dann@ics.uci.edu> 62010-04-02 Dan Nicolaescu <dann@ics.uci.edu>
2 7
3 Remove extern errno declarations. 8 Remove extern errno declarations.
diff --git a/src/ecrt0.c b/src/ecrt0.c
index 40549884935..0d7d26d3685 100644
--- a/src/ecrt0.c
+++ b/src/ecrt0.c
@@ -59,9 +59,7 @@ And always:
59 59
60int data_start = 0; 60int data_start = 0;
61 61
62#ifndef MSDOS
63char **environ; 62char **environ;
64#endif
65 63
66#ifndef static 64#ifndef static
67/* On systems where the static storage class is usable, this function 65/* On systems where the static storage class is usable, this function
@@ -100,70 +98,7 @@ start1 (CRT0_DUMMIES argc, xargv)
100 and optimize it out. */ 98 and optimize it out. */
101 (void) &start1; 99 (void) &start1;
102} 100}
103#else /* not CRT0_DUMMIES */ 101#endif /* CRT0_DUMMIES */
104
105/* This is a kludge. Now that the CRT0_DUMMIES mechanism above exists,
106 most of these machines could use the vax code above
107 with some suitable definition of CRT0_DUMMIES.
108 Then the symbol m68k could be flushed.
109 But I don't want to risk breaking these machines
110 in a version 17 patch release, so that change is being put off. */
111
112#ifdef m68k /* Can't do it all from C */
113 asm (" global _start");
114 asm (" text");
115 asm ("_start:");
116 asm (" comm splimit%,4");
117 asm (" global exit");
118 asm (" text");
119 asm (" mov.l %d0,splimit%");
120 asm (" jsr start1");
121 asm (" mov.l %d0,(%sp)");
122 asm (" jsr exit");
123 asm (" mov.l &1,%d0"); /* d0 = 1 => exit */
124 asm (" trap &0");
125
126/* ignore takes care of skipping the a6 value pushed in start. */
127static
128start1 (argc, xargv)
129 int argc;
130 char *xargv;
131{
132 register char **argv = &xargv;
133 environ = argv + argc + 1;
134
135 if ((char *)environ == xargv)
136 environ--;
137 exit (main (argc, argv, environ));
138}
139
140#endif /* m68k */
141
142#endif /* not CRT0_DUMMIES */
143
144#ifdef __sparc__
145asm (".global __start");
146asm (".text");
147asm ("__start:");
148asm (" mov 0, %fp");
149asm (" ld [%sp + 64], %o0");
150asm (" add %sp, 68, %o1");
151asm (" sll %o0, 2, %o2");
152asm (" add %o2, 4, %o2");
153asm (" add %o1, %o2, %o2");
154asm (" sethi %hi(_environ), %o3");
155asm (" st %o2, [%o3+%lo(_environ)]");
156asm (" andn %sp, 7, %sp");
157asm (" call _main");
158asm (" sub %sp, 24, %sp");
159asm (" call __exit");
160asm (" nop");
161
162#endif /* __sparc__ */
163
164#if __FreeBSD__ == 2
165char *__progname;
166#endif
167 102
168/* arch-tag: 4025c2fb-d6b1-4d29-b1b6-8100b6bd1e74 103/* arch-tag: 4025c2fb-d6b1-4d29-b1b6-8100b6bd1e74
169 (do not change this comment) */ 104 (do not change this comment) */