]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* ld.texinfo (--gc-sections): Describe linker behaviour.
authorAlan Modra <amodra@gmail.com>
Thu, 10 Jan 2008 01:12:56 +0000 (01:12 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 10 Jan 2008 01:12:56 +0000 (01:12 +0000)
ld/ChangeLog
ld/ld.texinfo

index ccb34b71ef54a4e461cbf5bcd35d9107608dc5e5..359624ed3461bb8feef9979c667488aa11dcc6d6 100644 (file)
@@ -1,3 +1,7 @@
+2008-01-10  Alan Modra  <amodra@bigpond.net.au>
+
+       * ld.texinfo (--gc-sections): Describe linker behaviour.
+
 For older changes see ChangeLog-2007
 \f
 Local Variables:
index 4d687e2626a56dd8f0a7ec13297b5b213b0a1f6f..7cbc26ab0abc84c1f4206c4990249ef7abd45683 100644 (file)
@@ -1285,6 +1285,16 @@ with @samp{-r} or @samp{--emit-relocs}. The default behaviour (of not
 performing this garbage collection) can be restored by specifying
 @samp{--no-gc-sections} on the command line.
 
+@samp{--gc-sections} decides which input sections are used by
+examining symbols and relocations.  The section containing the entry
+symbol and all sections containing symbols undefined on the
+command-line will be kept, as will sections containing symbols
+referenced by dynamic objects.  Note that when building shared
+libraries, the linker must assume that any visible symbol is
+referenced.  Once this initial set of sections has been determined,
+the linker recursively marks as used any section referenced by their
+relocations.  See @samp{--entry} and @samp{--undefined}.
+
 @kindex --print-gc-sections
 @kindex --no-print-gc-sections
 @cindex garbage collection