[lld] bfc2f4b - [ELF] Update help messages to prefer canonical name for some long options

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 6 00:43:50 PST 2022


Author: Fangrui Song
Date: 2022-01-06T00:43:46-08:00
New Revision: bfc2f4b122a4b6c49129cd448e4c2fda306c9a52

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

LOG: [ELF] Update help messages to prefer canonical name for some long options

And improve the help message for --pop-state.

Added: 
    

Modified: 
    lld/ELF/Options.td
    lld/ELF/Writer.cpp
    lld/docs/ld.lld.1
    lld/test/ELF/execute-only-mixed-data.s

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Options.td b/lld/ELF/Options.td
index bddf13a3cb425..14b138e99da53 100644
--- a/lld/ELF/Options.td
+++ b/lld/ELF/Options.td
@@ -344,10 +344,10 @@ defm print_symbol_order: Eq<"print-symbol-order",
   "Print a symbol order specified by --call-graph-ordering-file into the specified file">;
 
 def pop_state: F<"pop-state">,
-  HelpText<"Undo the effect of -push-state">;
+  HelpText<"Restore the states saved by --push-state">;
 
 def push_state: F<"push-state">,
-  HelpText<"Save the current state of -as-needed, -static and -whole-archive">;
+  HelpText<"Save the current state of --as-needed, -static and --whole-archive">;
 
 def print_map: F<"print-map">,
   HelpText<"Print a link map to the standard output">;

diff  --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 9db997cddfbe3..d02584e9471bd 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -2171,7 +2171,7 @@ template <class ELFT> void Writer<ELFT>::checkExecuteOnly() {
         if (!(isec->flags & SHF_EXECINSTR))
           error("cannot place " + toString(isec) + " into " +
                 toString(osec->name) +
-                ": -execute-only does not support intermingling data and code");
+                ": --execute-only does not support intermingling data and code");
 }
 
 // The linker is expected to define SECNAME_start and SECNAME_end

diff  --git a/lld/docs/ld.lld.1 b/lld/docs/ld.lld.1
index 04f0982b4ced4..da43cf0ef7abf 100644
--- a/lld/docs/ld.lld.1
+++ b/lld/docs/ld.lld.1
@@ -486,7 +486,7 @@ Save the current state of
 and
 .Fl -whole-archive.
 .It Fl -pop-state
-Undo the effect of
+Restore the states saved by
 .Fl -push-state.
 .It Fl -relocatable , Fl r
 Create relocatable object file.

diff  --git a/lld/test/ELF/execute-only-mixed-data.s b/lld/test/ELF/execute-only-mixed-data.s
index 5a03d730893e2..e0a31afb9e902 100644
--- a/lld/test/ELF/execute-only-mixed-data.s
+++ b/lld/test/ELF/execute-only-mixed-data.s
@@ -16,7 +16,7 @@
 // RUN: }" > %t.lds
 // RUN: ld.lld -T%t.lds %t.o -o %t -execute-only 2>&1
 
-// CHECK: cannot place {{.*}}:(.rodata.foo) into .text: -execute-only does not support intermingling data and code
+// CHECK: cannot place {{.*}}:(.rodata.foo) into .text: --execute-only does not support intermingling data and code
 
     br lr
 


        


More information about the llvm-commits mailing list