diff options
| author | mingmingl <mingmingl@google.com> | 2025-11-03 21:52:26 -0800 |
|---|---|---|
| committer | mingmingl <mingmingl@google.com> | 2025-11-03 22:13:52 -0800 |
| commit | 86370161c0c3a0fb5fc346e20208fc7acf35c74e (patch) | |
| tree | 43f3f52189af4742da8c4c8e443be1e0eaca4f58 | |
| parent | 0b939de1e0927650466704676dddcac603a42950 (diff) | |
lld docsusers/mingmingl-llvm/lld-docs
| -rw-r--r-- | lld/docs/ELF/linker_script.rst | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lld/docs/ELF/linker_script.rst b/lld/docs/ELF/linker_script.rst index c9cb47fc0553..2946e0156583 100644 --- a/lld/docs/ELF/linker_script.rst +++ b/lld/docs/ELF/linker_script.rst @@ -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. + +:: + + # This sets `--script=<file>` option under the hood. + lld -T linker_script.lds + + # This sets `--default-script=<file>` option under the hood. + 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 ~~~~~~~~~~~~~~~~~ |
