Kill r16/rce/acp stuff.
[deliverable/binutils-gdb.git] / ld / ld.1
diff --git a/ld/ld.1 b/ld/ld.1
index 72ace8f0820c965be48280e1fa418559a509d7bb..ef3633ee5fcdcfe25763478a7c66e600301e6c76 100644 (file)
--- a/ld/ld.1
+++ b/ld/ld.1
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1991, 92, 93, 94, 1995 Free Software Foundation
+.\" Copyright (c) 1991, 92, 93, 94, 95, 1996 Free Software Foundation
 .\" See section COPYING for conditions for redistribution
 .TH ld 1 "17 August 1992" "cygnus support" "GNU Development Tools"
 .de BP
@@ -33,6 +33,7 @@ ld \- the GNU linker
 .RB "[\|" "\-c\ "\c
 .I commandfile\c
 \&\|] 
+.RB "[\|" \-\-cref "\|]"
 .RB "[\|" \-d | \-dc | \-dp\c
 \|]
 .br
@@ -45,6 +46,8 @@ ld \- the GNU linker
 .I entry\c
 \&\|] 
 .RB "[\|" \-embedded\-relocs "\|]"
+.RB "[\|" \-E "\|]" 
+.RB "[\|" \-export\-dynamic "\|]"
 .RB "[\|" \-F "\|]" 
 .RB "[\|" "\-F\ "\c
 .I format\c
@@ -53,7 +56,7 @@ ld \- the GNU linker
 .I input-format\c
 \&\|] 
 .RB "[\|" \-g "\|]" 
-.RB "[\|" \-G\c
+.RB "[\|" \-G
 .I size\c
 \&\|]
 .RB "[\|" \-\-help "\|]"
@@ -65,10 +68,10 @@ ld \- the GNU linker
 .I searchdir\c
 \&\|] 
 .RB "[\|" \-M "\|]" 
-.RB "[\|" \-Map\c
+.RB "[\|" \-Map
 .I mapfile\c
 \&\|] 
-.RB "[\|" \-m\c
+.RB "[\|" \-m
 .I emulation\c
 \&\|] 
 .RB "[\|" \-n | \-N "\|]" 
@@ -82,11 +85,17 @@ ld \- the GNU linker
 \&\|]
 .RB "[\|" \-relax "\|]"
 .RB "[\|" \-r | \-Ur "\|]" 
+.RB "[\|" "\-rpath\ "\c
+.I directory\c
+\&\|]
+.RB "[\|" "\-rpath\-link\ "\c
+.I directory\c
+\&\|]
 .RB "[\|" \-S "\|]" 
 .RB "[\|" \-s "\|]" 
 .RB "[\|" \-shared "\|]" 
 .RB "[\|" \-sort\-common "\|]" 
-.RB "[\|" \-split\-by\-reloc\ "\c
+.RB "[\|" "\-split\-by\-reloc\ "\c
 .I count\c
 \&\|]
 .RB "[\|" \-split\-by\-file "\|]" 
@@ -112,8 +121,13 @@ ld \- the GNU linker
 .RB "[\|" \-\-version "\|]"
 .RB "[\|" \-warn\-common "\|]" 
 .RB "[\|" \-warn\-constructors "\|]" 
+.RB "[\|" \-warn\-multiple\-gp "\|]" 
 .RB "[\|" \-warn\-once "\|]" 
 .RB "[\|" \-\-whole\-archive "\|]" 
+.RB "[\|" \-\-no\-whole\-archive "\|]" 
+.RB "[\|" "\-\-wrap\ "\c
+.I symbol\c
+\&\|]
 .RB "[\|" \-X "\|]" 
 .RB "[\|" \-x "\|]" 
 .ad b
@@ -257,8 +271,7 @@ whitespace, or be given as separate arguments immediately following the
 option that requires them.
 
 .TP
-.BI "-A" "architecture"\c
-\&
+.BI "-A" "architecture"
 In the current release of \c
 .B ld\c
 \&, this option is useful only for the
@@ -314,13 +327,11 @@ You can meaningfully use \c
 \& more than once on a command line, if
 an architecture family allows combination of target architectures; each
 use will add another pair of name variants to search for when \c
-.B \-l\c
-\&
+.B \-l
 specifies a library.
 
 .TP
-.BI "\-b " "input-format"\c
-\&
+.BI "\-b " "input-format"
 Specify the binary format for input object files that follow this option
 on the command line.  You don't usually need to specify this, as
 \c
@@ -376,8 +387,7 @@ definition within the shared library.  This option is only meaningful
 on ELF platforms which support shared libraries.
 
 .TP
-.BI "\-c " "commandfile"\c
-\&
+.BI "\-c " "commandfile"
 Directs \c
 .B ld\c
 \& to read link commands from the file
@@ -399,6 +409,12 @@ line by bracketing it between `\|\c
 .B }\c
 \|' characters.
 
+.TP
+.B \-\-cref
+Output a cross reference table.  If a linker map file is being
+generated, the cross reference table is printed to the map file.
+Otherwise, it is printed on the standard output.
+
 .TP
 .B \-d 
 .TP
@@ -407,8 +423,7 @@ line by bracketing it between `\|\c
 .B \-dp
 These three options are equivalent; multiple forms are supported for
 compatibility with other linkers.  Use any of them to make \c
-.B ld\c
-\&
+.B ld
 assign space to common symbols even if a relocatable output file is
 specified (\c
 .B \-r\c
@@ -418,10 +433,7 @@ specified (\c
 \& has the same effect.
 
 .TP
-.BI "-defsym " "symbol"\c
-\& = \c
-.I expression\c
-\&
+.BI "-defsym " "symbol" "\fR = \fP" expression
 Create a global symbol in the output file, containing the absolute
 address given by \c
 .I expression\c
@@ -459,11 +471,19 @@ create a table which may be used at runtime to relocate any data which
 was statically initialized to pointer values.  See the code in
 testsuite/ld-empic for details.
 
+.TP
+.B \-E
+.TP
+.B \-export\-dynamic
+When creating an ELF file, add all symbols to the dynamic symbol table.
+Normally, the dynamic symbol table contains only symbols which are used
+by a dynamic object.  This option is needed for some uses of
+.I dlopen.
+
 .TP
 .B \-F
 .TP
-.BI "-F" "format"\c
-\&
+.BI "-F" "format"
 Some older linkers used this option throughout a compilation toolchain
 for specifying object-file format for both input and output object
 files.  \c
@@ -485,8 +505,7 @@ but it accepts (and ignores) the \c
 with scripts written to call the old linker.
 
 .TP
-.BI "\-format " "input\-format"\c
-\&
+.BI "\-format " "input\-format"
 Synonym for \c
 .B \-b\c
 \& \c
@@ -533,13 +552,11 @@ path-list for occurrences of \c
 .I ar\c
 \&.a\c
 \& for every \c
-.I ar\c
-\&
+.I ar
 specified.
 
 .TP
-.BI "\-L" "searchdir"\c
-\& 
+.BI "\-L" "searchdir"
 This command adds path \c
 .I searchdir\c
 \& to the list of paths that
@@ -556,8 +573,7 @@ The default set of paths searched (without being specified with
 \& is using, and in
 some cases also on how it was configured.    The
 paths can also be specified in a link script with the \c
-.B SEARCH_DIR\c
-\&
+.B SEARCH_DIR
 command.
 
 .TP
@@ -629,11 +645,7 @@ tables as necessary.  This may be required if the linker runs out of
 memory space while linking a large executable.
 
 .TP
-.BI "\-o " "output"\c
-\&
-.I output\c
-\&
-\c
+.BI "\-o " "output"
 .I output\c
 \& is a name for the program produced by \c
 .B ld\c
@@ -646,8 +658,7 @@ script command \c
 \& can also specify the output file name.
 
 .TP
-.BI "\-oformat " "output\-format"\c
-\&
+.BI "\-oformat " "output\-format"
 Specify the binary format for the output object file.
 You don't usually need to specify this, as
 \c
@@ -662,10 +673,7 @@ The script command
 can also specify the output format, but this option overrides it.
 
 .TP
-.BI "\-R " "filename"\c
-\&
-.I file\c
-\&
+.BI "\-R " "filename"
 Read symbol names and their addresses from \c
 .I filename\c
 \&, but do not
@@ -712,6 +720,62 @@ This option does the same as \c
 .B \-i\c
 \&.
 
+.TP
+.B \-rpath\ \fIdirectory
+Add a directory to the runtime library search path.  This is used when
+linking an ELF executable with shared objects.  All 
+.B \-rpath
+arguments are concatenated and passed to the runtime linker, which uses
+them to locate shared objects at runtime.  The
+.B \-rpath
+option is also used when locating shared objects which are needed by
+shared objects explicitly included in the link; see the description of
+the
+.B \-rpath\-link
+option.  If
+.B \-rpath
+is not used when linking an ELF executable, the contents of the
+environment variable
+.B LD_RUN_PATH
+will be used if it is defined.
+
+The
+.B \-rpath
+option may also be used on SunOS.  By default, on SunOS, the linker
+will form a runtime search patch out of all the
+.B \-L
+options it is given.  If a
+.B \-rpath
+option is used, the runtime search path will be formed exclusively
+using the
+.B \-rpath
+options, ignoring
+the
+.B \-L
+options.  This can be useful when using gcc, which adds many
+.B \-L
+options which may be on NFS mounted filesystems.
+
+.TP
+.B \-rpath\-link\ \fIdirectory
+When using ELF or SunOS, one shared library may require another.  This
+happens when an
+.B ld\ \-shared
+link includes a shared library as one of the input files.
+
+When the linker encounters such a dependency when doing a non-shared,
+non-relocateable link, it will automatically try to locate the required
+shared library and include it in the link, if it is not included
+explicitly.  In such a case, the
+.B \-rpath\-link
+option specifies the first set of directories to search.  The
+.B \-rpath\-link
+option may specify a sequence of directory names either by specifying
+a list of names separated by colons, or by appearing multiple times.
+
+If the required shared library is not found, the linker will issue a
+warning and continue with the link.
+
 .TP
 .B \-S 
 Omits debugger symbol information (but not all symbols) from the output file.
@@ -722,8 +786,12 @@ Omits all symbol information from the output file.
 
 .TP
 .B \-shared
-Create a shared library.  This is currently only supported on ELF
-platforms.
+Create a shared library.  This is currently only supported on ELF and
+SunOS platforms (on SunOS it is not required, as the linker will
+automatically create a shared library when there are undefined symbols
+and the
+.B \-e
+option is not used).
 
 .TP
 .B \-sort\-common
@@ -778,10 +846,7 @@ Use \c
 \& must be a hexadecimal integer.
 
 .TP
-.BI "\-T " "commandfile"\c
-\&
-.TP
-.BI "\-T" "commandfile"\c
+.BI "\-T " "commandfile"
 Equivalent to \c
 .B \-c \c
 .I commandfile\c
@@ -815,9 +880,7 @@ For anything other than C++ programs, this option is equivalent to
 turn serve as input to \c
 .B ld\c
 \&.  When linking C++ programs, \c
-.B \-Ur\c
-\&
-\c
+.B \-Ur
 .I will\c
 \& resolve references to constructors, unlike \c
 .B \-r\c
@@ -858,6 +921,11 @@ Warn if any global constructors are used.  This is only useful for a
 few object file formats.  For formats like COFF or ELF, the linker can
 not detect the use of global constructors.
 
+.TP
+.B \-warn\-multiple\-gp
+Warn if the output file requires multiple global-pointer values.  This
+option is only meaningful for certain processors, such as the Alpha.
+
 .TP
 .B \-warn\-once
 Only warn once for each undefined symbol, rather than once per module
@@ -865,11 +933,31 @@ which refers to it.
 
 .TP
 .B \-\-whole\-archive
-For each archive mentioned on the command line, include every object
-file in the archive in the link, rather than searching the archive for
-the required object files.  This is normally used to turn an archive
-file into a shared library, forcing every object to be included in the
-resulting shared library.
+For each archive mentioned on the command line after the
+.B \-\-whole\-archive
+option, include every object file in the archive in the link, rather
+than searching the archive for the required object files.  This is
+normally used to turn an archive file into a shared library, forcing
+every object to be included in the resulting shared library.
+
+.TP
+.B \-\-no\-whole\-archive
+Turn off the effect of the
+.B \-\-whole\-archive
+option for archives which appear later on the command line.
+
+.TP
+.BI "--wrap " "symbol"
+Use a wrapper function for 
+.I symbol.
+Any undefined reference to
+.I symbol
+will be resolved to
+.BI "__wrap_" "symbol".
+Any undefined reference to
+.BI "__real_" "symbol"
+will be resolved to
+.I symbol.
 
 .TP
 .B \-X 
This page took 0.028414 seconds and 4 git commands to generate.