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

via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 7 22:01:06 PST 2025


Author: Mingming Liu
Date: 2025-12-07T22:01:02-08:00
New Revision: 8e39bcd9c37f7d35cf34dd78e7b57b7fbc2b4312

URL: https://github.com/llvm/llvm-project/commit/8e39bcd9c37f7d35cf34dd78e7b57b7fbc2b4312
DIFF: https://github.com/llvm/llvm-project/commit/8e39bcd9c37f7d35cf34dd78e7b57b7fbc2b4312.diff

LOG: [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

Added: 
    

Modified: 
    lld/docs/ELF/linker_script.rst

Removed: 
    


################################################################################
diff  --git a/lld/docs/ELF/linker_script.rst b/lld/docs/ELF/linker_script.rst
index c9cb47fc0553e..edbb78ef7a2ae 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 
diff erent 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
 ~~~~~~~~~~~~~~~~~
 


        


More information about the llvm-commits mailing list