diff options
| author | John Polstra <jdp@FreeBSD.org> | 1998-09-07 23:32:00 +0000 |
|---|---|---|
| committer | John Polstra <jdp@FreeBSD.org> | 1998-09-07 23:32:00 +0000 |
| commit | 5584f22bb3f6664a71dae0b7a83cc974ca130265 (patch) | |
| tree | 137a82c0e0ab75e721a6bb180779a0c227a579d6 /lib/csu/i386-elf | |
| parent | bbfd14472486ef1ecf6b26d4720da3b1b4dfd7af (diff) | |
Notes
Diffstat (limited to 'lib/csu/i386-elf')
| -rw-r--r-- | lib/csu/i386-elf/Makefile | 6 | ||||
| -rw-r--r-- | lib/csu/i386-elf/crt1.c | 21 |
2 files changed, 25 insertions, 2 deletions
diff --git a/lib/csu/i386-elf/Makefile b/lib/csu/i386-elf/Makefile index a4c72b33d69c..6432efe1d939 100644 --- a/lib/csu/i386-elf/Makefile +++ b/lib/csu/i386-elf/Makefile @@ -1,9 +1,10 @@ # -# $Id: Makefile,v 1.6 1996/04/12 02:24:34 jdp Exp $ +# $Id: Makefile,v 1.1.1.1 1998/03/07 20:27:10 jdp Exp $ # SRCS= crt1.c crtbegin.c crtend.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} +OBJS+= gcrt1.o SOBJS= crtbegin.so crtend.so CFLAGS+= -elf CFLAGS+= -Wall -Wno-unused @@ -15,6 +16,9 @@ INTERNALLIB= true all: ${OBJS} ${SOBJS} +gcrt1.o: crt1.c + ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.CURDIR}/crt1.c + realinstall: .for file in ${OBJS} ${SOBJS} ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ diff --git a/lib/csu/i386-elf/crt1.c b/lib/csu/i386-elf/crt1.c index d89d501b97dc..a30399725f80 100644 --- a/lib/csu/i386-elf/crt1.c +++ b/lib/csu/i386-elf/crt1.c @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: crt1.c,v 1.4 1996/04/12 02:24:35 jdp Exp $ + * $Id: crt1.c,v 1.1.1.1 1998/03/07 20:27:10 jdp Exp $ */ #ifndef __GNUC__ @@ -37,6 +37,13 @@ extern void _fini(void); extern void _init(void); extern int main(int, char **, char **); +#ifdef GCRT +extern void _mcleanup(void); +extern void monstartup(void *, void *); +extern int eprol; +extern int etext; +#endif + extern int _DYNAMIC; #pragma weak _DYNAMIC @@ -71,7 +78,19 @@ _start(char *arguments, ...) if(&_DYNAMIC != 0) atexit(rtld_cleanup); +#ifdef GCRT + atexit(_mcleanup); +#endif atexit(_fini); +#ifdef GCRT + monstartup(&eprol, &etext); +#endif _init(); exit( main(argc, argv, env) ); } + +#ifdef GCRT +__asm__(".text"); +__asm__("eprol:"); +__asm__(".previous"); +#endif |
