environment variable. The @sc{gnu} linker will ignore the @code{-F}
option when not creating an ELF shared object.
+@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
Ignored. Provided for compatibility with other tools.
@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}
@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
@section @code{ld}'s support for interworking between ARM and Thumb code
@cindex ARM interworking support
-@cindex --support-old-code
+@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
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.
+
@ifclear GENERIC
@lowersections
@end ifclear