[llvm] [RISCV][docs] GP Relaxation and Small Data Limit (PR #108592)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 13 09:20:46 PDT 2024
================
@@ -431,3 +431,26 @@ line. This currently applies to the following extensions:
* ``Zvksg``
* ``Zvksh``
* ``Zvkt``
+
+Global Pointer (GP) Relaxation and the Small Data Limit
+=======================================================
+
+Some of the RISC-V psABIs reserve ``gp`` (``x3``) for use as a "Global Pointer", to make generating data addresses more efficient.
+
+To use this functionality, you need to:
+* not be using the ``gp`` register for any other uses -- some platforms use it for other things;
+* compile your objects with Clang's ``-mrelax`` option, to enable relaxation annotations on relocatable objects; and
+* be compiling for an executable (not a shared library); and
+* use LLD's ``--relax-gp`` option.
----------------
topperc wrote:
lld only supports GP relaxation for medlow.
https://github.com/llvm/llvm-project/pull/108592
More information about the llvm-commits
mailing list