NAME
crt0_pa: crt0.o, gcrt0.o, mcrt0.o — execution startup routines for PA-RISC systems
SYNOPSIS
Remarks
PA-RISC 64-bit ELF uses
crt0.o
only.
This manpage describes
crt0.o
on PA-RISC systems.
For
crt0.o
on Integrity systems, see
crt0_ia(3).
DESCRIPTION
PA-RISC 32-bit SOM
The C, Pascal, and FORTRAN compilers link in the object files
crt0.o,
gcrt0.o,
or
mcrt0.o
to provide 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 initialized
with 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 initialized with
data from the kernel.
- _CPU_KEYBITS_1
A variable of type
int
containing CPU specific information.
This variable is initialized with
data from the kernel.
- _CPU_REVISION
A variable of type
int
containing the CPU revision of the machine.
This variable is initialized
with 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 beginning 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.
PA-RISC 64-bit 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
to every
-noshared
PA-RISC 64-bit 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.sl(5).
Additional functionality for
prof(1)
and
gprof(1)
profiling support is no longer handled by
crt0.o.
In a PA-RISC 64-bit environment,
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 initialized before the libraries that depend on them.
Terminators,
on the other hand, are invoked in the forward order.
Unlike the SOM version of
crt0.o,
crt0.o
for PA-RISC 64-bit ELF does not define any
variables.
It, however, sets the following global variables:
- __argc
A variable of type
long
containing the number of arguments.
- __argv
An array of character pointers to the arguments themselves.
- _environ, __envp
An array of character pointers to the environment in which the
program will run.
This array is terminated by a null pointer.
- _CPU_KEYBITS_1
A variable of type
int
containing CPU specific information.
This variable is initialized with
data from the kernel.
- _FPU_MODEL
A variable of type
long
containing the FPU model number
returned by the FP status instruction.
This variable is initialized
with data from the kernel.
- _FPU_REVISION
A variable of type
long
containing the FPU revision number returned
by the FP status instruction.
This variable is initialized with
data from the kernel.
- _CPU_REVISION
A variable of type
long
containing the CPU revision of the machine.
This variable is initialized
with data from the kernel.
- _SYSTEM_ID
A variable of type
long
containing the system id value for an executable program.
- __tls_size
A variable of type
long
containing the requested thread local storage size.
This variable is initialized with data from the kernel.
- __load_info
A variable of type
void *
containing load information passed from the kernel.
AUTHOR
The features described in this entry originated from
AT&T UNIX
System III.
SEE ALSO
Profiling and Debugging Tools
System Tools
- cc(1)
invoke the HP-UX C compiler
- exec(2)
execute a file
- f77(1)
invoke the HP-UX FORTRAN compiler
- ld(1)
invoke the link editor
- dld.sl(5)
the PA-RISC dynamic loader
- pc(1)
invoke the HP-UX Pascal compiler
Miscellaneous
- end(3C)
symbol of the last locations in program