]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld: More documentation for --defsym
authorAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 6 Oct 2020 14:30:15 +0000 (15:30 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 16 Oct 2020 12:43:48 +0000 (13:43 +0100)
The ordering of command line options --defsym and -T is important,
however, the description of --defsym in the manual doesn't mention
this.

This commit adds more text to the description of --defsym to try and
explain this ordering requirement.

ld/ChangeLog:

* ld.texi (Options): Extend the description of --defsym.

ld/ChangeLog
ld/ld.texi

index 18dc37bdd865b91d2f5ff05b17ec909783ed3dbf..74e5b4fe4f2b101ecfeaed6f029a12b365ab5b0b 100644 (file)
@@ -1,3 +1,7 @@
+2020-10-16  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * ld.texi (Options): Extend the description of --defsym.
+
 2020-10-16  Nick Clifton  <nickc@redhat.com>
 
        PR 26626
index 95f31ea530be225fc57c43caf68d6b80f24f2d94..763f07e1ae3b953bd53499939156eb55bc4785cf 100644 (file)
@@ -1705,6 +1705,15 @@ using the linker command language from a script (@pxref{Assignments}).
 @emph{Note:} there should be no white space between @var{symbol}, the
 equals sign (``@key{=}''), and @var{expression}.
 
+The linker processes @samp{--defsym} arguments and @samp{-T} arguments
+in order, placing @samp{--defsym} before @samp{-T} will define the
+symbol before the linker script from @samp{-T} is processed, while
+placing @samp{--defsym} after @samp{-T} will define the symbol after
+the linker script has been processed.  This difference has
+consequences for expressions within the linker script that use the
+@samp{--defsym} symbols, which order is correct will depend on what
+you are trying to achieve.
+
 @cindex demangling, from command line
 @kindex --demangle[=@var{style}]
 @kindex --no-demangle