aboutsummaryrefslogtreecommitdiff
path: root/lld/docs/ELF/linker_script.rst
diff options
context:
space:
mode:
Diffstat (limited to 'lld/docs/ELF/linker_script.rst')
-rw-r--r--lld/docs/ELF/linker_script.rst19
1 files changed, 19 insertions, 0 deletions
diff --git a/lld/docs/ELF/linker_script.rst b/lld/docs/ELF/linker_script.rst
index 0f409b2020ac..debddbf511b6 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.
+Symbol assignment
+~~~~~~~~~~~~~~~~~
+
+A symbol assignment looks like:
+
+::
+
+ symbol = expression;
+ symbol += expression;
+
+The first form defines ``symbol``. If ``symbol`` is already defined, it will be
+overridden. The other form requires ``symbol`` to be already defined.
+
+For a simple assignment like ``alias = aliasee;``, the ``st_type`` field is
+copied from the original symbol. Any arithmetic operation (e.g. ``+ 0`` will
+reset ``st_type`` to ``STT_NOTYPE``.
+
+The ``st_size`` field is set to 0.
+
Output section description
~~~~~~~~~~~~~~~~~~~~~~~~~~