[lld] bf6e259 - [ELF] Update comments/diagnostics for some long options to use the canonical two-dash form

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 12:52:11 PDT 2021


Author: Fangrui Song
Date: 2021-10-25T12:52:06-07:00
New Revision: bf6e259b2143b6fbaef53f57ba978ccfb36f0b53

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

LOG: [ELF] Update comments/diagnostics for some long options to use the canonical two-dash form

Rewrite some comments as appropriate.

Added: 
    

Modified: 
    lld/ELF/CallGraphSort.cpp
    lld/ELF/DWARF.cpp
    lld/ELF/Driver.cpp
    lld/ELF/DriverUtils.cpp
    lld/ELF/InputFiles.h
    lld/ELF/LinkerScript.cpp
    lld/ELF/MarkLive.cpp
    lld/ELF/Options.td
    lld/ELF/OutputSections.cpp
    lld/ELF/ScriptParser.cpp
    lld/ELF/SymbolTable.cpp
    lld/ELF/SyntheticSections.cpp
    lld/ELF/Target.cpp
    lld/ELF/Writer.cpp
    lld/test/ELF/format-binary.test

Removed: 
    


################################################################################
diff  --git a/lld/ELF/CallGraphSort.cpp b/lld/ELF/CallGraphSort.cpp
index 15da4d2414ab..aa00d6eadbf9 100644
--- a/lld/ELF/CallGraphSort.cpp
+++ b/lld/ELF/CallGraphSort.cpp
@@ -259,7 +259,7 @@ DenseMap<const InputSectionBase *, int> CallGraphSort::run() {
   return orderMap;
 }
 
-// Sort sections by the profile data provided by -callgraph-profile-file
+// Sort sections by the profile data provided by --callgraph-profile-file.
 //
 // This first builds a call graph based on the profile data then merges sections
 // according to the C³ heuristic. All clusters are then sorted by a density

diff  --git a/lld/ELF/DWARF.cpp b/lld/ELF/DWARF.cpp
index 707a6ebd1695..ecffc063ded8 100644
--- a/lld/ELF/DWARF.cpp
+++ b/lld/ELF/DWARF.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// The -gdb-index option instructs the linker to emit a .gdb_index section.
+// The --gdb-index option instructs the linker to emit a .gdb_index section.
 // The section contains information to make gdb startup faster.
 // The format of the section is described at
 // https://sourceware.org/gdb/onlinedocs/gdb/Index-Section-Format.html.

diff  --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 0a80e81026c3..8f0002f58c3c 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -223,7 +223,6 @@ void LinkerDriver::addFile(StringRef path, bool withLOption) {
     readLinkerScript(mbref);
     return;
   case file_magic::archive: {
-    // Handle -whole-archive.
     if (inWholeArchive) {
       for (const auto &p : getArchiveMembers(mbref))
         files.push_back(createObjectFile(p.first, path, p.second));
@@ -360,10 +359,10 @@ static void checkOptions() {
 
   if (config->executeOnly) {
     if (config->emachine != EM_AARCH64)
-      error("-execute-only is only supported on AArch64 targets");
+      error("--execute-only is only supported on AArch64 targets");
 
     if (config->singleRoRx && !script->hasSectionsCommand)
-      error("-execute-only and -no-rosegment cannot be used together");
+      error("--execute-only and --no-rosegment cannot be used together");
   }
 
   if (config->zRetpolineplt && config->zForceIbt)
@@ -490,10 +489,9 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
   // Handle -v or -version.
   //
   // A note about "compatible with GNU linkers" message: this is a hack for
-  // scripts generated by GNU Libtool 2.4.6 (released in February 2014 and
-  // still the newest version in March 2017) or earlier to recognize LLD as
-  // a GNU compatible linker. As long as an output for the -v option
-  // contains "GNU" or "with BFD", they recognize us as GNU-compatible.
+  // scripts generated by GNU Libtool up to 2021-10 to recognize LLD as
+  // a GNU compatible linker. See
+  // <https://lists.gnu.org/archive/html/libtool/2017-01/msg00007.html>.
   //
   // This is somewhat ugly hack, but in reality, we had no choice other
   // than doing this. Considering the very long release cycle of Libtool,
@@ -592,7 +590,7 @@ static void setUnresolvedSymbolPolicy(opt::InputArgList &args) {
                                               OPT_warn_unresolved_symbols, true)
                                      ? UnresolvedPolicy::ReportError
                                      : UnresolvedPolicy::Warn;
-  // -shared implies -unresolved-symbols=ignore-all because missing
+  // -shared implies --unresolved-symbols=ignore-all because missing
   // symbols are likely to be resolved at runtime.
   bool diagRegular = !config->shared, diagShlib = !config->shared;
 
@@ -773,7 +771,7 @@ static bool getP10StubOpt(opt::InputArgList &args) {
 
 // Parse --build-id or --build-id=<style>. We handle "tree" as a
 // synonym for "sha1" because all our hash functions including
-// -build-id=sha1 are actually tree hashes for performance reasons.
+// --build-id=sha1 are actually tree hashes for performance reasons.
 static std::pair<BuildIdKind, std::vector<uint8_t>>
 getBuildId(opt::InputArgList &args) {
   auto *arg = args.getLastArg(OPT_build_id, OPT_build_id_eq);
@@ -1308,7 +1306,7 @@ static void readConfigs(opt::InputArgList &args) {
     config->emulation = s;
   }
 
-  // Parse -hash-style={sysv,gnu,both}.
+  // Parse --hash-style={sysv,gnu,both}.
   if (auto *arg = args.getLastArg(OPT_hash_style)) {
     StringRef s = arg->getValue();
     if (s == "sysv")
@@ -1318,7 +1316,7 @@ static void readConfigs(opt::InputArgList &args) {
     else if (s == "both")
       config->sysvHash = config->gnuHash = true;
     else
-      error("unknown -hash-style: " + s);
+      error("unknown --hash-style: " + s);
   }
 
   if (args.hasArg(OPT_print_map))
@@ -1461,13 +1459,12 @@ static void setConfigs(opt::InputArgList &args) {
       args.hasFlag(OPT_pcrel_optimize, OPT_no_pcrel_optimize, m == EM_PPC64);
 }
 
-// Returns a value of "-format" option.
 static bool isFormatBinary(StringRef s) {
   if (s == "binary")
     return true;
   if (s == "elf" || s == "default")
     return false;
-  error("unknown -format value: " + s +
+  error("unknown --format value: " + s +
         " (supported formats: elf, default, binary)");
   return false;
 }
@@ -1628,7 +1625,7 @@ static uint64_t getCommonPageSize(opt::InputArgList &args) {
   return val;
 }
 
-// Parses -image-base option.
+// Parses --image-base option.
 static Optional<uint64_t> getImageBase(opt::InputArgList &args) {
   // Because we are using "Config->maxPageSize" here, this function has to be
   // called after the variable is initialized.
@@ -1665,8 +1662,8 @@ static DenseSet<StringRef> getExcludeLibs(opt::InputArgList &args) {
   return ret;
 }
 
-// Handles the -exclude-libs option. If a static library file is specified
-// by the -exclude-libs option, all public symbols from the archive become
+// Handles the --exclude-libs option. If a static library file is specified
+// by the --exclude-libs option, all public symbols from the archive become
 // private unless otherwise specified by version scripts or something.
 // A special library name "ALL" means all archive files.
 //
@@ -2002,20 +1999,20 @@ template <class ELFT> void LinkerDriver::compileBitcodeFiles() {
 }
 
 // The --wrap option is a feature to rename symbols so that you can write
-// wrappers for existing functions. If you pass `-wrap=foo`, all
+// wrappers for existing functions. If you pass `--wrap=foo`, all
 // occurrences of symbol `foo` are resolved to `__wrap_foo` (so, you are
 // expected to write `__wrap_foo` function as a wrapper). The original
 // symbol becomes accessible as `__real_foo`, so you can call that from your
 // wrapper.
 //
-// This data structure is instantiated for each -wrap option.
+// This data structure is instantiated for each --wrap option.
 struct WrappedSymbol {
   Symbol *sym;
   Symbol *real;
   Symbol *wrap;
 };
 
-// Handles -wrap option.
+// Handles --wrap option.
 //
 // This function instantiates wrapper symbols. At this point, they seem
 // like they are not being used at all, so we explicitly set some flags so
@@ -2057,7 +2054,7 @@ static std::vector<WrappedSymbol> addWrappedSymbols(opt::InputArgList &args) {
   return v;
 }
 
-// Do renaming for -wrap and foo at v1 by updating pointers to symbols.
+// Do renaming for --wrap and foo at v1 by updating pointers to symbols.
 //
 // When this function is executed, only InputFiles and symbol table
 // contain pointers to symbol objects. We visit them to replace pointers,
@@ -2170,7 +2167,7 @@ template <class ELFT> static uint32_t getAndFeatures() {
 // all linker scripts have already been parsed.
 template <class ELFT> void LinkerDriver::link(opt::InputArgList &args) {
   llvm::TimeTraceScope timeScope("Link", StringRef("LinkerDriver::Link"));
-  // If a -hash-style option was not given, set to a default value,
+  // If a --hash-style option was not given, set to a default value,
   // which varies depending on the target.
   if (!args.hasArg(OPT_hash_style)) {
     if (config->emachine == EM_MIPS)
@@ -2305,7 +2302,6 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &args) {
   Out::elfHeader = make<OutputSection>("", 0, SHF_ALLOC);
   Out::elfHeader->size = sizeof(typename ELFT::Ehdr);
 
-  // Create wrapped symbols for -wrap option.
   std::vector<WrappedSymbol> wrapped = addWrappedSymbols(args);
 
   // We need to create some reserved symbols such as _end. Create them.
@@ -2340,7 +2336,7 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &args) {
   if (errorCount())
     return;
 
-  // If -thinlto-index-only is given, we should create only "index
+  // If --thinlto-index-only is given, we should create only "index
   // files" and not object files. Index file creation is already done
   // in addCombinedLTOObject, so we are done if that's the case.
   // Likewise, --plugin-opt=emit-llvm and --plugin-opt=emit-asm are the
@@ -2352,7 +2348,7 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &args) {
       !config->thinLTOModulesToCompile.empty())
     return;
 
-  // Apply symbol renames for -wrap and combine foo at v1 and foo@@v1.
+  // Apply symbol renames for --wrap and combine foo at v1 and foo@@v1.
   redirectSymbols(wrapped);
 
   {
@@ -2378,7 +2374,7 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &args) {
       }
 
       // We do not want to emit debug sections if --strip-all
-      // or -strip-debug are given.
+      // or --strip-debug are given.
       if (config->strip == StripPolicy::None)
         return false;
 

diff  --git a/lld/ELF/DriverUtils.cpp b/lld/ELF/DriverUtils.cpp
index f49deb9012b2..54d2d0ae6fb9 100644
--- a/lld/ELF/DriverUtils.cpp
+++ b/lld/ELF/DriverUtils.cpp
@@ -52,8 +52,8 @@ static const opt::OptTable::Info optInfo[] = {
 
 ELFOptTable::ELFOptTable() : OptTable(optInfo) {}
 
-// Set color diagnostics according to -color-diagnostics={auto,always,never}
-// or -no-color-diagnostics flags.
+// Set color diagnostics according to --color-diagnostics={auto,always,never}
+// or --no-color-diagnostics flags.
 static void handleColorDiagnostics(opt::InputArgList &args) {
   auto *arg = args.getLastArg(OPT_color_diagnostics, OPT_color_diagnostics_eq,
                               OPT_no_color_diagnostics);
@@ -150,11 +150,10 @@ void elf::printHelp() {
       "lld", false /*ShowHidden*/, true /*ShowAllAliases*/);
   lld::outs() << "\n";
 
-  // Scripts generated by Libtool versions up to at least 2.4.6 (the most
-  // recent version as of March 2017) expect /: supported targets:.* elf/
-  // in a message for the -help option. If it doesn't match, the scripts
-  // assume that the linker doesn't support very basic features such as
-  // shared libraries. Therefore, we need to print out at least "elf".
+  // Scripts generated by Libtool versions up to 2021-10 expect /: supported
+  // targets:.* elf/ in a message for the --help option. If it doesn't match,
+  // the scripts assume that the linker doesn't support very basic features
+  // such as shared libraries. Therefore, we need to print out at least "elf".
   lld::outs() << config->progName << ": supported targets: elf\n";
 }
 

diff  --git a/lld/ELF/InputFiles.h b/lld/ELF/InputFiles.h
index bd72cfcdd050..5f7169c9135c 100644
--- a/lld/ELF/InputFiles.h
+++ b/lld/ELF/InputFiles.h
@@ -43,8 +43,7 @@ using llvm::object::Archive;
 
 class Symbol;
 
-// If -reproduce option is given, all input files are written
-// to this tar archive.
+// If --reproduce is specified, all input files are written to this tar archive.
 extern std::unique_ptr<llvm::TarWriter> tar;
 
 // Opens a given file.

diff  --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 01785f39ed75..189a703fb508 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -457,7 +457,7 @@ LinkerScript::computeInputSections(const InputSectionDescription *cmd,
       if (!sec->isLive() || sec->parent || seen.contains(i))
         continue;
 
-      // For -emit-relocs we have to ignore entries like
+      // For --emit-relocs we have to ignore entries like
       //   .rela.dyn : { *(.rela.data) }
       // which are common because they are in the default bfd script.
       // We do not ignore SHT_REL[A] linker-synthesized sections here because

diff  --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp
index e828429b421c..bfcab9381cac 100644
--- a/lld/ELF/MarkLive.cpp
+++ b/lld/ELF/MarkLive.cpp
@@ -338,7 +338,7 @@ template <class ELFT> void MarkLive<ELFT>::moveToMain() {
 // so that they are emitted to the output file.
 template <class ELFT> void elf::markLive() {
   llvm::TimeTraceScope timeScope("markLive");
-  // If -gc-sections is not given, no sections are removed.
+  // If --gc-sections is not given, retain all input sections.
   if (!config->gcSections) {
     for (InputSectionBase *sec : inputSections)
       sec->markLive();
@@ -353,7 +353,7 @@ template <class ELFT> void elf::markLive() {
 
   // Otherwise, do mark-sweep GC.
   //
-  // The -gc-sections option works only for SHF_ALLOC sections (sections that
+  // The --gc-sections option works only for SHF_ALLOC sections (sections that
   // are memory-mapped at runtime). So we can unconditionally make non-SHF_ALLOC
   // sections alive except SHF_LINK_ORDER, SHT_REL/SHT_RELA sections, and
   // sections in a group.
@@ -369,7 +369,7 @@ template <class ELFT> void elf::markLive() {
   // We are able to garbage collect them.
   //
   // Note on SHF_REL{,A}: Such sections reach here only when -r
-  // or -emit-reloc were given. And they are subject of garbage
+  // or --emit-reloc were given. And they are subject of garbage
   // collection because, if we remove a text section, we also
   // remove its relocation section.
   //

diff  --git a/lld/ELF/Options.td b/lld/ELF/Options.td
index fa498d1f3022..2bd635693db8 100644
--- a/lld/ELF/Options.td
+++ b/lld/ELF/Options.td
@@ -119,8 +119,8 @@ defm call_graph_profile_sort: BB<"call-graph-profile-sort",
     "Reorder sections with call graph profile (default)",
     "Do not reorder sections with call graph profile">;
 
-// -chroot doesn't have a help text because it is an internal option.
-def chroot: Separate<["--", "-"], "chroot">;
+// --chroot doesn't have a help text because it is an internal option.
+def chroot: Separate<["--"], "chroot">;
 
 defm color_diagnostics: B<"color-diagnostics",
   "Alias for --color-diagnostics=always",

diff  --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 088d1cdc65e4..cc4f0688701a 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -328,7 +328,7 @@ template <class ELFT> void OutputSection::writeTo(uint8_t *buf) {
   if (type == SHT_NOBITS)
     return;
 
-  // If -compress-debug-section is specified and if this is a debug section,
+  // If --compress-debug-section is specified and if this is a debug section,
   // we've already compressed section contents. If that's the case,
   // just write it down.
   if (!compressedData.empty()) {

diff  --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index dcbcfd4b9ba8..ad3b3e61ad59 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -131,7 +131,7 @@ class ScriptParser final : ScriptLexer {
   std::pair<std::vector<SymbolVersion>, std::vector<SymbolVersion>>
   readSymbols();
 
-  // True if a script being read is in a subdirectory specified by -sysroot.
+  // True if a script being read is in the --sysroot directory.
   bool isUnderSysroot = false;
 
   // A set to detect an INCLUDE() cycle.

diff  --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp
index 22e6b4f92898..c309957ee5ba 100644
--- a/lld/ELF/SymbolTable.cpp
+++ b/lld/ELF/SymbolTable.cpp
@@ -32,7 +32,7 @@ using namespace lld::elf;
 SymbolTable *elf::symtab;
 
 void SymbolTable::wrap(Symbol *sym, Symbol *real, Symbol *wrap) {
-  // Swap symbols as instructed by -wrap.
+  // Redirect __real_foo to the original foo and foo to the original __wrap_foo.
   int &idx1 = symMap[CachedHashStringRef(sym->getName())];
   int &idx2 = symMap[CachedHashStringRef(real->getName())];
   int &idx3 = symMap[CachedHashStringRef(wrap->getName())];
@@ -188,7 +188,6 @@ std::vector<Symbol *> SymbolTable::findAllByVersion(SymbolVersion ver,
   return res;
 }
 
-// Handles -dynamic-list.
 void SymbolTable::handleDynamicList() {
   for (SymbolVersion &ver : config->dynamicList) {
     std::vector<Symbol *> syms;

diff  --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index f5e153efed75..a74f03907070 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -2171,7 +2171,7 @@ size_t SymbolTableBaseSection::getSymbolIndex(Symbol *sym) {
     return sym->dynsymIndex;
 
   // Initializes symbol lookup tables lazily. This is used only for -r,
-  // -emit-relocs and dynsyms in partitions other than the main one.
+  // --emit-relocs and dynsyms in partitions other than the main one.
   llvm::call_once(onceFlag, [&] {
     symbolIndexMap.reserve(symbols.size());
     size_t i = 0;
@@ -2350,8 +2350,7 @@ size_t SymtabShndxSection::getSize() const {
 // is to help the dynamic linker resolve symbols quickly. If ELF files
 // don't have them, the dynamic linker has to do linear search on all
 // dynamic symbols, which makes programs slower. Therefore, a .hash
-// section is added to a DSO by default. A .gnu.hash is added if you
-// give the -hash-style=gnu or -hash-style=both option.
+// section is added to a DSO by default.
 //
 // The Unix semantics of resolving dynamic symbols is somewhat expensive.
 // Each ELF file has a list of DSOs that the ELF file depends on and a
@@ -2374,8 +2373,8 @@ size_t SymtabShndxSection::getSize() const {
 // and better version of .hash. .hash is just an on-disk hash table, but
 // .gnu.hash has a bloom filter in addition to a hash table to skip
 // DSOs very quickly. If you are sure that your dynamic linker knows
-// about .gnu.hash, you want to specify -hash-style=gnu. Otherwise, a
-// safe bet is to specify -hash-style=both for backward compatibility.
+// about .gnu.hash, you want to specify --hash-style=gnu. Otherwise, a
+// safe bet is to specify --hash-style=both for backward compatibility.
 GnuHashTableSection::GnuHashTableSection()
     : SyntheticSection(SHF_ALLOC, SHT_GNU_HASH, config->wordsize, ".gnu.hash") {
 }
@@ -2402,7 +2401,7 @@ void GnuHashTableSection::finalizeContents() {
 void GnuHashTableSection::writeTo(uint8_t *buf) {
   // The output buffer is not guaranteed to be zero-cleared because we pre-
   // fill executable sections with trap instructions. This is a precaution
-  // for that case, which happens only when -no-rosegment is given.
+  // for that case, which happens only when --no-rosegment is given.
   memset(buf, 0, size);
 
   // Write a header.

diff  --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index d3e54f7387d7..baf2c1009c3c 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -187,7 +187,7 @@ void TargetInfo::relaxTlsLdToLe(uint8_t *loc, const Relocation &rel,
 }
 
 uint64_t TargetInfo::getImageBase() const {
-  // Use -image-base if set. Fall back to the target default if not.
+  // Use --image-base if set. Fall back to the target default if not.
   if (config->imageBase)
     return *config->imageBase;
   return config->isPic ? 0 : defaultImageBase;

diff  --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index c9b613d82547..d8df753a25f0 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -594,9 +594,8 @@ template <class ELFT> void Writer<ELFT>::run() {
   if (errorCount())
     return;
 
-  // If -compressed-debug-sections is specified, we need to compress
-  // .debug_* sections. Do it right now because it changes the size of
-  // output sections.
+  // If --compressed-debug-sections is specified, compress .debug_* sections.
+  // Do it right now because it changes the size of output sections.
   for (OutputSection *sec : outputSections)
     sec->maybeCompress<ELFT>();
 
@@ -807,7 +806,7 @@ template <class ELFT> void Writer<ELFT>::addSectionSymbols() {
 
     // Unlike other synthetic sections, mergeable output sections contain data
     // copied from input sections, and there may be a relocation pointing to its
-    // contents if -r or -emit-reloc are given.
+    // contents if -r or --emit-reloc is given.
     if (isa<SyntheticSection>(isec) && !(isec->flags & SHF_MERGE))
       continue;
 
@@ -1335,7 +1334,7 @@ static void maybeShuffle(DenseMap<const InputSectionBase *, int> &order) {
 // Builds section order for handling --symbol-ordering-file.
 static DenseMap<const InputSectionBase *, int> buildSectionOrder() {
   DenseMap<const InputSectionBase *, int> sectionOrder;
-  // Use the rarely used option -call-graph-ordering-file to sort sections.
+  // Use the rarely used option --call-graph-ordering-file to sort sections.
   if (!config->callGraphProfile.empty())
     return computeCallGraphProfileOrder();
 
@@ -2247,8 +2246,8 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
 }
 
 // Ensure data sections are not mixed with executable sections when
-// -execute-only is used. -execute-only is a feature to make pages executable
-// but not readable, and the feature is currently supported only on AArch64.
+// --execute-only is used. --execute-only make pages executable but not
+// readable.
 template <class ELFT> void Writer<ELFT>::checkExecuteOnly() {
   if (!config->executeOnly)
     return;
@@ -2975,7 +2974,7 @@ template <class ELFT> void Writer<ELFT>::writeTrapInstr() {
 
 // Write section contents to a mmap'ed file.
 template <class ELFT> void Writer<ELFT>::writeSections() {
-  // In -r or -emit-relocs mode, write the relocation sections first as in
+  // In -r or --emit-relocs mode, write the relocation sections first as in
   // ELf_Rel targets we might find out that we need to modify the relocated
   // section while doing it.
   for (OutputSection *sec : outputSections)

diff  --git a/lld/test/ELF/format-binary.test b/lld/test/ELF/format-binary.test
index 70f132686ce9..bb06d7e5ab9f 100644
--- a/lld/test/ELF/format-binary.test
+++ b/lld/test/ELF/format-binary.test
@@ -38,7 +38,7 @@
 # EXE-NEXT:    0 OBJECT  GLOBAL DEFAULT  ABS _binary_d_t_txt_size
 
 # RUN: not ld.lld -b foo 2>&1 | FileCheck --check-prefix=ERR %s
-# ERR: error: unknown -format value: foo (supported formats: elf, default, binary)
+# ERR: error: unknown --format value: foo (supported formats: elf, default, binary)
 
 ## Non-isalnum bytes are converted to _. See D37331.
 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o d/£.o


        


More information about the llvm-commits mailing list