Skip to content

Commit 8e39bcd

Browse files
[lld][docs] Document two linker-script related options for lld ELF (#166313)
This is a follow up of the discussions in #163497
1 parent c6f45f5 commit 8e39bcd

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

lld/docs/ELF/linker_script.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,25 @@ possible. We reserve the right to make different implementation choices where
1717
it is appropriate for LLD. Intentional deviations will be documented in this
1818
file.
1919

20+
Linker Script Specification
21+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22+
23+
There are two lld options related to setting the linker script,
24+
`--script=<file>` and `--default-script=<file>`. The usage are illustrated below.
25+
26+
::
27+
28+
# `-T` is the alias for `--script` option.
29+
lld -T linker_script.lds
30+
31+
# `-dT` is the alias for `--default-script` option.
32+
lld -dT linker_script.lds
33+
34+
When both options are given, `--script=<file>` takes precedence.
35+
The intended use case of `--default-script` is to be used by toolchain
36+
configurations, and users can override the script by specifying `--script` if
37+
needed.
38+
2039
Symbol assignment
2140
~~~~~~~~~~~~~~~~~
2241

0 commit comments

Comments
 (0)