[lld] 09b81a7 - [ELF] Ignore --no-relax for RISC-V
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 7 09:48:23 PDT 2020
Author: Fangrui Song
Date: 2020-07-07T09:48:13-07:00
New Revision: 09b81a72ac67c035f74ff369e6862d75cc4c4090
URL: https://github.com/llvm/llvm-project/commit/09b81a72ac67c035f74ff369e6862d75cc4c4090
DIFF: https://github.com/llvm/llvm-project/commit/09b81a72ac67c035f74ff369e6862d75cc4c4090.diff
LOG: [ELF] Ignore --no-relax for RISC-V
In GNU ld, --no-relax can disable x86-64 GOTPCRELX relaxation.
It is not useful, so we don't implement it.
For RISC-V, --no-relax disables linker relaxations which have larger
impact.
Linux kernel specifies --no-relax when CONFIG_DYNAMIC_FTRACE is specified
(since http://git.kernel.org/linus/a1d2a6b4cee858a2f27eebce731fbf1dfd72cb4e ).
LLD has not implemented the relaxations, so this option is a no-op.
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D81359
Added:
Modified:
lld/ELF/Options.td
lld/docs/ld.lld.1
lld/test/ELF/silent-ignore.test
Removed:
################################################################################
diff --git a/lld/ELF/Options.td b/lld/ELF/Options.td
index 0a16faa2b8fe..bc12f4d45546 100644
--- a/lld/ELF/Options.td
+++ b/lld/ELF/Options.td
@@ -635,6 +635,7 @@ def: F<"no-copy-dt-needed-entries">;
def: F<"no-ctors-in-init-array">;
def: F<"no-keep-memory">;
def: F<"no-pipeline-knowledge">;
+def: F<"no-relax">;
def: F<"no-warn-mismatch">;
def: Flag<["-"], "p">;
def: Separate<["--", "-"], "rpath-link">;
diff --git a/lld/docs/ld.lld.1 b/lld/docs/ld.lld.1
index 0522feb145f1..3acc818afa22 100644
--- a/lld/docs/ld.lld.1
+++ b/lld/docs/ld.lld.1
@@ -308,6 +308,8 @@ Disable merging .ARM.exidx entries.
Page align sections.
.It Fl -no-omagic
Do not set the text data sections to be writable, page align sections.
+.It Fl -no-relax
+Disable target-specific relaxations. This is currently a no-op.
.It Fl -no-rosegment
Do not put read-only non-executable sections in their own segment.
.It Fl -no-undefined-version
diff --git a/lld/test/ELF/silent-ignore.test b/lld/test/ELF/silent-ignore.test
index 600c9f86b18a..6f76809d0e11 100644
--- a/lld/test/ELF/silent-ignore.test
+++ b/lld/test/ELF/silent-ignore.test
@@ -7,6 +7,7 @@ RUN: -no-copy-dt-needed-entries \
RUN: -no-ctors-in-init-array \
RUN: -no-keep-memory \
RUN: -no-pipeline-knowledge \
+RUN: --no-relax \
RUN: -no-warn-mismatch \
RUN: -p \
RUN: -rpath-link . \
More information about the llvm-commits
mailing list