add MAINTAINERS files
[binutils-gdb.git] / ld / ld.1
diff --git a/ld/ld.1 b/ld/ld.1
index d2ace47cdc6319753e54a6905ec74056cbf582f4..129d91e81ea2f3992a05249609dc85c685a9b14c 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, 96, 97, 98, 1999 Free Software Foundation
 .\" See section COPYING for conditions for redistribution
 .TH ld 1 "17 August 1992" "cygnus support" "GNU Development Tools"
 .de BP
@@ -33,21 +33,34 @@ ld \- the GNU linker
 .RB "[\|" "\-c\ "\c
 .I commandfile\c
 \&\|] 
+.RB "[\|" \-\-cref "\|]"
 .RB "[\|" \-d | \-dc | \-dp\c
 \|]
 .br
 .RB "[\|" "\-defsym\ "\c
 .I symbol\c
-\& = \c
+\&=\c
 .I expression\c
 \&\|]
+.RB "[\|" \-\-demangle "\|]"
+.RB "[\|" \-\-no\-demangle "\|]"
 .RB "[\|" "\-e\ "\c
 .I entry\c
 \&\|] 
 .RB "[\|" \-embedded\-relocs "\|]"
-.RB "[\|" \-F "\|]" 
+.RB "[\|" \-E "\|]" 
+.RB "[\|" \-export\-dynamic "\|]"
+.RB "[\|" "\-f\ "\c
+.I name\c
+\&\|]
+.RB "[\|" "\-\-auxiliary\ "\c
+.I name\c
+\&\|]
 .RB "[\|" "\-F\ "\c
-.I format\c
+.I name\c
+\&\|]
+.RB "[\|" "\-\-filter\ "\c
+.I name\c
 \&\|]
 .RB "[\|" "\-format\ "\c
 .I input-format\c
@@ -56,6 +69,12 @@ ld \- the GNU linker
 .RB "[\|" \-G
 .I size\c
 \&\|]
+.RB "[\|" "\-h\ "\c
+.I name\c
+\&\|]
+.RB "[\|" "\-soname\ "\c
+.I name\c
+\&\|]
 .RB "[\|" \-\-help "\|]"
 .RB "[\|" \-i "\|]"
 .RB "[\|" \-l\c
@@ -74,6 +93,10 @@ ld \- the GNU linker
 .RB "[\|" \-n | \-N "\|]" 
 .RB "[\|" \-noinhibit-exec "\|]" 
 .RB "[\|" \-no\-keep\-memory "\|]" 
+.RB "[\|" \-no\-warn\-mismatch "\|]" 
+.RB "[\|" \-O\c
+.I level\c
+\&\|]
 .RB "[\|" "\-oformat\ "\c
 .I output-format\c
 \&\|] 
@@ -99,6 +122,11 @@ ld \- the GNU linker
 .RB "[\|" "\-T\ "\c
 .I commandfile\c
 \&\|]  
+.RB "[\|" "\-\-section\-start\ "\c
+.I sectionname\c
+\&=\c
+.I sectionorg\c
+\&\|]
 .RB "[\|" "\-Ttext\ "\c
 .I textorg\c
 \&\|] 
@@ -118,8 +146,14 @@ ld \- the GNU linker
 .RB "[\|" \-\-version "\|]"
 .RB "[\|" \-warn\-common "\|]" 
 .RB "[\|" \-warn\-constructors "\|]" 
+.RB "[\|" \-warn\-multiple\-gp "\|]" 
 .RB "[\|" \-warn\-once "\|]" 
+.RB "[\|" \-warn\-section\-align "\|]" 
 .RB "[\|" \-\-whole\-archive "\|]" 
+.RB "[\|" \-\-no\-whole\-archive "\|]" 
+.RB "[\|" "\-\-wrap\ "\c
+.I symbol\c
+\&\|]
 .RB "[\|" \-X "\|]" 
 .RB "[\|" \-x "\|]" 
 .ad b
@@ -224,8 +258,9 @@ The exceptions\(em\&which may meaningfully be used more than once\(em\&are
 .B \-format\c
 \&), \c
 .B \-defsym\c
-\&,
-\c
+\&, \c
+.B \-\-section\-start\c
+\&, \c
 .B \-L\c
 \&, \c
 .B \-l\c
@@ -401,6 +436,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
@@ -419,7 +460,7 @@ specified (\c
 \& has the same effect.
 
 .TP
-.BI "-defsym " "symbol" "\fR = \fP" expression
+.BI "-defsym " "symbol" "\fR=\fP" expression
 Create a global symbol in the output file, containing the absolute
 address given by \c
 .I expression\c
@@ -437,13 +478,30 @@ symbol, or use \c
 constants or symbols.  If you need more elaborate expressions, consider
 using the linker command language from a script.
 
+.TP
+.B \-\-demangle
+.TP
+.B \-\-no\-demangle
+These options control whether to demangle symbol names in error
+messages and other output.  When the linker is told to demangle, it
+tries to present symbol names in a readable fashion: it strips leading
+underscores if they are used by the object file format, and converts
+C++ mangled symbol names into user readable names.  The linker will
+demangle by default unless the environment variable
+.B COLLECT_NO_DEMANGLE
+is set.  These options may be used to override the default.
+
 .TP
 .BI "-e " "entry"\c
 \& 
 Use \c
 .I entry\c
 \& as the explicit symbol for beginning execution of your
-program, rather than the default entry point.  for a
+program, rather than the default entry point.  See the `\|\c
+.B ld\c
+\|' entry in `\|\c
+.B info\c
+\|' for a
 discussion of defaults and other ways of specifying the
 entry point.
 
@@ -458,28 +516,33 @@ was statically initialized to pointer values.  See the code in
 testsuite/ld-empic for details.
 
 .TP
-.B \-F
+.B \-E
 .TP
-.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
-.B ld\c
-\&'s mechanisms (the \c
-.B \-b\c
-\& or \c
-.B \-format\c
-\& options
-for input files, the \c
-.B TARGET\c
-\& command in linker scripts for output
-files, the \c
-.B GNUTARGET\c
-\& environment variable) are more flexible, but
-but it accepts (and ignores) the \c
-.B \-F\c
-\& option flag for compatibility
-with scripts written to call the old linker.
+.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
+.BI "-f " "name"
+.TP
+.BI "--auxiliary " "name"
+When creating an ELF shared object, set the internal DT_AUXILIARY field
+to the specified name.  This tells the dynamic linker that the symbol
+table of the shared object should be used as an auxiliary filter on the
+symbol table of the shared object
+.I name.
+
+.TP
+.BI "-F " "name"
+.TP
+.BI "--filter " "name"
+When creating an ELF shared object, set the internal DT_FILTER field to
+the specified name.  This tells the dynamic linker that the symbol table
+of the shared object should be used as a filter on the symbol table of
+the shared object
+.I name.
 
 .TP
 .BI "\-format " "input\-format"
@@ -500,6 +563,16 @@ to
 .I size
 under MIPS ECOFF.  Ignored for other object file formats.
 
+.TP
+.BI "-h " "name"
+.TP
+.BI "-soname " "name"
+When creating an ELF shared object, set the internal DT_SONAME field to
+the specified name.  When an executable is linked with a shared object
+which has a DT_SONAME field, then when the executable is run the dynamic
+linker will attempt to load the shared object specified by the DT_SONAME
+field rather than the using the file name given to the linker.
+
 .TP
 .B \-\-help
 Print a summary of the command-line options on the standard output and exit.
@@ -621,6 +694,16 @@ linker to instead optimize for memory usage, by rereading the symbol
 tables as necessary.  This may be required if the linker runs out of
 memory space while linking a large executable.
 
+.TP
+.B \-no\-warn\-mismatch
+Normally the linker will give an error if you try to link together
+input files that are mismatched for some reason, perhaps because they
+have been compiled for different processors or for different
+endiannesses.  This option tells the linker that it should silently
+permit such possible errors.  This option should only be used with
+care, in cases when you have taken some special action that ensures
+that the linker errors are inappropriate.
+
 .TP
 .BI "\-o " "output"
 .I output\c
@@ -634,6 +717,16 @@ script command \c
 .B OUTPUT\c
 \& can also specify the output file name.
 
+.TP
+.BI "\-O" "level"
+Generate optimized output files.  This might use significantly more
+time and therefore probably should be enabled only for generating the
+final binary.
+\c
+.I level\c
+\& is supposed to be a numeric value.  Any value greater than zero enables
+the optimizations.
+
 .TP
 .BI "\-oformat " "output\-format"
 Specify the binary format for the output object file.
@@ -709,16 +802,22 @@ 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.
+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
+will form a runtime search path 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
+option is used, the runtime search path will be formed exclusively
+using the
 .B \-rpath
 options, ignoring
 the
@@ -729,8 +828,8 @@ options which may be on NFS mounted filesystems.
 
 .TP
 .B \-rpath\-link\ \fIdirectory
-When using ELF, one shared library may require another.  This happens
-when an
+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.
 
@@ -757,8 +856,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
@@ -792,6 +895,20 @@ Similar to
 .B \-split\-by\-reloc
 but creates a new output section for each input file.
 
+.TP
+.BI "--section-start " "sectionname" "\fR=\fP"org
+Locate a section in the output file at the absolute
+address given by \c
+.I org\c
+\&.  \c
+\c
+.I org\c
+\& must be a hexadecimal integer.
+You may use this option as many
+times as necessary to locate multiple sections in the command
+line.  If you need more elaborate expressions, consider
+using the linker command language from a script.
+
 .TP
 .BI "\-Tbss " "org"\c
 .TP
@@ -809,7 +926,7 @@ Use \c
 .B text\c
 \& segment of the output file.
 \c
-.I textorg\c
+.I org\c
 \& must be a hexadecimal integer.
 
 .TP
@@ -888,18 +1005,51 @@ 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
 which refers to it.
 
 .TP
+.B \-warn\-section\-align
+Warn if the address of an output section is changed because of
+alignment.  Typically, the alignment will be set by an input section.
+The address will only be changed if it not explicitly specified; that
+is, if the SECTIONS command does not specify a start address for the
+section.
+
+.TP
+.B \-\-whole\-archive
+For each archive mentioned on the command line after the
 .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.
+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 
@@ -967,7 +1117,7 @@ The GNU Binary Utilities\c
 , Roland H. Pesch.
 
 .SH COPYING
-Copyright (c) 1991, 1992 Free Software Foundation, Inc.
+Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
 .PP
 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice