[lld][docs] Document two linker-script related options for lld ELF (#166313)

This is a follow up of the discussions in
https://github.com/llvm/llvm-project/pull/163497
This commit is contained in:
Mingming Liu 2025-12-07 22:01:02 -08:00 committed by GitHub
parent c6f45f51fb
commit 8e39bcd9c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,6 +17,25 @@ possible. We reserve the right to make different implementation choices where
it is appropriate for LLD. Intentional deviations will be documented in this
file.
Linker Script Specification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are two lld options related to setting the linker script,
`--script=<file>` and `--default-script=<file>`. The usage are illustrated below.
::
# `-T` is the alias for `--script` option.
lld -T linker_script.lds
# `-dT` is the alias for `--default-script` option.
lld -dT linker_script.lds
When both options are given, `--script=<file>` takes precedence.
The intended use case of `--default-script` is to be used by toolchain
configurations, and users can override the script by specifying `--script` if
needed.
Symbol assignment
~~~~~~~~~~~~~~~~~