Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > C


Integrity Systems Only
HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


crt0_ia: crt0.o — execution startup routines for Integrity systems



This manpage describes crt0.o for Integrity systems. For crt0.o on PA-RISC systems, see crt0_pa(3).


The C, aC++, and FORTRAN compilers link in the object file crt0.o for statically-bound programs to provide startup capabilities and environments for program execution. It contains startup code that must be linked using ld to every statically-bound program. In a dynamically linked program (the default method), the crt0.o object file is not used, and all actions normally associated with it are instead done by the dynamic loader dld.so(5).

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.

crt0.o does not define any variables. It, however, sets the following global variables:


A variable of type long containing the number of arguments.


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.


A variable of type long containing the system id value for an executable program.


A variable of type long containing the requested thread local storage size. This variable is initialized with data from the kernel.


A variable of type void * containing load information passed from the kernel.


A variable of type void * whose value equals to the global pointer.

A symbol named __gp is also declared in <machine/sys/uregs.h> as an enumeration constant, and is incompatible with the declaration in <crt0.h>. In order to include both header files, it is necessary to define the macro __UREGS_SKIP__GP before including <machine/sys/uregs.h>. This will force the <machine/sys/uregs.h> header file to omit the conflicting definition of __gp. The enumeration constant __r1 is equivalent to __gp in that context, and may be used instead. See ttrace(2).


The features described in this entry originated from AT&T UNIX System III.




System Tools


invoke the HP-UX aC++ compiler


invoke the HP-UX C compiler


the dynamic loader


execute a file


invoke the HP-UX FORTRAN compiler


invoke the link editor



symbol of the last locations in program

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.