\input texinfo
@setfilename ld.info
@c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-@c 2001, 2002, 2003 Free Software Foundation, Inc.
+@c 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
@syncodeindex ky cp
@include configdoc.texi
@c (configdoc.texi is generated by the Makefile)
This file documents the @sc{gnu} linker LD version @value{VERSION}.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000,
-2001, 2002, 2003 Free Software Foundation, Inc.
+2001, 2002, 2003, 2004 Free Software Foundation, Inc.
@ignore
@vskip 0pt plus 1filll
@c man begin COPYRIGHT
Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001,
-2002, 2003 Free Software Foundation, Inc.
+2002, 2003, 2004 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
Set the text and data sections to be readable and writable. Also, do
not page-align the data segment, and disable linking against shared
libraries. If the output format supports Unix style magic numbers,
-mark the output as @code{OMAGIC}.
+mark the output as @code{OMAGIC}. Note: Although a writable text section
+is allowed for PE-COFF targets, it does not conform to the format
+specification published by Microsoft.
@kindex --no-omagic
@cindex OMAGIC
@item defs
Disallows undefined symbols in object files. Undefined symbols in
-shared libaries are still allowed.
+shared libraries are still allowed.
@item initfirst
This option is only meaningful when building a shared object.
default on such platforms. The different variants of this option are
for compatibility with various systems. You may use this option
multiple times on the command line: it affects library searching for
-@option{-l} options which follow it. This
-option also implies @option{--unresolved-symbols=ignore-all}.
+@option{-l} options which follow it.
@kindex -Bgroup
@item -Bgroup
@table @samp
@item ignore-all
-Do not report any unresolved symbols. This is the default when
-creating shared libraries or dynamic executables.
+Do not report any unresolved symbols.
@item report-all
-Report all unresolved symbols. This is the default when creating
-static binaries.
+Report all unresolved symbols. This is the default.
@item ignore-in-object-files
Report unresolved symbols that are contained in shared libraries, but
@item --enable-auto-import
Do sophisticated linking of @code{_symbol} to @code{__imp__symbol} for
DATA imports from DLLs, and create the necessary thunking symbols when
-building the import libraries with those DATA exports. This generally
-will 'just work' -- but sometimes you may see this message:
+building the import libraries with those DATA exports. Note: Use of the
+'auto-import' extension will cause the text section of the image file
+to be made writable. This does not conform to the PE-COFF format
+specification published by Microsoft.
+
+Using 'auto-import' generally will 'just work' -- but sometimes you may
+see this message:
"variable '<var>' can't be auto-imported. Please read the
documentation for ld's @code{--enable-auto-import} for details."
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. Alternatively, with @samp{AT>@var{lma_region}} expression,
-you may specify a memory region for the section's load address. @xref{MEMORY}.
+section.
+
+Alternatively, with @samp{AT>@var{lma_region}} expression, you may
+specify a memory region for the section's load address. @xref{MEMORY}.
+Note that if the section has not had a VMA assigned to it then the
+linker will use the @var{lma_region} as the VMA region as well.
+@xref{Output Section Region}.
@cindex ROM initialized data
@cindex initialized data in ROM
@end group
@end smallexample
-@item ALIGN(@var{exp})
-@kindex ALIGN(@var{exp})
+@item ALIGN(@var{align})
+@itemx ALIGN(@var{exp},@var{align})
+@kindex ALIGN(@var{align})
+@kindex ALIGN(@var{exp},@var{align})
@cindex round up location counter
@cindex align location counter
-Return the location counter (@code{.}) aligned to the next @var{exp}
-boundary.
-@code{ALIGN} doesn't change the value of the location counter---it just
-does arithmetic on it. Here is an example which aligns the output
-@code{.data} section to the next @code{0x2000} byte boundary after the
-preceding section and sets a variable within the section to the next
-@code{0x8000} boundary after the input sections:
+@cindex round up expression
+@cindex align expression
+Return the location counter (@code{.}) or arbitrary expression aligned
+to the next @var{align} boundary. The single operand @code{ALIGN}
+doesn't change the value of the location counter---it just does
+arithmetic on it. The two operand @code{ALIGN} allows an arbitrary
+expression to be aligned upwards (@code{ALIGN(@var{align})} is
+equivalent to @code{ALIGN(., @var{align})}).
+
+Here is an example which aligns the output @code{.data} section to the
+next @code{0x2000} byte boundary after the preceding section and sets a
+variable within the section to the next @code{0x8000} boundary after the
+input sections:
@smallexample
@group
SECTIONS @{ @dots{}
@samp{--export-all-symbols} option. If you list only the
renamed symbols in the DEF file, and use @samp{--export-all-symbols}
to handle the other symbols, then the both the new names @emph{and}
-the original names for the the renamed symbols will be exported.
+the original names for the renamed symbols will be exported.
In effect, you'd be aliasing those symbols, not renaming them,
which is probably not what you wanted.
@end table