Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ld(M) — Xenix 2.3.4g

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ar(CP)

cc(CP)

ld(CP)

masm(CP)

ranlib(CP)



     LD(M)                    XENIX System V                     LD(M)



     Name
          ld - Invokes the link editor.

     Syntax
          ld [ options ] filename...

     Description
          ld is the XENIX link editor.  It creates an executable
          program by combining one or more object files and copying
          the executable result to the file a.out.  The filename must
          name an object or library file.  These names must have the
          ``.o'' (for object) or ``.a'' (for archive library)
          extensions.  If more than one name is given,  the names must
          be separated by one or more spaces.  If errors occur while
          linking, ld displays an error message; the resulting a.out
          file is unexecutable.

          ld concatenates the contents of the given object files in
          the order given in the command line.  Library files in the
          command line are examined only if there are unresolved
          external references encountered from previous object files.
          Library files must be in ranlib(CP) format, that is, the
          first member must be named __.SYMDEF, which is a dictionary
          for the library.  The library is searched iteratively to
          satisfy as many references as possible and only those
          routines that define unresolved external references are
          concatenated.  Object and library files are processed at the
          point they are encountered in the argument list, so the
          order of files in the command line is important.  In
          general, all object files should be given before library
          files.  ld sets the entry point of the resulting program to
          the beginning of the first routine.

          There are the following options:

          -Fnum
               Sets the size of the program stack to num bytes.
               Default stack size if not given, is either variable
               stack or fixed stack of 2 Kbytes. See the machine(M)
               manual page for the default stack type for your system.

          -i   Creates separate instruction and data spaces for small
               model programs.  When the output file is executed, the
               program text and data areas are allocated separate
               physical segments.  The text portion will be read-only
               and shared by all users executing the file.

          -Ms  Creates a small model program and checks for errors,
               such as fixup overflow.  This option is reserved for
               object files compiled or assembled using the small
               model configuration.  This is the default model if no
               -M option is given.



     Page 1                                           (printed 8/7/87)





     LD(M)                    XENIX System V                     LD(M)



          -Mm  Creates middle model program and checks for errors.
               This option is reserved for object files compiled or
               assembled using the middle model configuration. This
               option implies -i .

          -Ml  Creates a large model program and checks for errors.
               The option is reserved for object files compiled using
               the large model configuration.  This option implies -i
               .

          -o name
               Sets the executable program filename to name instead of
               a.out.

          ld should be invoked using the cc(CP) instead of invoking it
          directly.  Cc invokes ld as the last step of compilation,
          providing all the necessary C-language support routines.
          Invoking ld directly is not recommended since failure to
          give command line arguments in the correct order can result
          in errors.

     Files
          /bin/ld

     See Also
          ar(CP), cc(CP), ld(CP), masm(CP), ranlib(CP)

     Notes
          The user must make sure that the most recent library
          versions have been processed with ranlib(CP) before linking.
          If this is not done, ld cannot create executable programs
          using these libraries.























     Page 2                                           (printed 8/7/87)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026