3.4.36 Wl: Pass Option To The Linker, Option
The -Wl,option
option passes
option
to the linker application where it will be
interpreted as a linker option. If option
contains
commas, it is split into multiple options at the commas. This means that this option can not
be used to pass in a linker option such as -pcodeStart,codeEnd
, which
uses the comma to separate psect names. In this case, use the -Xlinker
option. Any linker option specified will be added to the default linker options
passed by the driver and these will be executed before the default options by the
linker.
The -Wl,
option can
also be used to replace default linker options. If the string starting from the first
character after the comma (,
) up to the first equal character
(=
) matches the first part of a default linker option, then that
default linker option is replaced by the linker option specified by the
-Wl,
option. For example, if the driver normally passes the default
option -pmyPsect=CODE
to the linker but the
-Wl,-pmyPsect=0200h
option was specified on the command line, this
latter option would replace the default option. Note that the entire default linker option
is replaced, so if the driver instead passed the default option
-pmyPsect=CODE,moreCode,andMore
, then the entire of this option will be
replaced should the -Wl,-pmyPsect=0200h
option be specified on the command
line.