* ld-srec/srec.exp: For m6811/m6812 use --defsym to define _.z soft
[deliverable/binutils-gdb.git] / ld / ld.texinfo
index 96a87f4173f8a750c6517e404c8b6c7ea1765e98..c9691a0a01e283a8706348a5611123bbe6d871cc 100644 (file)
@@ -45,6 +45,7 @@
 @set V850
 @set VAX
 @set WIN32
+@set XTENSA
 @end ifset
 @c man end
 
@@ -139,8 +140,8 @@ section entitled ``GNU Free Documentation License''.
 @ifset H8300
 * H8/300::                      ld and the H8/300
 @end ifset
-@ifset Hitachi
-* Hitachi::                     ld and other Hitachi micros
+@ifset Renesas
+* Renesas::                     ld and other Renesas micros
 @end ifset
 @ifset I960
 * i960::                        ld and the Intel 960 family
@@ -157,6 +158,9 @@ section entitled ``GNU Free Documentation License''.
 @ifset WIN32
 * Win32::                       ld and WIN32 (cygwin/mingw)
 @end ifset
+@ifset XTENSA
+* Xtensa::                      ld and Xtensa Processors
+@end ifset
 @end ifclear
 @ifclear SingleFormat
 * BFD::                         BFD
@@ -724,9 +728,9 @@ This option is currently only supported on ELF platforms.
 @cindex partial link
 @cindex relocatable output
 @kindex -r
-@kindex --relocateable
+@kindex --relocatable
 @item -r
-@itemx --relocateable
+@itemx --relocatable
 Generate relocatable output---i.e., generate an output file that can in
 turn serve as input to @command{ld}.  This is often called @dfn{partial
 linking}.  As a side effect, in environments that support standard Unix
@@ -1205,6 +1209,18 @@ command @code{OUTPUT_FORMAT} can also specify the output format, but
 this option overrides it.  @xref{BFD}.
 @end ifclear
 
+@kindex -pie
+@kindex --pic-executable
+@item -pie
+@itemx --pic-executable
+@cindex position independent executables
+Create a position independent executable.  This is currently only supported on
+ELF platforms.  Position independent executables are similar to shared
+libraries in that they are relocated by the dynamic linker to the virtual
+address OS chooses for them (which can varry between invocations), like
+normal dynamically linked executables they can be executed and symbols
+defined in the executable cannot be overridden by shared libraries.
+
 @kindex -qmagic
 @item -qmagic
 This option is ignored for Linux compatibility.
@@ -1227,7 +1243,9 @@ This option is only supported on a few targets.
 @ifset I960
 @xref{i960,, @command{ld} and the Intel 960 family}.
 @end ifset
-
+@ifset XTENSA
+@xref{Xtensa,, @command{ld} and Xtensa Processors}.
+@end ifset
 
 On some platforms, the @samp{--relax} option performs global
 optimizations that become possible when the linker resolves addressing
@@ -1658,18 +1676,21 @@ values by either a space or an equals sign.
 @item --add-stdcall-alias
 If given, symbols with a stdcall suffix (@@@var{nn}) will be exported
 as-is and also with the suffix stripped.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @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}.
+[This is an i386 PE specific option]
 
 @kindex --dll
 @item --dll
 Create a DLL instead of a regular executable.  You may also use
 @option{-shared} or specify a @code{LIBRARY} in a given @code{.def}
 file.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --enable-stdcall-fixup
 @kindex --disable-stdcall-fixup
@@ -1688,6 +1709,7 @@ to be usable.  If you specify @option{--enable-stdcall-fixup}, this
 feature is fully enabled and warnings are not printed.  If you specify
 @option{--disable-stdcall-fixup}, this feature is disabled and such
 mismatches are considered to be errors.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @cindex DLLs, creating
 @kindex --export-all-symbols
@@ -1714,11 +1736,13 @@ These cygwin-excludes are: @code{_cygwin_dll_entry@@12},
 @code{_fmode}, @code{_impure_ptr}, @code{cygwin_attach_dll}, 
 @code{cygwin_premain0}, @code{cygwin_premain1}, @code{cygwin_premain2},
 @code{cygwin_premain3}, and @code{environ}. 
+[This option is specific to the i386 PE targeted port of the linker]
 
 @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.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --exclude-libs
 @item --exclude-libs @var{lib},@var{lib},...
@@ -1727,12 +1751,14 @@ exported. The library names may be delimited by commas or colons.  Specifying
 @code{--exclude-libs ALL} excludes symbols in all archive libraries from
 automatic export. Symbols explicitly listed in a .def file are still exported,
 regardless of this option. 
+[This option is specific to the i386 PE targeted port of the linker]
 
 @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.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @cindex heap size
 @kindex --heap
@@ -1741,6 +1767,7 @@ file offsets which are multiples of this number.  This defaults to
 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.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @cindex image base
 @kindex --image-base
@@ -1751,35 +1778,43 @@ 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.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --kill-at
 @item --kill-at
 If given, the stdcall suffixes (@@@var{nn}) will be stripped from
 symbols before they are exported.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --major-image-version
 @item --major-image-version @var{value}
 Sets the major number of the ``image version''.  Defaults to 1.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --major-os-version
 @item --major-os-version @var{value}
 Sets the major number of the ``os version''.  Defaults to 4.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --major-subsystem-version
 @item --major-subsystem-version @var{value}
 Sets the major number of the ``subsystem version''.  Defaults to 4.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --minor-image-version
 @item --minor-image-version @var{value}
 Sets the minor number of the ``image version''.  Defaults to 0.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --minor-os-version
 @item --minor-os-version @var{value}
 Sets the minor number of the ``os version''.  Defaults to 0.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --minor-subsystem-version
 @item --minor-subsystem-version @var{value}
 Sets the minor number of the ``subsystem version''.  Defaults to 0.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @cindex DEF files, creating
 @cindex DLLs, creating
@@ -1790,6 +1825,7 @@ 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.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @cindex DLLs, creating
 @kindex --out-implib
@@ -1800,6 +1836,7 @@ import lib (which should be called @code{*.dll.a} or @code{*.a}
 may be used to link clients against the generated DLL; this behavior
 makes it possible to skip a separate @code{dlltool} import library
 creation step.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --enable-auto-image-base
 @item --enable-auto-image-base
@@ -1808,12 +1845,14 @@ using the @code{--image-base} argument.  By using a hash generated
 from the dllname to create unique image bases for each DLL, in-memory
 collisions and relocations which can delay program execution are
 avoided.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --disable-auto-image-base
 @item --disable-auto-image-base
 Do not automatically generate a unique image base.  If there is no
 user-specified image base (@code{--image-base}) then use the platform
 default.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @cindex DLLs, linking to
 @kindex --dll-search-prefix
@@ -1824,6 +1863,7 @@ search for @code{<string><basename>.dll} in preference to
 between DLLs built for the various "subplatforms": native, cygwin,
 uwin, pw, etc.  For instance, cygwin DLLs typically use
 @code{--dll-search-prefix=cyg}. 
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --enable-auto-import
 @item --enable-auto-import
@@ -1943,11 +1983,13 @@ A fourth way to avoid this problem is to re-code your
 library to use a functional interface rather than a data interface
 for the offending variables (e.g. set_foo() and get_foo() accessor
 functions).
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --disable-auto-import
 @item --disable-auto-import
 Do not attempt to do sophisticalted linking of @code{_symbol} to 
 @code{__imp__symbol} for DATA imports from DLLs.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --enable-runtime-pseudo-reloc
 @item --enable-runtime-pseudo-reloc
@@ -1955,20 +1997,24 @@ If your code contains expressions described in --enable-auto-import section,
 that is, DATA imports from DLL with non-zero offset, this switch will create
 a vector of 'runtime pseudo relocations' which can be used by runtime
 environment to adjust references to such data in your client code. 
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --disable-runtime-pseudo-reloc
 @item --disable-runtime-pseudo-reloc
 Do not create pseudo relocations for non-zero offset DATA imports from
 DLLs.  This is the default.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --enable-extra-pe-debug
 @item --enable-extra-pe-debug
 Show additional debug info related to auto-import symbol thunking.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @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.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @cindex stack size
 @kindex --stack
@@ -1977,6 +2023,7 @@ addresses which are a multiple of this number.  Defaults to 0x1000.
 Specify the amount of memory to reserve (and optionally commit) to be
 used as stack for this program.  The default is 2Mb reserved, 4K
 committed.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @kindex --subsystem
 @item --subsystem @var{which}
@@ -1986,6 +2033,7 @@ 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.
+[This option is specific to the i386 PE targeted port of the linker]
 
 @end table
 
@@ -4446,6 +4494,9 @@ functionality are not listed.
 @ifset WIN32
 * WIN32::                       @command{ld} and WIN32 (cygwin/mingw)
 @end ifset
+@ifset XTENSA
+* Xtensa::                      @command{ld} and Xtensa Processors
+@end ifset
 @end menu
 @end ifset
 
@@ -4486,15 +4537,15 @@ top page of memory).
 @end ifset
 
 @ifclear GENERIC
-@ifset Hitachi
+@ifset Renesas
 @c This stuff is pointless to say unless you're especially concerned
-@c with Hitachi chips; don't enable it for generic case, please.
-@node Hitachi
-@chapter @command{ld} and Other Hitachi Chips
+@c with Renesas chips; don't enable it for generic case, please.
+@node Renesas
+@chapter @command{ld} and Other Renesas Chips
 
-@command{ld} also supports the H8/300H, the H8/500, and the Hitachi SH.  No
-special features, commands, or command-line options are required for
-these chips.
+@command{ld} also supports the Renesas (formerly Hitachi) H8/300H,
+H8/500, and SH chips.  No special features, commands, or command-line
+options are required for these chips.
 @end ifset
 @end ifclear
 
@@ -5077,6 +5128,72 @@ which is probably not what you wanted.
 @end ifclear
 @end ifset
 
+@ifset XTENSA
+@ifclear GENERIC
+@raisesections
+@end ifclear
+
+@node Xtensa
+@section @code{ld} and Xtensa Processors
+
+@cindex Xtensa processors
+The default @command{ld} behavior for Xtensa processors is to interpret
+@code{SECTIONS} commands so that lists of explicitly named sections in a
+specification with a wildcard file will be interleaved when necessary to
+keep literal pools within the range of PC-relative load offsets.  For
+example, with the command:
+
+@smallexample
+SECTIONS
+@{
+  .text : @{
+    *(.literal .text)
+  @}
+@}
+@end smallexample
+
+@noindent
+@command{ld} may interleave some of the @code{.literal}
+and @code{.text} sections from different object files to ensure that the
+literal pools are within the range of PC-relative load offsets.  A valid
+interleaving might place the @code{.literal} sections from an initial
+group of files followed by the @code{.text} sections of that group of
+files.  Then, the @code{.literal} sections from the rest of the files
+and the @code{.text} sections from the rest of the files would follow.
+The non-interleaved order can still be specified as:
+
+@smallexample
+SECTIONS
+@{
+  .text : @{
+    *(.literal) *(.text)
+  @}
+@}
+@end smallexample
+
+@cindex @code{--relax} on Xtensa
+@cindex relaxing on Xtensa
+@kindex --no-relax
+The Xtensa version of @command{ld} enables the @option{--relax} option by
+default to attempt to reduce space in the output image by combining
+literals with identical values.  It also provides the
+@option{--no-relax} option to disable this optimization.  When enabled,
+the relaxation algorithm ensures that a literal will only be merged with
+another literal when the new merged literal location is within the
+offset range of all of its uses.
+
+The relaxation mechanism will also attempt to optimize
+assembler-generated ``longcall'' sequences of
+@code{L32R}/@code{CALLX@var{n}} when the target is known to fit into a
+@code{CALL@var{n}} instruction encoding.  The current optimization
+converts the sequence into @code{NOP}/@code{CALL@var{n}} and removes the
+literal referenced by the @code{L32R} instruction.
+
+@ifclear GENERIC
+@lowersections
+@end ifclear
+@end ifset
+
 @ifclear SingleFormat
 @node BFD
 @chapter BFD
This page took 0.027563 seconds and 4 git commands to generate.