* emultempl/elf32.em (OPTION_GROUP): New macro.
[deliverable/binutils-gdb.git] / ld / ld.texinfo
index ac639aff65bd934fa28309a41dd1a2afedca2e7b..552d4aa9a463252643896cc087545caa198d7c12 100644 (file)
@@ -1,8 +1,11 @@
 \input texinfo
 @setfilename ld.info
+@c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+@c 2001 Free Software Foundation, Inc.
 @syncodeindex ky cp
 @include configdoc.texi
 @c (configdoc.texi is generated by the Makefile)
+@include ldver.texi
 
 @c @smallbook
 
@@ -15,23 +18,19 @@ END-INFO-DIR-ENTRY
 @end ifinfo
 
 @ifinfo
-This file documents the @sc{gnu} linker LD.
+This file documents the @sc{gnu} linker LD version @value{VERSION}.
 
-Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
 
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
+@ignore
 
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts.  A copy of the license is included in the
+section entitled "GNU Free Documentation License".
 
-@ignore
 Permission is granted to process this file through Tex and print the
 results, provided the printed document carries copying permission
 notice identical to this one except for the removal of this paragraph
@@ -48,16 +47,15 @@ notice identical to this one except for the removal of this paragraph
 @subtitle The GNU linker
 @sp 1
 @subtitle @code{ld} version 2
-@subtitle April 1998
+@subtitle Version @value{VERSION}
 @author Steve Chamberlain
 @author Ian Lance Taylor
-@author Cygnus Solutions
 @page
 
 @tex
 {\parskip=0pt
-\hfill Cygnus Solutions\par
-\hfill ian\@cygnus.com, doc\@cygnus.com\par
+\hfill Red Hat Inc\par
+\hfill nickc\@credhat.com, doc\@redhat.com\par
 \hfill {\it Using LD, the GNU linker}\par
 \hfill Edited by Jeffrey Osier (jeffrey\@cygnus.com)\par
 }
@@ -65,19 +63,15 @@ notice identical to this one except for the removal of this paragraph
 @end tex
 
 @vskip 0pt plus 1filll
-Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
 
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
+      Permission is granted to copy, distribute and/or modify this document
+      under the terms of the GNU Free Documentation License, Version 1.1
+      or any later version published by the Free Software Foundation;
+      with no Invariant Sections, with no Front-Cover Texts, and with no
+      Back-Cover Texts.  A copy of the license is included in the
+      section entitled "GNU Free Documentation License".
 
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
 @end titlepage
 @end iftex
 @c FIXME: Talk about importance of *order* of args, cmds to linker!
@@ -85,7 +79,11 @@ into another language, under the above conditions for modified versions.
 @ifinfo
 @node Top
 @top Using ld
-This file documents the @sc{gnu} linker ld.
+This file documents the @sc{gnu} linker ld version @value{VERSION}.
+
+This document is distributed under the terms of the GNU Free
+Documentation License.  A copy of the license is included in the
+section entitled "GNU Free Documentation License".
 
 @menu
 * Overview::                    Overview
@@ -104,6 +102,9 @@ This file documents the @sc{gnu} linker ld.
 @ifset I960
 * i960::                        ld and the Intel 960 family
 @end ifset
+@ifset TICOFF
+* TI COFF::                     ld and the TI COFF
+@end ifset
 @end ifclear
 @ifclear SingleFormat
 * BFD::                         BFD
@@ -112,6 +113,7 @@ This file documents the @sc{gnu} linker ld.
 
 * Reporting Bugs::              Reporting Bugs
 * MRI::                         MRI Compatible Script Files
+* GNU Free Documentation License::  GNU Free Documentation License
 * Index::                       Index
 @end menu
 @end ifinfo
@@ -178,18 +180,21 @@ result of linking the file @code{/lib/crt0.o} with @code{hello.o} and
 the library @code{libc.a}, which will come from the standard search
 directories.  (See the discussion of the @samp{-l} option below.)
 
-The command-line options to @code{ld} may be specified in any order, and
-may be repeated at will.  Repeating most options with a different
-argument will either have no further effect, or override prior
+Some of the command-line options to @code{ld} may be specified at any
+point in the command line.  However, options which refer to files, such
+as @samp{-l} or @samp{-T}, cause the file to be read at the point at
+which the option appears in the command line, relative to the object
+files and other file options.  Repeating non-file options with a
+different argument will either have no further effect, or override prior
 occurrences (those further to the left on the command line) of that
 option.  Options which may be meaningfully specified more than once are
 noted in the descriptions below.
 
 @cindex object files
-Non-option arguments are objects files which are to be linked together.
-They may follow, precede, or be mixed in with command-line options,
-except that an object file argument may not be placed between an option
-and its argument.
+Non-option arguments are object files or archives which are to be linked
+together.  They may follow, precede, or be mixed in with command-line
+options, except that an object file argument may not be placed between
+an option and its argument.
 
 Usually the linker is invoked with at least one object file, but you can
 specify other forms of binary input files using @samp{-l}, @samp{-R},
@@ -216,13 +221,35 @@ whitespace, or be given as separate arguments immediately following the
 option that requires them.
 
 For options whose names are multiple letters, either one dash or two can
-precede the option name; for example, @samp{--oformat} and
-@samp{--oformat} are equivalent.  Arguments to multiple-letter options
-must either be separated from the option name by an equals sign, or be
-given as separate arguments immediately following the option that
-requires them.  For example, @samp{--oformat srec} and
-@samp{--oformat=srec} are equivalent.  Unique abbreviations of the names
-of multiple-letter options are accepted.
+precede the option name; for example, @samp{-trace-symbol} and
+@samp{--trace-symbol} are equivalent.  Note - there is one exception to
+this rule.  Multiple letter options that start with a lower case 'o' can
+only be preceeded by two dashes.  This is to reduce confusion with the
+@samp{-o} option.  So for example @samp{-omagic} sets the output file
+name to @samp{magic} whereas @samp{--omagic} sets the NMAGIC flag on the
+output.
+
+Arguments to multiple-letter options must either be separated from the
+option name by an equals sign, or be given as separate arguments
+immediately following the option that requires them.  For example,
+@samp{--trace-symbol foo} and @samp{--trace-symbol=foo} are equivalent.
+Unique abbreviations of the names of multiple-letter options are
+accepted.
+
+Note - if the linker is being invoked indirectly, via a compiler driver
+(eg @samp{gcc}) then all the linker command line options should be
+prefixed by @samp{-Wl,} (or whatever is appropriate for the particular
+compiler driver) like this:
+
+@smallexample
+  gcc -Wl,--startgroup foo.o bar.o -Wl,--endgroup
+@end smallexample
+
+This is important, because otherwise the compiler driver program may
+silently drop the linker options, resulting in a bad link.
+
+Here is a table of the generic command line switches accepted by the GNU
+linker:
 
 @table @code
 @kindex -a@var{keyword}
@@ -274,7 +301,7 @@ You may want to use this option if you are linking files with an unusual
 binary format.  You can also use @samp{-b} to switch formats explicitly (when
 linking object files of different formats), by including
 @samp{-b @var{input-format}} before each group of object files in a
-particular format.  
+particular format.
 
 The default format is taken from the environment variable
 @code{GNUTARGET}.
@@ -302,7 +329,7 @@ specified by any @samp{-L} options.
 @kindex -d
 @kindex -dc
 @kindex -dp
-@item -d 
+@item -d
 @itemx -dc
 @itemx -dp
 These three options are equivalent; multiple forms are supported for
@@ -314,12 +341,15 @@ script command @code{FORCE_COMMON_ALLOCATION} has the same effect.
 @cindex entry point, from command line
 @kindex -e @var{entry}
 @kindex --entry=@var{entry}
-@item -e @var{entry} 
+@item -e @var{entry}
 @itemx --entry=@var{entry}
 Use @var{entry} as the explicit symbol for beginning execution of your
-program, rather than the default entry point. @xref{Entry Point}, for a
-discussion of defaults and other ways of specifying the
-entry point.
+program, rather than the default entry point.  If there is no symbol
+named @var{entry}, the linker will try to parse @var{entry} as a number,
+and use that as the entry address (the number will be interpreted in
+base 10; you may use a leading @samp{0x} for base 16, or a leading
+@samp{0} for base 8).  @xref{Entry Point}, for a discussion of defaults
+and other ways of specifying the entry point.
 
 @cindex dynamic symbol table
 @kindex -E
@@ -339,6 +369,17 @@ back to the symbols defined by the program, rather than some other
 dynamic object, then you will probably need to use this option when
 linking the program itself.
 
+@cindex big-endian objects
+@cindex endianness
+@kindex -EB
+@item -EB
+Link big-endian objects.  This affects the default output format.
+
+@cindex little-endian objects
+@kindex -EL
+@item -EL
+Link little-endian objects.  This affects the default output format.
+
 @kindex -f
 @kindex --auxiliary
 @item -f
@@ -386,16 +427,13 @@ purpose: the @code{-b}, @code{--format}, @code{--oformat} options, the
 environment variable.  The @sc{gnu} linker will ignore the @code{-F}
 option when not creating an ELF shared object.
 
-@kindex --force-exe-suffix
-@item  --force-exe-suffix
-Make sure that an output file has a .exe suffix.
-
-If a successfully built fully linked output file does not have a
-@code{.exe} or @code{.dll} suffix, this option forces the linker to copy
-the output file to one of the same name with a @code{.exe} suffix. This
-option is useful when using unmodified Unix makefiles on a Microsoft
-Windows host, since some versions of Windows won't run an image unless
-it ends in a @code{.exe} suffix.
+@cindex finalization function
+@kindex -fini
+@item -fini @var{name}
+When creating an ELF executable or shared object, call NAME when the
+executable or shared object is unloaded, by setting DT_FINI to the
+address of the function.  By default, the linker uses @code{_fini} as
+the function to call.
 
 @kindex -g
 @item -g
@@ -427,6 +465,14 @@ field rather than the using the file name given to the linker.
 @item -i
 Perform an incremental link (same as option @samp{-r}).
 
+@cindex initialization function
+@kindex -init
+@item -init @var{name}
+When creating an ELF executable or shared object, call NAME when the
+executable or shared object is loaded, by setting DT_INIT to the address
+of the function.  By default, the linker uses @code{_init} as the
+function to call.
+
 @cindex archive files, from cmd line
 @kindex -l@var{archive}
 @kindex --library=@var{archive}
@@ -465,7 +511,7 @@ behaviour of the AIX linker.
 @cindex search directory, from cmd line
 @kindex -L@var{dir}
 @kindex --library-path=@var{dir}
-@item -L@var{searchdir} 
+@item -L@var{searchdir}
 @itemx --library-path=@var{searchdir}
 Add path @var{searchdir} to the list of paths that @code{ld} will search
 for archive libraries and @code{ld} control scripts.  You may use this
@@ -521,14 +567,14 @@ which caused the archive member to be brought in.
 @kindex --nmagic
 @item -n
 @itemx --nmagic
-Set the text segment to be read only, and mark the output as
+Turn off page alignment of sections, and mark the output as
 @code{NMAGIC} if possible.
 
 @kindex -N
 @kindex --omagic
 @cindex read/write from cmd line
 @cindex OMAGIC
-@item -N 
+@item -N
 @itemx --omagic
 Set the text and data sections to be readable and writable.  Also, do
 not page-align the data segment.  If the output format supports Unix
@@ -543,6 +589,23 @@ Use @var{output} as the name for the program produced by @code{ld}; if this
 option is not specified, the name @file{a.out} is used by default.  The
 script command @code{OUTPUT} can also specify the output file name.
 
+@kindex -O @var{level}
+@cindex generating optimized output
+@item -O @var{level}
+If @var{level} is a numeric values greater than zero @code{ld} optimizes
+the output.  This might take significantly longer and therefore probably
+should only be enabled for the final binary.
+
+@kindex -q
+@kindex --emit-relocs
+@cindex retain relocations in final executable
+@item -q
+@itemx --emit-relocs
+Leave relocation sections and contents in fully linked exececutables.
+Post link analysis and optimization tools may need this information in
+order to perform correct modifications of executables.  This results
+in larger executables.
+
 @cindex partial link
 @cindex relocatable output
 @kindex -r
@@ -554,7 +617,7 @@ turn serve as input to @code{ld}.  This is often called @dfn{partial
 linking}.  As a side effect, in environments that support standard Unix
 magic numbers, this option also sets the output file's magic number to
 @code{OMAGIC}.
-@c ; see @code{-N}. 
+@c ; see @code{-N}.
 If this option is not specified, an absolute file is produced.  When
 linking C++ programs, this option @emph{will not} resolve references to
 constructors; to do that, use @samp{-Ur}.
@@ -578,21 +641,21 @@ the @code{-rpath} option.
 @kindex -s
 @kindex --strip-all
 @cindex strip all symbols
-@item -s 
+@item -s
 @itemx --strip-all
 Omit all symbol information from the output file.
 
 @kindex -S
 @kindex --strip-debug
 @cindex strip debugger symbols
-@item -S 
+@item -S
 @itemx --strip-debug
 Omit debugger symbol information (but not all symbols) from the output file.
 
 @kindex -t
 @kindex --trace
 @cindex input files, displaying
-@item -t 
+@item -t
 @itemx --trace
 Print the names of the input files as @code{ld} processes them.
 
@@ -616,12 +679,33 @@ options.  Multiple @samp{-T} options accumulate.
 @cindex undefined symbol
 @item -u @var{symbol}
 @itemx --undefined=@var{symbol}
-Force @var{symbol} to be entered in the output file as an undefined symbol.
-Doing this may, for example, trigger linking of additional modules from
-standard libraries.  @samp{-u} may be repeated with different option
-arguments to enter additional undefined symbols.
-@c Nice idea, but no such command: This option is equivalent
-@c to the @code{EXTERN} linker command.
+Force @var{symbol} to be entered in the output file as an undefined
+symbol.  Doing this may, for example, trigger linking of additional
+modules from standard libraries.  @samp{-u} may be repeated with
+different option arguments to enter additional undefined symbols.  This
+option is equivalent to the @code{EXTERN} linker script command.
+
+@kindex -Ur
+@cindex constructors
+@item -Ur
+For anything other than C++ programs, this option is equivalent to
+@samp{-r}: it generates relocatable output---i.e., an output file that can in
+turn serve as input to @code{ld}.  When linking C++ programs, @samp{-Ur}
+@emph{does} resolve references to constructors, unlike @samp{-r}.
+It does not work to use @samp{-Ur} on files that were themselves linked
+with @samp{-Ur}; once the constructor table has been built, it cannot
+be added to.  Use @samp{-Ur} only for the last partial link, and
+@samp{-r} for the others.
+
+@kindex --unique[=@var{SECTION}]
+@item --unique[=@var{SECTION}]
+Creates a separate output section for every input section matching
+@var{SECTION}, or if the optional wildcard @var{SECTION} argument is
+missing, for every orphan input section.  An orphan section is one not
+specifically mentioned in a linker script.  You may use this option
+multiple times on the command line;  It prevents the normal merging of
+input sections with the same name, overriding output section assignments
+in a linker script.
 
 @kindex -v
 @kindex -V
@@ -644,7 +728,7 @@ Delete all local symbols.
 @kindex --discard-locals
 @cindex local symbols, deleting
 @cindex L, deleting symbols beginning
-@item -X 
+@item -X
 @itemx --discard-locals
 Delete all temporary local symbols.  For most targets, this is all local
 symbols whose names begin with @samp{L}.
@@ -668,7 +752,22 @@ for Solaris compatibility.
 
 @kindex -z @var{keyword}
 @item -z @var{keyword}
-This option is ignored for Solaris compatibility.
+The recognized keywords are @code{initfirst}, @code{interpose},
+@code{loadfltr}, @code{nodefaultlib}, @code{nodelete}, @code{nodlopen},
+@code{nodump}, @code{now} and @code{origin}. The other keywords are
+ignored for Solaris compatibility. @code{initfirst} marks the object
+to be initialized first at runtime before any other objects.
+@code{interpose} marks the object that its symbol table interposes
+before all symbols but the primary executable. @code{loadfltr} marks
+the object that its filtees be processed immediately at runtime.
+@code{nodefaultlib} marks the object that the search for dependencies
+of this object will ignore any default library search paths.
+@code{nodelete} marks the object shouldn't be unloaded at runtime.
+@code{nodlopen} marks the object not available to @code{dlopen}.
+@code{nodump} marks the object can not be dumped by @code{dldump}.
+@code{now} marks the object with the non-lazy runtime binding.
+@code{origin} marks the object may contain $ORIGIN.
+@code{defs} disallows undefined symbols.
 
 @kindex -(
 @cindex groups of archives
@@ -707,11 +806,19 @@ for compatibility with various systems.  You may use this option
 multiple times on the command line: it affects library searching for
 @code{-l} options which follow it.
 
+@kindex -Bgroup
+@item -Bgroup
+Set the @code{DF_1_GROUP} flag in the @code{DT_FLAGS_1} entry in the dynamic
+section.  This causes the runtime linker to handle lookups in this
+object and its dependencies to be performed only inside the group.
+@code{--no-undefined} is implied.  This option is only meaningful on ELF
+platforms which support shared libraries.
+
 @kindex -Bstatic
 @kindex -dn
 @kindex -non_shared
 @kindex -static
-@item -Bstatic 
+@item -Bstatic
 @itemx -dn
 @itemx -non_shared
 @itemx -static
@@ -729,6 +836,17 @@ for a program linked against a shared library to override the definition
 within the shared library.  This option is only meaningful on ELF
 platforms which support shared libraries.
 
+@kindex --check-sections
+@kindex --no-check-sections
+@item --check-sections
+@itemx --no-check-sections
+Asks the linker @emph{not} to check section addresses after they have
+been assigned to see if there any overlaps.  Normally the linker will
+perform this check, and if it finds any overlaps it will produce
+suitable error messages.  The linker does know about, and does make
+allowances for sections in overlays.  The default behaviour can be
+restored by using the command line switch @samp{--check-sections}.
+
 @cindex cross reference table
 @kindex --cref
 @item --cref
@@ -757,6 +875,21 @@ Assignment: Symbol Definitions}).  @emph{Note:} there should be no white
 space between @var{symbol}, the equals sign (``@key{=}''), and
 @var{expression}.
 
+@cindex demangling, from command line
+@kindex --demangle[=@var{style}]
+@kindex --no-demangle
+@item --demangle[=@var{style}]
+@itemx --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.  Different compilers have
+different mangling styles.  The optional demangling style argument can be used
+to choose an appropriate demangling style for your compiler.  The linker will
+demangle by default unless the environment variable @samp{COLLECT_NO_DEMANGLE}
+is set.  These options may be used to override the default.
+
 @cindex dynamic linker, from command line
 @kindex --dynamic-linker @var{file}
 @item --dynamic-linker @var{file}
@@ -765,17 +898,6 @@ generating dynamically linked ELF executables.  The default dynamic
 linker is normally correct; don't use this unless you know what you are
 doing.
 
-@cindex big-endian objects
-@cindex endianness
-@kindex -EB
-@item -EB
-Link big-endian objects.  This affects the default output format.
-
-@cindex little-endian objects
-@kindex -EL
-@item -EL
-Link little-endian objects.  This affects the default output format.
-
 @cindex MIPS embedded PIC code
 @kindex --embedded-relocs
 @item --embedded-relocs
@@ -785,12 +907,38 @@ assembler.  It causes the linker to 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.
 
+@kindex --force-exe-suffix
+@item  --force-exe-suffix
+Make sure that an output file has a .exe suffix.
+
+If a successfully built fully linked output file does not have a
+@code{.exe} or @code{.dll} suffix, this option forces the linker to copy
+the output file to one of the same name with a @code{.exe} suffix. This
+option is useful when using unmodified Unix makefiles on a Microsoft
+Windows host, since some versions of Windows won't run an image unless
+it ends in a @code{.exe} suffix.
+
+@kindex --gc-sections
+@kindex --no-gc-sections
+@cindex garbage collection
+@item --no-gc-sections
+@itemx --gc-sections
+Enable garbage collection of unused input sections.  It is ignored on
+targets that do not support this option.  This option is not compatible
+with @samp{-r}, nor should it be used with dynamic linking.  The default
+behaviour (of not performing this garbage collection) can be restored by
+specifying @samp{--no-gc-sections} on the command line.
+
 @cindex help
 @cindex usage
 @kindex --help
 @item --help
 Print a summary of the command-line options on the standard output and exit.
 
+@kindex --target-help
+@item --target-help
+Print a summary of all target specific options on the standard output and exit.
+
 @kindex -Map
 @item -Map @var{mapfile}
 Print a link map to the file @var{mapfile}.  See the description of the
@@ -805,6 +953,27 @@ instead optimize for memory usage, by rereading the symbol tables as
 necessary.  This may be required if @code{ld} runs out of memory space
 while linking a large executable.
 
+@kindex --no-undefined
+@kindex -z defs
+@item --no-undefined
+@itemx -z defs
+Normally when creating a non-symbolic shared library, undefined symbols
+are allowed and left to be resolved by the runtime loader.  These options
+disallows such undefined symbols.
+
+@kindex --allow-shlib-undefined
+@item --allow-shlib-undefined
+Allow undefined symbols in shared objects even  when --no-undefined is
+set. The net result will be that undefined symbols in regular objects
+will still trigger an error, but undefined symbols in shared objects
+will be ignored.  The implementation of no_undefined makes the
+assumption that the runtime linker will choke on undefined symbols.
+However there is at least one system (BeOS) where undefined symbols in
+shared libraries is normal since the kernel patches them at load time to
+select which function is most appropriate for the current architecture.
+I.E. dynamically select an appropriate memset function.  Apparently it
+is also normal for HPPA shared libraries to have undefined symbols.
+
 @kindex --no-warn-mismatch
 @item --no-warn-mismatch
 Normally @code{ld} will give an error if you try to link together input
@@ -856,7 +1025,7 @@ This option is ignored for SVR4 compatibility.
 @cindex synthesizing linker
 @cindex relaxing addressing modes
 @item --relax
-An option with machine dependent effects.  
+An option with machine dependent effects.
 @ifset GENERIC
 This option is only supported on a few targets.
 @end ifset
@@ -867,11 +1036,19 @@ This option is only supported on a few targets.
 @xref{i960,, @code{ld} and the Intel 960 family}.
 @end ifset
 
+
 On some platforms, the @samp{--relax} option performs global
 optimizations that become possible when the linker resolves addressing
 in the program, such as relaxing address modes and synthesizing new
 instructions in the output object file.
 
+On some platforms these link time global optimizations may make symbolic
+debugging of the resulting executable impossible.
+@ifset GENERIC
+This is known to be
+the case for the Matsushita MN10200 and MN10300 family of processors.
+@end ifset
+
 @ifset GENERIC
 On platforms where this is not supported, @samp{--relax} is accepted,
 but ignored.
@@ -940,6 +1117,11 @@ specifies the first set of directories to search.  The
 either by specifying a list of names separated by colons, or by
 appearing multiple times.
 
+This option should be used with caution as it overrides the search path
+that may have been hard compiled into a shared library. In such a case it
+is possible to use unintentionally a different search path than the
+runtime linker would do.
+
 The linker uses the following search paths to locate required shared
 libraries.
 @enumerate
@@ -950,11 +1132,11 @@ Any directories specified by @code{-rpath} options.  The difference
 between @code{-rpath} and @code{-rpath-link} is that directories
 specified by @code{-rpath} options are included in the executable and
 used at runtime, whereas the @code{-rpath-link} option is only effective
-at link time.
+at link time. It is for the native linker only.
 @item
 On an ELF system, if the @code{-rpath} and @code{rpath-link} options
 were not used, search the contents of the environment variable
-@code{LD_RUN_PATH}.
+@code{LD_RUN_PATH}. It is for the native linker only.
 @item
 On SunOS, if the @code{-rpath} option was not used, search any
 directories specified using @code{-L} options.
@@ -962,6 +1144,11 @@ directories specified using @code{-L} options.
 For a native linker, the contents of the environment variable
 @code{LD_LIBRARY_PATH}.
 @item
+For a native ELF linker, the directories in @code{DT_RUNPATH} or
+@code{DT_RPATH} of a shared library are searched for shared
+libraries needed by it. The @code{DT_RPATH} entries are ignored if
+@code{DT_RUNPATH} entries exist.
+@item
 The default directories, normally @file{/lib} and @file{/usr/lib}.
 @item
 For a native linker on an ELF system, if the file @file{/etc/ld.so.conf}
@@ -991,22 +1178,23 @@ everything else.  This is to prevent gaps between symbols due to
 alignment constraints.
 
 @kindex --split-by-file
-@item --split-by-file
+@item --split-by-file [@var{size}]
 Similar to @code{--split-by-reloc} but creates a new output section for
-each input file.
+each input file when @var{size} is reached.  @var{size} defaults to a
+size of 1 if not given.
 
 @kindex --split-by-reloc
-@item --split-by-reloc @var{count}
-Trys to creates extra sections in the output file so that no single
+@item --split-by-reloc [@var{count}]
+Tries to creates extra sections in the output file so that no single
 output section in the file contains more than @var{count} relocations.
-This is useful when generating huge relocatable for downloading into
+This is useful when generating huge relocatable files for downloading into
 certain real time kernels with the COFF object file format; since COFF
 cannot represent more than 65535 relocations in a single section.  Note
 that this will fail to work with object file formats which do not
 support arbitrary sections.  The linker will not split up individual
 input sections for redistribution, so if a single input section contains
 more than @var{count} relocations one output section will contain that
-many relocations.
+many relocations.  @var{count} defaults to a value of 32768.
 
 @kindex --stats
 @item --stats
@@ -1028,6 +1216,18 @@ full debugging information by over 30 percent.  Unfortunately, the SunOS
 trouble).  The @samp{--traditional-format} switch tells @code{ld} to not
 combine duplicate entries.
 
+@kindex --section-start @var{sectionname}=@var{org}
+@item --section-start @var{sectionname}=@var{org}
+Locate a section in the output file at the absolute
+address given by @var{org}.  You may use this option as many
+times as necessary to locate multiple sections in the command
+line.
+@var{org} must be a single hexadecimal integer;
+for compatibility with other linkers, you may omit the leading
+@samp{0x} usually associated with hexadecimal values.  @emph{Note:} there
+should be no white space between @var{sectionname}, the equals
+sign (``@key{=}''), and @var{org}.
+
 @kindex -Tbss @var{org}
 @kindex -Tdata @var{org}
 @kindex -Ttext @var{org}
@@ -1041,21 +1241,10 @@ Use @var{org} as the starting address for---respectively---the
 for compatibility with other linkers, you may omit the leading
 @samp{0x} usually associated with hexadecimal values.
 
-@kindex -Ur
-@cindex constructors
-@item -Ur 
-For anything other than C++ programs, this option is equivalent to
-@samp{-r}: it generates relocatable output---i.e., an output file that can in
-turn serve as input to @code{ld}.  When linking C++ programs, @samp{-Ur}
-@emph{does} resolve references to constructors, unlike @samp{-r}.
-It does not work to use @samp{-Ur} on files that were themselves linked
-with @samp{-Ur}; once the constructor table has been built, it cannot
-be added to.  Use @samp{-Ur} only for the last partial link, and
-@samp{-r} for the others.
-
 @kindex --verbose
 @cindex verbose
-@item --verbose
+@item --dll-verbose
+@itemx --verbose
 Display the version number for @code{ld} and list the linker emulations
 supported.  Display which input files can and cannot be opened.  Display
 the linker script if using a default builtin script.
@@ -1201,6 +1390,12 @@ 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.  This option may be used more than once.
 
+Two notes when using this option from gcc: First, gcc doesn't know
+about this option, so you have to use @code{-Wl,-whole-archive}.
+Second, don't forget to use @code{-Wl,-no-whole-archive} after your
+list of archives, because gcc will add its own list of archives to
+your link and you may not want this flag to affect those as well.
+
 @kindex --wrap
 @item --wrap @var{symbol}
 Use a wrapper function for @var{symbol}.  Any undefined reference to
@@ -1235,6 +1430,174 @@ you should not put the definition of @code{__real_malloc} in the same
 file as @code{__wrap_malloc}; if you do, the assembler may resolve the
 call before the linker has a chance to wrap it to @code{malloc}.
 
+@kindex --enable-new-dtags
+@kindex --disable-new-dtags
+@item --enable-new-dtags
+@itemx --disable-new-dtags
+This linker can create the new dynamic tags in ELF. But the older ELF
+systems may not understand them. If you specify
+@code{--enable-new-dtags}, the dynamic tags will be created as needed.
+If you specify @code{--disable-new-dtags}, no new dynamic tags will be
+created. By default, the new dynamic tags are not created. Note that
+those options are only available for ELF systems.
+
+@end table
+
+@subsection Options specific to i386 PE targets
+
+The i386 PE linker supports the @code{-shared} option, which causes
+the output to be a dynamically linked library (DLL) instead of a
+normal executable.  You should name the output @code{*.dll} when you
+use this option.  In addition, the linker fully supports the standard
+@code{*.def} files, which may be specified on the linker command line
+like an object file (in fact, it should precede archives it exports
+symbols from, to ensure that they get linked in, just like a normal
+object file).
+
+In addition to the options common to all targets, the i386 PE linker
+support additional command line options that are specific to the i386
+PE target.  Options that take values may be separated from their
+values by either a space or an equals sign.
+
+@table @code
+
+@kindex --add-stdcall-alias
+@item --add-stdcall-alias
+If given, symbols with a stdcall suffix (@@@var{nn}) will be exported
+as-is and also with the suffix stripped.
+
+@kindex --base-file
+@item --base-file @var{file}
+Use @var{file} as the name of a file in which to save the base
+addresses of all the relocations needed for generating DLLs with
+@file{dlltool}.
+
+@kindex --dll
+@item --dll
+Create a DLL instead of a regular executable.  You may also use
+@code{-shared} or specify a @code{LIBRARY} in a given @code{.def}
+file.
+
+@kindex --enable-stdcall-fixup
+@kindex --disable-stdcall-fixup
+@item --enable-stdcall-fixup
+@itemx --disable-stdcall-fixup
+If the link finds a symbol that it cannot resolve, it will attempt to
+do "fuzzy linking" by looking for another defined symbol that differs
+only in the format of the symbol name (cdecl vs stdcall) and will
+resolve that symbol by linking to the match.  For example, the
+undefined symbol @code{_foo} might be linked to the function
+@code{_foo@@12}, or the undefined symbol @code{_bar@@16} might be linked
+to the function @code{_bar}.  When the linker does this, it prints a
+warning, since it normally should have failed to link, but sometimes
+import libraries generated from third-party dlls may need this feature
+to be usable.  If you specify @code{--enable-stdcall-fixup}, this
+feature is fully enabled and warnings are not printed.  If you specify
+@code{--disable-stdcall-fixup}, this feature is disabled and such
+mismatches are considered to be errors.
+
+@cindex DLLs, creating
+@kindex --export-all-symbols
+@item --export-all-symbols
+If given, all global symbols in the objects used to build a DLL will
+be exported by the DLL.  Note that this is the default if there
+otherwise wouldn't be any exported symbols.  When symbols are
+explicitly exported via DEF files or implicitly exported via function
+attributes, the default is to not export anything else unless this
+option is given.  Note that the symbols @code{DllMain@@12},
+@code{DllEntryPoint@@0}, and @code{impure_ptr} will not be automatically
+exported.
+
+@kindex --exclude-symbols
+@item --exclude-symbols @var{symbol},@var{symbol},...
+Specifies a list of symbols which should not be automatically
+exported.  The symbol names may be delimited by commas or colons.
+
+@kindex --file-alignment
+@item --file-alignment
+Specify the file alignment.  Sections in the file will always begin at
+file offsets which are multiples of this number.  This defaults to
+512.
+
+@cindex heap size
+@kindex --heap
+@item --heap @var{reserve}
+@itemx --heap @var{reserve},@var{commit}
+Specify the amount of memory to reserve (and optionally commit) to be
+used as heap for this program.  The default is 1Mb reserved, 4K
+committed.
+
+@cindex image base
+@kindex --image-base
+@item --image-base @var{value}
+Use @var{value} as the base address of your program or dll.  This is
+the lowest memory location that will be used when your program or dll
+is loaded.  To reduce the need to relocate and improve performance of
+your dlls, each should have a unique base address and not overlap any
+other dlls.  The default is 0x400000 for executables, and 0x10000000
+for dlls.
+
+@kindex --kill-at
+@item --kill-at
+If given, the stdcall suffixes (@@@var{nn}) will be stripped from
+symbols before they are exported.
+
+@kindex --major-image-version
+@item --major-image-version @var{value}
+Sets the major number of the "image version".  Defaults to 1.
+
+@kindex --major-os-version
+@item --major-os-version @var{value}
+Sets the major number of the "os version".  Defaults to 4.
+
+@kindex --major-subsystem-version
+@item --major-subsystem-version @var{value}
+Sets the major number of the "subsystem version".  Defaults to 4.
+
+@kindex --minor-image-version
+@item --minor-image-version @var{value}
+Sets the minor number of the "image version".  Defaults to 0.
+
+@kindex --minor-os-version
+@item --minor-os-version @var{value}
+Sets the minor number of the "os version".  Defaults to 0.
+
+@kindex --minor-subsystem-version
+@item --minor-subsystem-version @var{value}
+Sets the minor number of the "subsystem version".  Defaults to 0.
+
+@cindex DEF files, creating
+@cindex DLLs, creating
+@kindex --output-def
+@item --output-def @var{file}
+The linker will create the file @var{file} which will contain a DEF
+file corresponding to the DLL the linker is generating.  This DEF file
+(which should be called @code{*.def}) may be used to create an import
+library with @code{dlltool} or may be used as a reference to
+automatically or implicitly exported symbols.
+
+@kindex --section-alignment
+@item --section-alignment
+Sets the section alignment.  Sections in memory will always begin at
+addresses which are a multiple of this number.  Defaults to 0x1000.
+
+@cindex stack size
+@kindex --stack
+@item --stack @var{reserve}
+@itemx --stack @var{reserve},@var{commit}
+Specify the amount of memory to reserve (and optionally commit) to be
+used as stack for this program.  The default is 32Mb reserved, 4K
+committed.
+
+@kindex --subsystem
+@item --subsystem @var{which}
+@itemx --subsystem @var{which}:@var{major}
+@itemx --subsystem @var{which}:@var{major}.@var{minor}
+Specifies the subsystem under which your program will execute.  The
+legal values for @var{which} are @code{native}, @code{windows},
+@code{console}, and @code{posix}.  You may optionally set the
+subsystem version also.
+
 @end table
 
 @ifset UsesEnvVars
@@ -1242,7 +1605,7 @@ call before the linker has a chance to wrap it to @code{malloc}.
 @section Environment Variables
 
 You can change the behavior of @code{ld} with the environment variables
-@code{GNUTARGET} and @code{LDEMULATION}.
+@code{GNUTARGET}, @code{LDEMULATION}, and @code{COLLECT_NO_DEMANGLE}.
 
 @kindex GNUTARGET
 @cindex default input format
@@ -1270,6 +1633,15 @@ variable is not defined, the default emulation depends upon how the
 linker was configured.
 @end ifset
 
+@kindex COLLECT_NO_DEMANGLE
+@cindex demangling, default
+Normally, the linker will default to demangling symbols.  However, if
+@code{COLLECT_NO_DEMANGLE} is set in the environment, then it will
+default to not demangling symbols.  This environment variable is used in
+a similar fashion by the @code{gcc} linker wrapper program.  The default
+may be overridden by the @samp{--demangle} and @samp{--no-demangle}
+options.
+
 @node Scripts
 @chapter Linker Scripts
 
@@ -1420,12 +1792,6 @@ You write the @samp{SECTIONS} command as the keyword @samp{SECTIONS},
 followed by a series of symbol assignments and output section
 descriptions enclosed in curly braces.
 
-The first line in the above example sets the special symbol @samp{.},
-which is the location counter.  If you do not specify the address of an
-output section in some other way (other ways are described later), the
-address is set from the current value of the location counter.  The
-location counter is then incremented by the size of the output section.
-
 The first line inside the @samp{SECTIONS} command of the above example
 sets the value of the special symbol @samp{.}, which is the location
 counter.  If you do not specify the address of an output section in some
@@ -1494,15 +1860,15 @@ There are several ways to set the entry point.  The linker will set the
 entry point by trying each of the following methods in order, and
 stopping when one of them succeeds:
 @itemize @bullet
-@item 
+@item
 the @samp{-e} @var{entry} command-line option;
-@item 
+@item
 the @code{ENTRY(@var{symbol})} command in a linker script;
-@item 
+@item
 the value of the symbol @code{start}, if defined;
-@item 
+@item
 the address of the first byte of the @samp{.text} section, if present;
-@item 
+@item
 The address @code{0}.
 @end itemize
 
@@ -1645,6 +2011,21 @@ command is also used to set the format for the output file.  @xref{BFD}.
 There are a few other linker scripts commands.
 
 @table @code
+@item ASSERT(@var{exp}, @var{message})
+@kindex ASSERT
+@cindex assertion in linker script
+Ensure that @var{exp} is non-zero.  If it is zero, then exit the linker
+with an error code, and print @var{message}.
+
+@item EXTERN(@var{symbol} @var{symbol} @dots{})
+@kindex EXTERN
+@cindex undefined symbol in linker script
+Force @var{symbol} to be entered in the output file as an undefined
+symbol.  Doing this may, for example, trigger linking of additional
+modules from standard libraries.  You may list several @var{symbol}s for
+each @code{EXTERN}, and you may use @code{EXTERN} multiple times.  This
+command has the same effect as the @samp{-u} command-line option.
+
 @item FORCE_COMMON_ALLOCATION
 @kindex FORCE_COMMON_ALLOCATION
 @cindex common allocation in linker script
@@ -1846,13 +2227,13 @@ in the first input file.  The first section will be at address zero.
 @subsection Output section description
 The full description of an output section looks like this:
 @smallexample
-@group 
+@group
 @var{section} [@var{address}] [(@var{type})] : [AT(@var{lma})]
   @{
     @var{output-section-command}
     @var{output-section-command}
     @dots{}
-  @} [>@var{region}] [:@var{phdr} :@var{phdr} @dots{}] [=@var{fillexp}]
+  @} [>@var{region}] [AT>@var{lma_region}] [:@var{phdr} :@var{phdr} @dots{}] [=@var{fillexp}]
 @end group
 @end smallexample
 
@@ -1955,6 +2336,7 @@ map the input files into your memory layout.
 * Input Section Basics::       Input section basics
 * Input Section Wildcards::    Input section wildcard patterns
 * Input Section Common::       Input section for common symbols
+* Input Section Keep::         Input section and garbage collection
 * Input Section Example::      Input section example
 @end menu
 
@@ -1974,7 +2356,15 @@ include all input @samp{.text} sections, you would write:
 *(.text)
 @end smallexample
 @noindent
-Here the @samp{*} is a wildcard which matches any file name.
+Here the @samp{*} is a wildcard which matches any file name.  To exclude a list
+of files from matching the file name wildcard, EXCLUDE_FILE may be used to
+match all files except the ones specified in the EXCLUDE_FILE list.  For
+example:
+@smallexample
+(*(EXCLUDE_FILE (*crtend.o *otherfile.o) .ctors))
+@end smallexample
+will cause all .ctors sections from all files except @file{crtend.o} and
+@file{otherfile.o} to be included.
 
 There are two ways to include more than one section:
 @smallexample
@@ -2058,6 +2448,14 @@ sequence of input section descriptions is probably in error, because the
 .data1 : @{ data.o(.data) @}
 @end smallexample
 
+@cindex SORT
+Normally, the linker will place files and sections matched by wildcards
+in the order in which they are seen during the link.  You can change
+this by using the @code{SORT} keyword, which appears before a wildcard
+pattern in parentheses (e.g., @code{SORT(.text*)}).  When the
+@code{SORT} keyword is used, the linker will sort the files or sections
+into ascending order by name before placing them in the output file.
+
 If you ever get confused about where input sections are going, use the
 @samp{-M} linker option to generate a map file.  The map file shows
 precisely how input sections are mapped to output sections.
@@ -2115,6 +2513,16 @@ You will sometimes see @samp{[COMMON]} in old linker scripts.  This
 notation is now considered obsolete.  It is equivalent to
 @samp{*(COMMON)}.
 
+@node Input Section Keep
+@subsubsection Input section and garbage collection
+@cindex KEEP
+@cindex garbage collection
+When link-time garbage collection is in use (@samp{--gc-sections}),
+it is often useful to mark sections that should not be eliminated.
+This is accomplished by surrounding an input section's wildcard entry
+with @code{KEEP()}, as in @code{KEEP(*(.init))} or
+@code{KEEP(SORT(*)(.ctors))}.
+
 @node Input Section Example
 @subsubsection Input section example
 The following example is a complete linker script.  It tells the linker
@@ -2147,7 +2555,7 @@ SECTIONS @{
     @}
 @}
 @end group
-@end smallexample        
+@end smallexample
 
 @node Output Section Data
 @subsection Output section data
@@ -2190,6 +2598,16 @@ When the object file format does not have an explicit endianness, as is
 true of, for example, S-records, the value will be stored in the
 endianness of the first input object file.
 
+Note - these commands only work inside a section description and not
+between them, so the following will produce an error from the linker:
+@smallexample
+SECTIONS @{@ .text : @{@ *(.text) @}@ LONG(1) .data : @{@ *(.data) @}@ @}@
+@end smallexample
+whereas this will work:
+@smallexample
+SECTIONS @{@ .text : @{@ *(.text) ; LONG(1) @}@ .data : @{@ *(.data) @}@ @}@
+@end smallexample
+
 @kindex FILL(@var{expression})
 @cindex holes, filling
 @cindex unspecified memory
@@ -2278,10 +2696,20 @@ runtime code expects to see.
       __DTOR_END__ = .;
 @end smallexample
 
+If you are using the @sc{gnu} C++ support for initialization priority,
+which provides some control over the order in which global constructors
+are run, you must sort the constructors at link time to ensure that they
+are executed in the correct order.  When using the @code{CONSTRUCTORS}
+command, use @samp{SORT(CONSTRUCTORS)} instead.  When using the
+@code{.ctors} and @code{.dtors} sections, use @samp{*(SORT(.ctors))} and
+@samp{*(SORT(.dtors))} instead of just @samp{*(.ctors)} and
+@samp{*(.dtors)}.
+
 Normally the compiler and linker will handle these issues automatically,
 and you will not need to concern yourself with them.  However, you may
 need to consider this if you are using C++ and writing your own linker
 scripts.
+
 @end table
 
 @node Output Section Discarding
@@ -2303,6 +2731,7 @@ If you use anything other than an input section description as an output
 section command, such as a symbol assignment, then the output section
 will always be created, even if there are no matching input sections.
 
+@cindex /DISCARD/
 The special output section name @samp{/DISCARD/} may be used to discard
 input sections.  Any input sections which are assigned to an output
 section named @samp{/DISCARD/} are not included in the output file.
@@ -2313,20 +2742,20 @@ section named @samp{/DISCARD/} are not included in the output file.
 We showed above that the full description of an output section looked
 like this:
 @smallexample
-@group 
+@group
 @var{section} [@var{address}] [(@var{type})] : [AT(@var{lma})]
   @{
     @var{output-section-command}
     @var{output-section-command}
     @dots{}
-  @} [>@var{region}] [:@var{phdr} :@var{phdr} @dots{}] [=@var{fillexp}]
+  @} [>@var{region}] [AT>@var{lma_region}] [:@var{phdr} :@var{phdr} @dots{}] [=@var{fillexp}]
 @end group
 @end smallexample
 We've already described @var{section}, @var{address}, and
 @var{output-section-command}.  In this section we will describe the
 remaining section attributes.
 
-@menu 
+@menu
 * Output Section Type::                Output section type
 * Output Section LMA::         Output section LMA
 * Output Section Region::      Output section region
@@ -2373,6 +2802,7 @@ SECTIONS @{
 
 @node Output Section LMA
 @subsubsection Output section LMA
+@kindex AT>@var{lma_region}
 @kindex AT(@var{lma})
 @cindex load address
 @cindex section load address
@@ -2383,7 +2813,9 @@ Address}).
 
 The linker will normally set the LMA equal to the VMA.  You can change
 that by using the @code{AT} keyword.  The expression @var{lma} that
-follows the @code{AT} keyword specifies the load address of the section.
+follows the @code{AT} keyword specifies the load address of the
+section.  Alternatively, with @samp{AT>@var{lma_region}} expression,
+you may specify a memory region for the section's load address. @xref{MEMORY}.
 
 @cindex ROM initialized data
 @cindex initialized data in ROM
@@ -2401,7 +2833,7 @@ counter holds the VMA value, not the LMA value.
 SECTIONS
   @{
   .text 0x1000 : @{ *(.text) _etext = . ; @}
-  .mdata 0x2000 : 
+  .mdata 0x2000 :
     AT ( ADDR (.text) + SIZEOF (.text) )
     @{ _data = . ; *(.data); _edata = . ;  @}
   .bss 0x3000 :
@@ -2628,7 +3060,7 @@ command.  However, you can define as many blocks of memory within it as
 you wish.  The syntax is:
 @smallexample
 @group
-MEMORY 
+MEMORY
   @{
     @var{name} [(@var{attr})] : ORIGIN = @var{origin}, LENGTH = @var{len}
     @dots{}
@@ -2703,7 +3135,7 @@ region.
 
 @smallexample
 @group
-MEMORY 
+MEMORY
   @{
     rom (rx)  : ORIGIN = 0, LENGTH = 256K
     ram (!rx) : org = 0x40000000, l = 4M
@@ -2907,9 +3339,9 @@ VERS_1.1 @{
         global:
                 foo1;
         local:
-                old*; 
-                original*; 
-                new*; 
+                old*;
+                original*;
+                new*;
 @};
 
 VERS_1.2 @{
@@ -3130,6 +3562,39 @@ followed by a 1000 byte gap.  Then the @samp{.text} section from
 @samp{.text} section from @file{file3}.  The notation @samp{= 0x1234}
 specifies what data to write in the gaps (@pxref{Output Section Fill}).
 
+@cindex dot inside sections
+Note: @code{.} actually refers to the byte offset from the start of the
+current containing object.  Normally this is the @code{SECTIONS}
+statement, whoes start address is 0, hence @code{.} can be used as an
+absolute address.  If @code{.} is used inside a section description
+however, it refers to the byte offset from the start of that section,
+not an absolute address.  Thus in a script like this:
+
+@smallexample
+SECTIONS
+@{
+    . = 0x100
+    .text: @{
+      *(.text)
+      . = 0x200
+    @}
+    . = 0x500
+    .data: @{
+      *(.data)
+      . += 0x600
+    @}
+@}
+@end smallexample
+
+The @samp{.text} section will be assigned a starting address of 0x100
+and a size of exactly 0x200 bytes, even if there is not enough data in
+the @samp{.text} input sections to fill this area.  (If there is too
+much data, an error will be produced because this would be an attempt to
+move @code{.} backwards).  The @samp{.data} section will start at 0x500
+and it will have an extra 0x600 bytes worth of space after the end of
+the values from the @samp{.data} input sections and before the end of
+the @samp{.data} output section itself.
+
 @need 2000
 @node Operators
 @subsection Operators
@@ -3158,7 +3623,7 @@ precedence      associativity   Operators                Notes
 (lowest)
 @end smallexample
 Notes:
-(1) Prefix operators 
+(1) Prefix operators
 (2) @xref{Assignments}.
 @c TEXI2ROFF-KILL
 @end ifinfo
@@ -3176,7 +3641,7 @@ height2pt&\omit&&\omit&&\omit&\cr
 height2pt&\omit&&\omit&&\omit&\cr
 &highest&&&&&\cr
 % '176 is tilde, '~' in tt font
-&1&&left&&\qquad-          \char'176\      !\qquad\dag&\cr 
+&1&&left&&\qquad-          \char'176\      !\qquad\dag&\cr
 &2&&left&&*          /        \%&\cr
 &3&&left&&+          -&\cr
 &4&&left&&>>         <<&\cr
@@ -3231,7 +3696,7 @@ following
 @group
 SECTIONS
   @{
-    .text 9+this_isnt_constant : 
+    .text 9+this_isnt_constant :
       @{ *(.text) @}
   @}
 @end group
@@ -3306,7 +3771,7 @@ identical values:
 @group
 SECTIONS @{ @dots{}
   .output1 :
-    @{ 
+    @{
     start_of_output_1 = ABSOLUTE(.);
     @dots{}
     @}
@@ -3371,12 +3836,13 @@ existed, its value is preserved:
 
 @smallexample
 @group
-SECTIONS@{ @dots{}
+SECTIONS @{ @dots{}
   .text : @{
     begin = DEFINED(begin) ? begin : . ;
     @dots{}
   @}
-@dots{} @}
+  @dots{}
+@}
 @end group
 @end smallexample
 
@@ -3478,6 +3944,11 @@ functionality are not listed.
 @menu
 * H8/300::                      @code{ld} and the H8/300
 * i960::                        @code{ld} and the Intel 960 family
+* ARM::                                @code{ld} and the ARM family
+* HPPA ELF32::                  @code{ld} and HPPA 32-bit ELF
+@ifset TICOFF
+* TI COFF::                     @code{ld} and TI COFF
+@end ifset
 @end menu
 @end ifset
 
@@ -3487,6 +3958,7 @@ functionality are not listed.
 @ifclear GENERIC
 @raisesections
 @end ifclear
+
 @node H8/300
 @section @code{ld} and the H8/300
 
@@ -3512,6 +3984,7 @@ page of memory, and changes them to use the eight-bit address form.
 @samp{mov.b @code{@@}@var{aa}:8} whenever the address @var{aa} is in the
 top page of memory).
 @end table
+
 @ifclear GENERIC
 @lowersections
 @end ifclear
@@ -3534,6 +4007,7 @@ these chips.
 @ifclear GENERIC
 @raisesections
 @end ifclear
+
 @node i960
 @section @code{ld} and the Intel 960 family
 
@@ -3586,6 +4060,83 @@ not itself call any subroutines).
 @end ifclear
 @end ifset
 
+@ifclear GENERIC
+@raisesections
+@end ifclear
+
+@node ARM
+@section @code{ld}'s support for interworking between ARM and Thumb code
+
+@cindex ARM interworking support
+@kindex --support-old-code
+For the ARM, @code{ld} will generate code stubs to allow functions calls
+betweem ARM and Thumb code.  These stubs only work with code that has
+been compiled and assembled with the @samp{-mthumb-interwork} command
+line option.  If it is necessary to link with old ARM object files or
+libraries, which have not been compiled with the -mthumb-interwork
+option then the @samp{--support-old-code} command line switch should be
+given to the linker.  This will make it generate larger stub functions
+which will work with non-interworking aware ARM code.  Note, however,
+the linker does not support generating stubs for function calls to
+non-interworking aware Thumb code.
+
+@cindex thumb entry point
+@cindex entry point, thumb
+@kindex --thumb-entry=@var{entry}
+The @samp{--thumb-entry} switch is a duplicate of the generic
+@samp{--entry} switch, in that it sets the program's starting address.
+But it also sets the bottom bit of the address, so that it can be
+branched to using a BX instruction, and the program will start
+executing in Thumb mode straight away.
+
+@node HPPA ELF32
+@section @code{ld} and HPPA 32-bit ELF support
+@cindex HPPA multiple sub-space stubs
+@kindex --multi-subspace
+When generating a shared library, @code{ld} will by default generate
+import stubs suitable for use with a single sub-space application.
+The @samp{--multi-subspace} switch causes @code{ld} to generate export
+stubs, and different (larger) import stubs suitable for use with
+multiple sub-spaces.
+
+@cindex HPPA stub grouping
+@kindex --stub-group-size=@var{N}
+Long branch stubs and import/export stubs are placed by @code{ld} in
+stub sections located between groups of input sections.
+@samp{--stub-group-size} specifies the maximum size of a group of input
+sections handled by one stub section.  Since branch offsets are signed,
+a stub section may serve two groups of input sections, one group before
+the stub section, and one group after it.  However, when using
+conditional branches that require stubs, it may be better (for branch
+prediction) that stub sections only serve one group of input sections.
+A negative value for @samp{N} chooses this scheme, ensuring that
+branches to stubs always use a negative offset.  Two special values of
+@samp{N} are recognized, @samp{1} and @samp{-1}.  These both instruct
+@code{ld} to automatically size input section groups for the branch types
+detected, with the same behaviour regarding stub placement as other
+positive or negative values of @samp{N} respectively.
+
+Note that @samp{--stub-group-size} does not split input sections.  A
+single input section larger than the group size specified will of course
+create a larger group (of one section).  If input sections are too
+large, it may not be possible for a branch to reach its stub.
+
+@ifset TICOFF
+@node TI COFF
+@section @code{ld}'s support for various TI COFF versions
+@cindex TI COFF versions
+@kindex --format=@var{version}
+The @samp{--format} switch allows selection of one of the various
+TI COFF versions.  The latest of this writing is 2; versions 0 and 1 are
+also supported.  The TI COFF versions also vary in header byte-order
+format; @code{ld} will read any version or byte order, but the output
+header format depends on the default specified by the specific target.
+@end ifset
+
+@ifclear GENERIC
+@lowersections
+@end ifclear
+
 @ifclear SingleFormat
 @node BFD
 @chapter BFD
@@ -3693,7 +4244,7 @@ individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs
 distribution.
 
 Otherwise, send bug reports for @code{ld} to
-@samp{bug-gnu-utils@@gnu.org}.
+@samp{bug-binutils@@gnu.org}.
 
 The fundamental principle of reporting bugs usefully is this:
 @strong{report all the facts}.  If you are not sure whether to state a
@@ -3911,10 +4462,10 @@ This command does nothing whatever; it's only accepted for compatibility.
 @cindex @code{FORMAT} (MRI)
 @item FORMAT @var{output-format}
 Similar to the @code{OUTPUT_FORMAT} command in the more general linker
-language, but restricted to one of these output formats: 
+language, but restricted to one of these output formats:
 
 @enumerate
-@item 
+@item
 S-records, if @var{output-format} is @samp{S}
 
 @item
@@ -3972,6 +4523,370 @@ If you have more than one @code{SECT} statement for the same
 @var{secname}, only the @emph{first} sets the start address.
 @end table
 
+@node GNU Free Documentation License
+@appendix GNU Free Documentation License
+@cindex GNU Free Documentation License
+
+                GNU Free Documentation License
+
+                   Version 1.1, March 2000
+
+ Copyright (C) 2000  Free Software Foundation, Inc.
+  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+written document "free" in the sense of freedom: to assure everyone
+the effective freedom to copy and redistribute it, with or without
+modifying it, either commercially or noncommercially.  Secondarily,
+this License preserves for the author and publisher a way to get
+credit for their work, while not being considered responsible for
+modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense.  It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does.  But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book.  We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work that contains a
+notice placed by the copyright holder saying it can be distributed
+under the terms of this License.  The "Document", below, refers to any
+such manual or work.  Any member of the public is a licensee, and is
+addressed as "you".
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject.  (For example, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.)  The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, whose contents can be viewed and edited directly and
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters.  A copy made in an otherwise Transparent file
+format whose markup has been designed to thwart or discourage
+subsequent modification by readers is not Transparent.  A copy that is
+not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML designed for human modification.  Opaque formats include
+PostScript, PDF, proprietary formats that can be read and edited only
+by proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML produced by some word processors for output
+purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page.  For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License.  You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute.  However, you may accept
+compensation in exchange for copies.  If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies of the Document numbering more than 100,
+and the Document's license notice requires Cover Texts, you must enclose
+the copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover.  Both covers must also clearly and legibly identify
+you as the publisher of these copies.  The front cover must present
+the full title with all words of the title equally prominent and
+visible.  You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a publicly-accessible computer-network location containing a complete
+Transparent copy of the Document, free of added material, which the
+general network-using public has access to download anonymously at no
+charge using public-standard network protocols.  If you use the latter
+option, you must take reasonably prudent steps, when you begin
+distribution of Opaque copies in quantity, to ensure that this
+Transparent copy will remain thus accessible at the stated location
+until at least one year after the last time you distribute an Opaque
+copy (directly or through your agents or retailers) of that edition to
+the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it.  In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+   from that of the Document, and from those of previous versions
+   (which should, if there were any, be listed in the History section
+   of the Document).  You may use the same title as a previous version
+   if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+   responsible for authorship of the modifications in the Modified
+   Version, together with at least five of the principal authors of the
+   Document (all of its principal authors, if it has less than five).
+C. State on the Title page the name of the publisher of the
+   Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+   adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+   giving the public permission to use the Modified Version under the
+   terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+   and required Cover Texts given in the Document's license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section entitled "History", and its title, and add to
+   it an item stating at least the title, year, new authors, and
+   publisher of the Modified Version as given on the Title Page.  If
+   there is no section entitled "History" in the Document, create one
+   stating the title, year, authors, and publisher of the Document as
+   given on its Title Page, then add an item describing the Modified
+   Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+   public access to a Transparent copy of the Document, and likewise
+   the network locations given in the Document for previous versions
+   it was based on.  These may be placed in the "History" section.
+   You may omit a network location for a work that was published at
+   least four years before the Document itself, or if the original
+   publisher of the version it refers to gives permission.
+K. In any section entitled "Acknowledgements" or "Dedications",
+   preserve the section's title, and preserve in the section all the
+   substance and tone of each of the contributor acknowledgements
+   and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+   unaltered in their text and in their titles.  Section numbers
+   or the equivalent are not considered part of the section titles.
+M. Delete any section entitled "Endorsements".  Such a section
+   may not be included in the Modified Version.
+N. Do not retitle any existing section as "Endorsements"
+   or to conflict in title with any Invariant Section.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant.  To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version.  Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity.  If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy.  If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections entitled "History"
+in the various original documents, forming one section entitled
+"History"; likewise combine any sections entitled "Acknowledgements",
+and any sections entitled "Dedications".  You must delete all sections
+entitled "Endorsements."
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, does not as a whole count as a Modified Version
+of the Document, provided no compilation copyright is claimed for the
+compilation.  Such a compilation is called an "aggregate", and this
+License does not apply to the other self-contained works thus compiled
+with the Document, on account of their being thus compiled, if they
+are not themselves derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one quarter
+of the entire aggregate, the Document's Cover Texts may be placed on
+covers that surround only the Document within the aggregate.
+Otherwise they must appear on covers around the whole aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections.  You may include a
+translation of this License provided that you also include the
+original English version of this License.  In case of a disagreement
+between the translation and the original English version of this
+License, the original English version will prevail.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License.  Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License.  However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time.  Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.  See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation.  If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+@smallexample
+    Copyright (c)  YEAR  YOUR NAME.
+    Permission is granted to copy, distribute and/or modify this document
+    under the terms of the GNU Free Documentation License, Version 1.1
+    or any later version published by the Free Software Foundation;
+    with the Invariant Sections being LIST THEIR TITLES, with the
+    Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+    A copy of the license is included in the section entitled "GNU
+    Free Documentation License".
+@end smallexample
+
+If you have no Invariant Sections, write "with no Invariant Sections"
+instead of saying which ones are invariant.  If you have no
+Front-Cover Texts, write "no Front-Cover Texts" instead of
+"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
+
 @node Index
 @unnumbered Index
 
@@ -3995,5 +4910,3 @@ If you have more than one @code{SECT} statement for the same
 
 @contents
 @bye
-
-
This page took 0.043697 seconds and 4 git commands to generate.