[ELF] Delete --no-cref which does not exist in GNU ld
authorFangrui Song <i@maskray.me>
Sun, 20 Jun 2021 21:28:56 +0000 (14:28 -0700)
committerFangrui Song <i@maskray.me>
Sun, 20 Jun 2021 21:28:56 +0000 (14:28 -0700)
Also delete the single dash form which does not appear to be used.

lld/ELF/Driver.cpp
lld/ELF/Options.td
lld/test/ELF/cref.s
lld/test/ELF/just-symbols-cref.s

index c3adeec..b654bb8 100644 (file)
@@ -964,7 +964,7 @@ static void readConfigs(opt::InputArgList &args) {
       args.hasFlag(OPT_check_sections, OPT_no_check_sections, true);
   config->chroot = args.getLastArgValue(OPT_chroot);
   config->compressDebugSections = getCompressDebugSections(args);
-  config->cref = args.hasFlag(OPT_cref, OPT_no_cref, false);
+  config->cref = args.hasArg(OPT_cref);
   config->defineCommon = args.hasFlag(OPT_define_common, OPT_no_define_common,
                                       !args.hasArg(OPT_relocatable));
   config->optimizeBBJumps =
index 8af1255..590a2ca 100644 (file)
@@ -126,9 +126,7 @@ def color_diagnostics_eq: J<"color-diagnostics=">,
   HelpText<"Use colors in diagnostics (default: auto)">,
   MetaVarName<"[auto,always,never]">;
 
-defm cref: B<"cref",
-    "Output cross reference table",
-    "Do not output cross reference table">;
+def cref: FF<"cref">, HelpText<"Output cross reference table">;
 
 defm define_common: B<"define-common",
     "Assign space to common symbols",
index a5ad748..3098920 100644 (file)
@@ -7,7 +7,7 @@
 // RUN: llvm-ar rcs %t.a %ta.o
 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t3.o
 // RUN: ld.lld -shared -o %t1.so %t1.o
-// RUN: ld.lld -o /dev/null %t1.so %t2.o %t3.o %t.a -gc-sections -cref | FileCheck -strict-whitespace %s
+// RUN: ld.lld -o /dev/null %t1.so %t2.o %t3.o %t.a --gc-sections --cref | FileCheck -strict-whitespace %s
 
 //      CHECK: Symbol                                            File
 // CHECK-NEXT: foo                                               {{.*}}1.so
index 4aad58c..c58e0ce 100644 (file)
@@ -3,7 +3,7 @@
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
 # RUN: ld.lld %t.o -o %t1.exe -Ttext=0x10000
 
-# RUN: ld.lld -just-symbols=%t1.exe -o %t2.exe -cref | FileCheck %s
+# RUN: ld.lld --just-symbols=%t1.exe -o %t2.exe --cref | FileCheck %s
 
 # CHECK:      Symbol      File
 # CHECK-NEXT: foo         {{.*exe}}