HP-UX Reference (11i v1 00/12) - 3 Library Functions A-M (vol 6)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/!!!intro.3c
________________________________________________________________
___ ___
c
crt0(3) crt0(3)
NAME
crt0.o, gcrt0.o, mcrt0.o - execution startup routines (PA64 ELF uses crt0.o only)
DESCRIPTION
PA32 SOM
The C, Pascal, and FORTRAN compilers link in the object files crt0.o, gcrt0.o,or mcrt0.o to pro-
vide startup capabilities and environments 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.
The following symbols are defined in these object files:
_environ An array of character pointers to the environment in which the program will
run. This array is terminated by a null pointer.
_FPU_MODEL A variable of type short containing the FPU model number returned by the FP
status instruction. This variable is initializedwith data from the kernel.
_FPU_REVISION A variable of type short containing the FPU revision number returned by the FP
status instruction. This variable is initializedwith data from the kernel.
_CPU_KEYBITS_1
A variable of type int containing CPU specific information. This variable is ini-
tialized with data from the kernel.
_CPU_REVISION A variable of type int containing the CPU revision of the machine. This variable
is initializedwith data from the kernel.
_SYSTEM_ID A variable of type int containing the system id value for an executable program.
$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 begin-
ning of the outer block (main program) and is generated by the compilers.
$global$ The initial address of the program’s data pointer. 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.
The linker defines the following two symbols:
_ _text_start The beginning address of the program’s text area.
_ _data_start The beginning address of the program’s data area.
PA64 ELF
The C, Pascal, and FORTRAN compilers link in the object file
crt0.o to provide startup capabilities and
environments for program execution. It contains startup code that must be linked using ld(1) to every
-
noshared
PA64 program. In a -dynamic program, the crt0.o object file is not used, and all actions
normally associated with it are instead done by the dynamic loader dld(1). Additional functionality for
prof(1) and gprof(1) profiling support is no longer handled by crt0.o.
In PA64, crt0.o processes initializers and terminators. Initializers are routines that are called before the
program entry point and terminators are routines that are called when the program terminates via the
exit routine. Initializers are invoked in reverse order of the link line so that dependent libraries are ini-
tialized before the libraries that depend on them. Terminators, on the other hand, are invoked in the for-
ward order.
Unlike the SOM version of crt0.o, crt0.o for PA64 ELF does not define any variables. It, however,
sets the following global variables:
Section 3−−100 − 1 − HP-UX Release 11i: December 2000
___
___