HPUX crt0.o[3]






 crt0(3)                                                             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 files 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 links 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.

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

 DEPENDENCIES
    Series 300/400
      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
      refers to __argc_value as ___argc_value.

      Series 300/400 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



 Hewlett-Packard Company            - 1 -     HP-UX Release 9.0: August 1992






 crt0(3)                                                             crt0(3)





                               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 700/800
      All compilers on Series 700 and 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 700 and 800 start-up 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 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.

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



 Hewlett-Packard Company            - 2 -     HP-UX Release 9.0: August 1992






 crt0(3)                                                             crt0(3)





 SEE ALSO
      cc(1), f77(1), ld(1), pc(1), prof(1), gprof(1), pc(1), profil(2),
      exec(2), is_hw_present(3C), monitor(3C).



















































 Hewlett-Packard Company            - 3 -     HP-UX Release 9.0: August 1992