Skip to content

Conversation

@mingmingl-llvm
Copy link
Contributor

This is a follow up of the discussions in #163497

@llvmbot
Copy link
Member

llvmbot commented Nov 4, 2025

@llvm/pr-subscribers-lld

Author: Mingming Liu (mingmingl-llvm)

Changes

This is a follow up of the discussions in #163497


Full diff: https://github.com/llvm/llvm-project/pull/166313.diff

1 Files Affected:

  • (modified) lld/docs/ELF/linker_script.rst (+19)
diff --git a/lld/docs/ELF/linker_script.rst b/lld/docs/ELF/linker_script.rst
index c9cb47fc0553e..2946e0156583e 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
 ~~~~~~~~~~~~~~~~~
 

@llvmbot
Copy link
Member

llvmbot commented Nov 4, 2025

@llvm/pr-subscribers-lld-elf

Author: Mingming Liu (mingmingl-llvm)

Changes

This is a follow up of the discussions in #163497


Full diff: https://github.com/llvm/llvm-project/pull/166313.diff

1 Files Affected:

  • (modified) lld/docs/ELF/linker_script.rst (+19)
diff --git a/lld/docs/ELF/linker_script.rst b/lld/docs/ELF/linker_script.rst
index c9cb47fc0553e..2946e0156583e 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
 ~~~~~~~~~~~~~~~~~
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants