


      LLLLDDDD((((1111))))                       ((((bbbbssssdddd 4444....2222))))                       LLLLDDDD((((1111))))



      NNNNAAAAMMMMEEEE
           ld - link editor

      SSSSYYYYNNNNTTTTAAAAXXXX
           lllldddd [ option ] ... file ...

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           _L_d combines several object programs into one, resolves
           external references, and searches libraries.  In the
           simplest case, several object _f_i_l_e_s are given, and _l_d
           combines them into an executable object module called aaaa....oooouuuutttt.
           If no errors occur during the load, the execute permission
           for aaaa....oooouuuutttt is set.

           The argument routines are concatenated in the order
           specified.  The entry point of the output is the beginning
           of the first routine (unless the ----eeee option is specified).

           If any argument is a library, it is searched exactly once at
           the point it is encountered in the argument list.  Only
           those routines defining an unresolved external reference are
           loaded.  If a routine from a library references another
           routine in the library, and the library has not been
           processed by _r_a_n_l_i_b(1), the referenced routine must appear
           after the referencing routine in the library.  Thus the
           order of programs within libraries may be important.  The
           first member of a library should be a file named
           `__.SYMDEF', which is understood to be a dictionary for the
           library as produced by _r_a_n_l_i_b(1); the dictionary is searched
           iteratively to satisfy as many references as possible.

           The symbols `_etext', `_edata' and `_end' (`etext', `edata'
           and `end' in C) are reserved, and if referred to, are set to
           the first location above the program, the first location
           above initialized data, and the first location above all
           data respectively.  Do not define these symbols.

           _L_d understands several options.  Except for ----llll, they should
           appear before the file names.

           ----AAAA   This option specifies incremental loading, i.e.
                linking is to be done in a manner so that the resulting
                object may be read into an already executing program.
                The next argument is the name of a file whose symbol
                table will be taken as a basis on which to define
                additional symbols.  Only newly linked material will be
                entered into the text and data portions of aaaa....oooouuuutttt,,,, but
                the new symbol table will reflect every symbol defined
                before and after the incremental load.  This argument
                must appear before any other object file in the
                argument list.  The ----TTTT option may be used as well, and
                will be taken to mean that the newly linked segment



      Page 1                                                   (9010-E)






      LLLLDDDD((((1111))))                       ((((bbbbssssdddd 4444....2222))))                       LLLLDDDD((((1111))))



                will commence at the corresponding address (which must
                be a multiple of 4096).  The default value is the old
                value of _end.

           ----CCCC   Produce an executable file with  shared code and data.
                The data segment is put at the first page boundary past
                the end of the code segment.  The output file is given
                the magic number 9B01, which signals exec(2) (or
                spawn(2)) to cause the code and data segments to be
                mapped to the same address space.

           ----DDDD_d_o_r_g
                Set the data segment origin to _d_o_r_g, which is
                hexadecimal.  The default origin is 0.

           ----dddd   Force definition of common storage even if the ----rrrr flag
                is present.

           ----eeee   The following argument is taken to be the name of the
                entry point of the loaded program; location 0 is the
                default.

           ----llll_x  This option is an abbreviation for the library name
                `/lib/lib_x.a', where _x is a string.  If that does not
                exist, _l_d tries `/usr/lib/lib_x.a' A library is searched
                when its name is encountered, so the placement of a ----llll
                is significant.

           ----MMMM   produce a primitive load map, listing the names of the
                files which will be loaded.

           ----mmmm mmmmaaaappppffffiiiilllleeee
                create a load map called _m_a_p_f_i_l_e (as described in
                map(1)).

           ----NNNN   Do not make the text portion read only or sharable.
                (Use "magic number" 0407.)

           ----oooo   The _n_a_m_e argument after ----oooo is used as the name of the
                _l_d output file, instead of aaaa....oooouuuutttt.

           ----rrrr   Generate relocation bits in the output file so that it
                can be the subject of another _l_d run.  This flag also
                prevents final definitions from being given to common
                symbols, and suppresses the `undefined symbol'
                diagnostics.

           ----SSSS   `Strip' the output by removing all symbols except
                locals and globals.

           ----ssss   Strip the output of the symbol table and relocation
                bits to save space (but impair the usefulness of the



      Page 2                                                   (9010-E)






      LLLLDDDD((((1111))))                       ((((bbbbssssdddd 4444....2222))))                       LLLLDDDD((((1111))))



                debuggers).  This information can be removed with
                _s_t_r_i_p(1).

           ----TTTT   The next argument is a hexadecimal number which sets
                the text segment origin.  The default origin is the
                size of the aaaa....oooouuuutttt header (see aaaa....oooouuuutttt(4)).

           ----tttt   ("trace")  Print the name of each file as it is
                processed.

           ----uuuu   Take the following argument as a symbol and enter it as
                undefined in the symbol table.  This is useful for
                loading wholly from a library, since initially the
                symbol table is empty and an unresolved reference is
                needed to force the loading of the first routine.

           ----VVVV_h_e_x_a_r_g
                Set the a_version field of the header to _h_e_x_a_r_g, which
                is hexadecimal.

           ----WWWW_h_e_x_a_r_g
                Set the a_type field of the header to _h_e_x_a_r_g, which is
                hexadecimal.

           ----XXXX   Save local symbols except for those whose names begin
                with `L'.  This option is used by _c_c(1) to discard
                internally-generated labels while retaining symbols
                local to routines.

           ----xxxx   Do not preserve local (non-global) symbols in the
                output symbol table; only enter external symbols.  This
                option saves some space in the output file.

           ----yyyy_s_y_m
                Indicate each file in which _s_y_m appears, its type and
                whether the file defines or references it.  Many such
                options may be given to trace many symbols.  (It is
                usually necessary to begin _s_y_m with an `_' because
                external C and FORTRAN variables begin with
                underscores.)

      FFFFIIIILLLLEEEESSSS
           /lib/lib*.a            libraries
           /usr/lib/lib*.a        more libraries
           /usr/local/lib/lib*.a  still more libraries
           a.out                  output file

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           as(1), ar(1), cc(1), ranlib(1), map(1)

      BBBBUUUUGGGGSSSS
           There is no way to force data to be page-aligned.



      Page 3                                                   (9010-E)






      LLLLDDDD((((1111))))                       ((((bbbbssssdddd 4444....2222))))                       LLLLDDDD((((1111))))























































      Page 4                                                   (9010-E)






