CRT0(3)
NAME
crt0.o, gcrt0.o, mcrt0.o, frt0.o, gfrt0.o, mfrt0.o − execution startup routines
DESCRIPTION
The C and Pascal compilers link in crt0.o, gcrt0.o, or mcrt0.o to provide startup capabilities and environment for program execution. All are identical except that gcrt0.o and mcrt0.o provide additional functionality for gprof(1) and prof(1) profiling support respectively. Similarly, the Fortran compiler will link in either frt0.o, gfrt0.o, or mfrt0.o.
The following symbols are defined in these routines:
__argc_value A variable of type int containing the number of arguments.
__argv_value An array of character pointers to the arguments themselves.
_environ An array of character pointers to the environment in which the program will run. This array is terminated by a null pointer.
DEPENDENCIES
Series 300
The symbols above are shown as they are visible from C. To access them from assembly language, add an additional underscore to the beginning of the symbol. For example, an assembly language program will refer to __argc_value as ___argc_value.
Series 300 startup files also define the following symbols which are listed as when used from assembly language. The state of these variables can be determined from C by using other library routines (see is_hw_present(3C)).
flag_68010 A variable of type short. Non-zero if the processor is a 68010; zero if not.
float_soft A variable of type short. Zero if the HP98635 floating-point card is present; non-zero if it is not present.
float_loc A constant defining the location in memory of the HP98635 floating point card.
flag_68881 A variable of type short. Non-zero if the HP68881 floating point coprocessor is present; zero if it is not present.
flag_fpa A variable of type short. Non-zero if the HP98248 floating point card is present; zero if it is not present.
fpa_loc A constant defining the location in memory of the HP98248 floating point card.
Series 800
All compilers on the Series 800 use the crt0.o , gcrt0.o, or mcrt0.o file; the files frt0.o, gfrt0.o, and mfrt0.o do not exist.
The Series 800 startup files also define the following additional symbols:
$START$ Execution start address.
_start A secondary startup routine for C programs, called from $START$, which in turn calls main. This routine is contained in the C library rather than the crt0.o file. For Pascal and FORTRAN programs, this symbol labels the beginning of the outer block (main program) and is generated by the compilers.
$global$ The beginning address of the program’s data area. The startup code loads this address into general register 27.
$UNWIND_START The beginning of the stack unwind table.
$UNWIND_END The end of the stack unwind table.
$RECOVER_START
The beginning of the try/recover table.
$RECOVER_END The end of the try/recover table.
The crt0.o file defines a null procedure for _mcount, so programs compiled with profiling can be linked without profiling.
ORIGIN
AT&T System III
SEE ALSO
cc(1), f77(1), ld(1), pc(1), prof(1), gprof(1), pc(1), profil(2), exec(2), monitor(3C), is_hw_present(3C).
Hewlett-Packard Company — HP-UX Release 7.0: Sept 1989