1 /* Copyright (C) 1995,1996 Robert de Bath <rdebath@cix.compulink.co.uk>
2 * This file is part of the Linux-8086 C library and is distributed
3 * under the GNU Library General Public License.
6 #if defined(__AS386_16__) || defined(__AS386_32__)
9 * Change of aim here, to allow easy alteration for generation of COM files
10 * this code has been moved into libc. This means only the linker needs to
11 * to be told to fetch a different libc the crt0 is unaltered.
13 * This also allows us to deal with __FIRST_ARG_IN_AX__ and __CALLER_SAVES__
19 entry startup
! Crt0 startup
23 no_op
: ! Generic no operation call
26 .ascii __LIBC_VER__
! Version id
.
28 loc
1 ! Segment
1 is where the pointers to the autostart
29 ! functions are stored
.
32 .word
0 ! But first some zeros to avoid null pointer writes
.
41 #endif /* __AS386_16__ or __AS386_32__ */
43 #if defined(__GNUC__) && defined(__i386__)
46 __asm__(".globl _start\n_start:");
47 __asm__("jmp __cstartup");
48 __asm__(".globl __no_op\n__no_op:");
52 #error This library is for ELF only, sorry.
53 __asm__(".globl startup\nstartup:");
54 __asm__("jmp ___cstartup");
55 __asm__(".globl no_op\nno_op:");
59 #endif /* defined(__GNUC__) && defined(__i386__) */
62 #error You are not going to get far without crt0.o!