01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

LD ( 1 ) LD (1)<br />

NAME<br />

ld - link editor for common object files<br />

SYNOPSIS<br />

ld [-e epsym] [-f fill] [-lx] [-m] [-o outfile] [-r] [-s] [-t]<br />

[-u sysname] [-x] [-Z] [-L dir] [-M] [-N] [-n] [-z] [-F]<br />

[-V] [-VS num] [-G] [-w] file-names<br />

DESCRIPTION<br />

The ld command combines several object files into one, performs<br />

relocation, resolves external symbols, and supports symbol table<br />

information for symbolic debugging. In the simplest case, the<br />

names of several object programs are given, and ld combines them,<br />

producing an object module that can either be executed or used as<br />

input for a subsequent ld run. The output of ld is left in a.out.<br />

This file is executable if no errors occurred during the load. If any<br />

input file, file-name, is not an object file, ld assumes it is either an<br />

ASCII file containing link editor directives or an archive library.<br />

If any argument is a library, it is searched exactly once at the<br />

point it is encountered in the argument list. Only those routines<br />

defining an unresolved external reference are loaded. The library<br />

(archive) symbol table (see ar( 4)) is searched sequentially with as<br />

many passes as are necessary to resolve external references which<br />

can be satisfied by library members. Thus, the ordering of library<br />

members is unimportant.<br />

The following options are recognized by ld.<br />

-e epsym<br />

Set the default entry point address for the output file to<br />

be that of the symbol epsym .<br />

-f fill Set the default fill pattern for "holes" within an output<br />

section as well as initialized bss sections. The argument<br />

fill is a two-byte constant.<br />

-lx Search a library named libx.a where xis up to nine characters.<br />

A library is searched when its name is encountered,<br />

so the placement of a -1 is significant. By default,<br />

libraries are located in /lib and /usr/lib. However, if<br />

the shell variable LIBROOT is set, the value of<br />

LIBROOT is prepended to /lib and /usr/lib before<br />

searching the libraries.<br />

-m Produce a map or listing of the input/output sections on<br />

the standard output.<br />

-o outfile<br />

Produce an output object file by the name outfile . The<br />

name of the default object file is a.out.<br />

-r Retain relocation entries in the output object file. Relocation<br />

entries must be saved if the output file is to become<br />

an input file in a subsequent ld run. The link editor will<br />

not complain about unresolved references, and the output<br />

file will not be executed.<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!