[lld] Fix trivial typos in comments
authorKazuaki Ishizaki <ishizaki@jp.ibm.com>
Mon, 6 Jan 2020 18:21:05 +0000 (10:21 -0800)
committerFangrui Song <maskray@google.com>
Mon, 6 Jan 2020 18:25:48 +0000 (10:25 -0800)
Reviewed By: ruiu, MaskRay

Differential Revision: https://reviews.llvm.org/D72196

31 files changed:
lld/Common/Filesystem.cpp
lld/ELF/Arch/X86.cpp
lld/ELF/ICF.cpp
lld/ELF/InputFiles.cpp
lld/ELF/InputSection.cpp
lld/ELF/OutputSections.cpp
lld/docs/WebAssembly.rst
lld/docs/windows_support.rst
lld/include/lld/Core/Atom.h
lld/include/lld/Core/Instrumentation.h
lld/include/lld/Core/Reference.h
lld/include/lld/ReaderWriter/MachOLinkingContext.h
lld/lib/Core/Resolver.cpp
lld/lib/Driver/DarwinLdDriver.cpp
lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
lld/lib/ReaderWriter/MachO/File.h
lld/lib/ReaderWriter/MachO/GOTPass.cpp
lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
lld/test/ELF/aarch64-movw-tprel.s
lld/test/ELF/linkerscript/assert.s
lld/test/ELF/ppc64-bsymbolic-toc-restore.s
lld/test/wasm/export-optional-lazy.ll
lld/test/wasm/signature-mismatch-unknown.ll
lld/wasm/Config.h
lld/wasm/InputChunks.h
lld/wasm/InputFiles.cpp
lld/wasm/SymbolTable.cpp
lld/wasm/Symbols.h

index c3d3f99..75e88db 100644 (file)
@@ -87,7 +87,7 @@ void lld::unlinkAsync(StringRef path) {
 // We also don't want to reimplement heuristics to determine if a
 // file is writable. So we'll let FileOutputBuffer do the work.
 //
-// FileOutputBuffer doesn't touch a desitnation file until commit()
+// FileOutputBuffer doesn't touch a destination file until commit()
 // is called. We use that class without calling commit() to predict
 // if the given file is writable.
 std::error_code lld::tryCreateFile(StringRef path) {
index 1e8a10c..c85684b 100644 (file)
@@ -116,7 +116,7 @@ RelExpr X86::getRelExpr(RelType type, const Symbol &s,
     // address at runtime (which means code is position-independent but
     // compilers need to emit extra code for each GOT access.) This decision
     // is made at compile-time. In the latter case, compilers emit code to
-    // load an GOT address to a register, which is usually %ebx.
+    // load a GOT address to a register, which is usually %ebx.
     //
     // So, there are two ways to refer to symbol foo's GOT entry: foo@GOT or
     // foo@GOT(%ebx).
index 5e38066..8992b65 100644 (file)
@@ -42,7 +42,7 @@
 //    relocation targets. Relocation targets are considered equivalent if
 //    their targets are in the same equivalence class. Sections with
 //    different relocation targets are put into different equivalence
-//    clases.
+//    classes.
 //
 // 3. If we split an equivalence class in step 2, two relocations
 //    previously target the same equivalence class may now target
index 04bad8e..43978cd 100644 (file)
@@ -296,7 +296,7 @@ Optional<DILineInfo> ObjFile<ELFT>::getDILineInfo(InputSectionBase *s,
     }
   }
 
-  // Use fake address calcuated by adding section file offset and offset in
+  // Use fake address calculated by adding section file offset and offset in
   // section. See comments for ObjectInfo class.
   return dwarf->getDILineInfo(s->getOffsetInFile() + offset, sectionIndex);
 }
index 25375ea..aab272f 100644 (file)
@@ -421,7 +421,7 @@ void InputSection::copyRelocations(uint8_t *buf, ArrayRef<RelTy> rels) {
       p->r_addend = getAddend<ELFT>(rel);
 
     // Output section VA is zero for -r, so r_offset is an offset within the
-    // section, but for --emit-relocs it is an virtual address.
+    // section, but for --emit-relocs it is a virtual address.
     p->r_offset = sec->getVA(rel.r_offset);
     p->setSymbolAndType(in.symTab->getSymbolIndex(&sym), type,
                         config->isMips64EL);
index 8d32862..6142cb0 100644 (file)
@@ -89,7 +89,7 @@ static bool canMergeToProgbits(unsigned type) {
 // InputSection post finalizeInputSections(), then you must do the following:
 //
 // 1. Find or create an InputSectionDescription to hold InputSection.
-// 2. Add the InputSection to the InputSectionDesciption::sections.
+// 2. Add the InputSection to the InputSectionDescription::sections.
 // 3. Call commitSection(isec).
 void OutputSection::recordSection(InputSectionBase *isec) {
   partition = isec->partition;
index 92bae2a..7f4a688 100644 (file)
@@ -62,7 +62,7 @@ WebAssembly-specific options:
   Relocation targets in the code section 5-bytes wide in order to potentially
   occomate the largest LEB128 value.  This option will cause the linker to
   shirnk the code section to remove any padding from the final output.  However
-  because it effects code offset, this option is not comatible with outputing
+  because it effects code offset, this option is not compatible with outputing
   debug information.
 
 .. option:: --allow-undefined
index c9723c4..620040e 100644 (file)
@@ -28,7 +28,7 @@ Development status
 
 Driver
   :good:`Mostly done`. Some exotic command line options that are not usually
-  used for application develompent, such as ``/DRIVER``, are not supported.
+  used for application development, such as ``/DRIVER``, are not supported.
 
 Linking against DLL
   :good:`Done`. LLD can read import libraries needed to link against DLL. Both
index 4d3d27a..d89792d 100644 (file)
@@ -38,7 +38,7 @@ public:
     definitionSharedLibrary ///< Only in shared libraries to model export.
   };
 
-  /// The scope in which this atom is acessible to other atoms.
+  /// The scope in which this atom is accessible to other atoms.
   enum Scope {
     scopeTranslationUnit,  ///< Accessible only to atoms in the same translation
                            ///  unit (e.g. a C static).
index 602a37a..e0b1145 100644 (file)
@@ -58,7 +58,7 @@ public:
 /// Each thread has its own task stack and tasks nest recursively on that stack.
 /// A task cannot transfer threads.
 ///
-/// SBRM is used to ensure task starts and ends are ballanced. The lifetime of
+/// SBRM is used to ensure task starts and ends are balanced. The lifetime of
 /// a task is either the lifetime of this object, or until end is called.
 class ScopedTask {
   __itt_domain *_domain;
index 191e0f0..4769882 100644 (file)
@@ -104,7 +104,7 @@ protected:
 
   /// The memory for Reference objects is always managed by the owning File
   /// object.  Therefore, no one but the owning File object should call
-  /// delete on an Reference.  In fact, some File objects may bulk allocate
+  /// delete on a Reference.  In fact, some File objects may bulk allocate
   /// an array of References, so they cannot be individually deleted by anyone.
   virtual ~Reference() = default;
 
index a950fd5..cd57604 100644 (file)
@@ -248,7 +248,7 @@ public:
   /// installed dynamic library.
   uint32_t compatibilityVersion() const { return _compatibilityVersion; }
 
-  /// The dylib's current version, in the the raw uint32 format.
+  /// The dylib's current version, in the raw uint32 format.
   ///
   /// When building a dynamic library, this is the current version that gets
   /// embedded into the result. Other Mach-O binaries that link against
index 8811913..d1c3d81 100644 (file)
@@ -435,7 +435,7 @@ bool Resolver::checkUndefines() {
   return true;
 }
 
-// remove from _atoms all coaleseced away atoms
+// Remove from _atoms all coalesced away atoms.
 void Resolver::removeCoalescedAwayAtoms() {
   DEBUG_WITH_TYPE("resolver",
                   llvm::dbgs() << "******** Removing coalesced away atoms:\n");
index 10e0aa3..062e945 100644 (file)
@@ -788,7 +788,7 @@ bool parse(llvm::ArrayRef<const char *> args, MachOLinkingContext &ctx) {
         break;
       case llvm::MachO::MH_EXECUTE:
         // dynamic executables default to generating a version load command,
-        // while static exectuables only generate it if required.
+        // while static executables only generate it if required.
         if (isStaticExecutable) {
           if (flagOn)
             ctx.setGenerateVersionLoadCommand(true);
@@ -836,7 +836,7 @@ bool parse(llvm::ArrayRef<const char *> args, MachOLinkingContext &ctx) {
         break;
       case llvm::MachO::MH_EXECUTE:
         // dynamic executables default to generating a version load command,
-        // while static exectuables only generate it if required.
+        // while static executables only generate it if required.
         if (isStaticExecutable) {
           if (flagOn)
             ctx.setGenerateFunctionStartsLoadCommand(true);
@@ -885,7 +885,7 @@ bool parse(llvm::ArrayRef<const char *> args, MachOLinkingContext &ctx) {
         break;
       case llvm::MachO::MH_EXECUTE:
         // dynamic executables default to generating a version load command,
-        // while static exectuables only generate it if required.
+        // while static executables only generate it if required.
         if (isStaticExecutable) {
           if (flagOn)
             ctx.setGenerateDataInCodeLoadCommand(true);
@@ -926,7 +926,7 @@ bool parse(llvm::ArrayRef<const char *> args, MachOLinkingContext &ctx) {
     ctx.setSdkVersion(sdkVersion);
   } else if (ctx.generateVersionLoadCommand()) {
     // If we don't have an sdk version, but were going to emit a load command
-    // with min_version, then we need to give an warning as we have no sdk
+    // with min_version, then we need to give a warning as we have no sdk
     // version to put in that command.
     // FIXME: We need to decide whether to make this an error.
     warn("-sdk_version is required when emitting min version load command.  "
index 44e6a29..94a105a 100644 (file)
@@ -304,7 +304,7 @@ private:
     // also probably be sorted by frequency.
     assert(personalities.size() <= 4);
 
-    // TODO: Find commmon encodings for use by compressed pages.
+    // TODO: Find common encodings for use by compressed pages.
     std::vector<uint32_t> commonEncodings;
 
     // Now sort the entries by final address and fixup the compact encoding to
index 1cc1c41..0727029 100644 (file)
@@ -135,7 +135,7 @@ public:
     _undefAtoms[name] = atom;
   }
 
-  /// Search this file for an the atom from 'section' that covers
+  /// Search this file for the atom from 'section' that covers
   /// 'offsetInSect'.  Returns nullptr is no atom found.
   MachODefinedAtom *findAtomCoveringAddress(const Section &section,
                                             uint64_t offsetInSect,
index 514dd4e..0f80dfa 100644 (file)
@@ -109,7 +109,7 @@ private:
         assert(target != nullptr);
 
         if (!shouldReplaceTargetWithGOTAtom(target, canBypassGOT)) {
-          // Update reference kind to reflect that target is a direct accesss.
+          // Update reference kind to reflect that target is a direct access.
           _archHandler.updateReferenceToGOT(ref, false);
         } else {
           // Replace the target with a reference to a GOT entry.
index 221d895..0be1c10 100644 (file)
@@ -830,7 +830,7 @@ void MachOLinkingContext::addExportSymbol(StringRef sym) {
   }
   // Only i386 MacOSX uses old ABI, so don't change those.
   if ((_os != OS::macOSX) || (_arch != arch_x86)) {
-    // ObjC has two differnent ABIs.  Be nice and allow one export list work for
+    // ObjC has two different ABIs.  Be nice and allow one export list work for
     // both ABIs by renaming symbols.
     if (sym.startswith(".objc_class_name_")) {
       std::string abi2className("_OBJC_CLASS_$_");
index ab7ea7e..17b45b9 100644 (file)
@@ -1267,7 +1267,7 @@ void TrieNode::addSymbol(const Export& entry,
       edge._child->addSymbol(entry, allocator, allNodes);
       return;
     }
-    // See if string has commmon prefix with existing edge.
+    // See if string has common prefix with existing edge.
     for (int n=edgeStr.size()-1; n > 0; --n) {
       if (partialStr.substr(0, n).equals(edgeStr.substr(0, n))) {
         // Splice in new node:  was A -> C,  now A -> B -> C
@@ -1351,7 +1351,7 @@ bool TrieNode::updateOffset(uint32_t& offset) {
     nodeSize += llvm::getULEB128Size(nodeSize);
   }
   // Compute size of all child edges.
-  ++nodeSize; // Byte for number of chidren.
+  ++nodeSize; // Byte for number of children.
   for (TrieEdge &edge : _children) {
     nodeSize += edge._subString.size() + 1 // String length.
               + llvm::getULEB128Size(edge._child->_trieOffset); // Offset len.
index 6f294b1..3347bb1 100644 (file)
@@ -253,7 +253,7 @@ void atomFromSymbol(DefinedAtom::ContentType atomType, const Section &section,
                               ? DefinedAtom::mergeAsWeak : DefinedAtom::mergeNo;
     bool thumb = (symbolDescFlags & N_ARM_THUMB_DEF);
     if (atomType == DefinedAtom::typeUnknown) {
-      // Mach-O needs a segment and section name.  Concatentate those two
+      // Mach-O needs a segment and section name.  Concatenate those two
       // with a / separator (e.g. "seg/sect") to fit into the lld model
       // of just a section name.
       std::string segSectName = section.segmentName.str()
@@ -326,7 +326,7 @@ llvm::Error processSymboledSection(DefinedAtom::ContentType atomType,
     return llvm::Error::success();
 
   if (symbols.empty()) {
-    // Section has no symbols, put all content in one anoymous atom.
+    // Section has no symbols, put all content in one anonymous atom.
     atomFromSymbol(atomType, section, file, section.address, StringRef(),
                   0, Atom::scopeTranslationUnit,
                   section.address + section.content.size(),
@@ -471,7 +471,7 @@ llvm::Error processSection(DefinedAtom::ContentType atomType,
                                               "is not zero terminated.");
       }
       if (customSectionName) {
-        // Mach-O needs a segment and section name.  Concatentate those two
+        // Mach-O needs a segment and section name.  Concatenate those two
         // with a / separator (e.g. "seg/sect") to fit into the lld model
         // of just a section name.
         std::string segSectName = section.segmentName.str()
@@ -1460,7 +1460,7 @@ normalizedObjectToAtoms(MachOFile *file,
   }
   // Create atoms from undefined symbols.
   for (auto &sym : normalizedFile.undefinedSymbols) {
-    // Undefinded symbols with n_value != 0 are actually tentative definitions.
+    // Undefined symbols with n_value != 0 are actually tentative definitions.
     if (sym.value == Hex64(0)) {
       file->addUndefinedAtom(sym.name, copyRefs);
     } else {
index 7793639..23c20aa 100644 (file)
@@ -121,7 +121,7 @@ public:
       StringRef newName = copyString(buffer.str());
       _refNames[&atom] = newName;
       DEBUG_WITH_TYPE("WriterYAML",
-                      llvm::dbgs() << "name collsion: creating ref-name: '"
+                      llvm::dbgs() << "name collision: creating ref-name: '"
                                    << newName << "' ("
                                    << (const void *)newName.data()
                                    << ", " << newName.size() << ")\n");
@@ -135,7 +135,7 @@ public:
         StringRef newName2 = copyString(buffer2.str());
         _refNames[prevAtom] = newName2;
         DEBUG_WITH_TYPE("WriterYAML",
-                        llvm::dbgs() << "name collsion: creating ref-name: '"
+                        llvm::dbgs() << "name collision: creating ref-name: '"
                                      << newName2 << "' ("
                                      << (const void *)newName2.data() << ", "
                                      << newName2.size() << ")\n");
index f2eedf8..dd7eae3 100644 (file)
@@ -4,7 +4,7 @@
 # RUN: llvm-objdump --no-show-raw-insn -d %t | FileCheck %s
 # RUN: llvm-readobj --symbols %t | FileCheck --check-prefix=CHECK-SYM %s
 
-## Test the the local exec relocations that map to:
+## Test the local exec relocations that map to:
 ## R_AARCH64_TLSLE_MOVW_TPREL_G2
 ## R_AARCH64_TLSLE_MOVW_TPREL_G1
 ## R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
index b1ca86e..eacca25 100644 (file)
@@ -25,7 +25,7 @@
 # RUN: ld.lld -shared -o %t5 --script %t5.script %t1.o
 # RUN: llvm-readobj %t5 > /dev/null
 
-## Test assertions inside of output section decriptions.
+## Test assertions inside of output section descriptions.
 # RUN: echo "SECTIONS { .foo : { *(.foo) ASSERT(SIZEOF(.foo) == 8, \"true\"); } }" > %t6.script
 # RUN: ld.lld -shared -o %t6 --script %t6.script %t1.o
 # RUN: llvm-readobj %t6 > /dev/null
index 929c82c..6cea184 100644 (file)
@@ -15,7 +15,7 @@
 # FAIL: call to def lacks nop, can't restore toc
 
 # Test to document the toc-restore behavior with -Bsymbolic option. Since
-# -Bsymbolic causes the call to bind to the internal defintion we know the
+# -Bsymbolic causes the call to bind to the internal definition we know the
 # caller and callee share the same TOC base. This means branching to the
 # local entry point of the callee, and no need for a nop to follow the call
 # (since there is no need to restore the TOC-pointer after the call).
index 5662b0b..960e71c 100644 (file)
@@ -1,6 +1,6 @@
 ; Optional linker-synthetic symbols are only created if they are undefined
 ; in the final output.
-; This test is for a regression where an explict --export of an lazy archive
+; This test is for a regression where an explicit --export of an lazy archive
 ; symbol caused an undefined referece to an optional symbol to occur *after*
 ; the optional symbols were created.
 
index 9bd97db..b354ed1 100644 (file)
@@ -13,7 +13,7 @@
 
 target triple = "wasm32-unknown-unknown"
 
-; Function declartion with incorrect signature.
+; Function declaration with incorrect signature.
 declare dso_local void @ret32()
 
 ; Simply taking the address of the function should *not* generate the
index cc4bdc1..3b3f2da 100644 (file)
@@ -72,7 +72,7 @@ struct Configuration {
   bool isPic;
 
   // The table offset at which to place function addresses.  We reserve zero
-  // for the null function pointer.  This gets set to 1 for exectuables and 0
+  // for the null function pointer.  This gets set to 1 for executables and 0
   // for shared libraries (since they always added to a dynamic offset at
   // runtime).
   uint32_t tableBase = 0;
index 5d4aebd..030c9a9 100644 (file)
@@ -83,7 +83,7 @@ protected:
 
 // Represents a WebAssembly data segment which can be included as part of
 // an output data segments.  Note that in WebAssembly, unlike ELF and other
-// formats, used the term "data segment" to refer to the continous regions of
+// formats, used the term "data segment" to refer to the continuous regions of
 // memory that make on the data section. See:
 // https://webassembly.github.io/spec/syntax/modules.html#syntax-data
 //
@@ -156,7 +156,7 @@ public:
 
   // The size of a given input function can depend on the values of the
   // LEB relocations within it.  This finalizeContents method is called after
-  // all the symbol values have be calcualted but before getSize() is ever
+  // all the symbol values have be calculated but before getSize() is ever
   // called.
   void calculateSize();
 
index 74308ff..0ea9a37 100644 (file)
@@ -299,8 +299,7 @@ void ObjFile::parse(bool ignoreComdats) {
       customSectionsByIndex[sectionIndex] = customSections.back();
     }
     sectionIndex++;
-    // Scans relocations to dermine determine if a function symbol is called
-    // directly
+    // Scans relocations to determine if a function symbol is called directly.
     for (const WasmRelocation &reloc : section.Relocations)
       if (reloc.Type == R_WASM_FUNCTION_INDEX_LEB)
         isCalledDirectly[reloc.Index] = true;
index 14616f9..598859d 100644 (file)
@@ -203,8 +203,9 @@ DefinedFunction *SymbolTable::addSyntheticFunction(StringRef name,
 }
 
 // Adds an optional, linker generated, data symbols.  The symbol will only be
-// added if there is an undefine reference to it, or if it is explictly exported
-// via the --export flag.  Otherwise we don't add the symbol and return nullptr.
+// added if there is an undefine reference to it, or if it is explicitly
+// exported via the --export flag.  Otherwise we don't add the symbol and return
+// nullptr.
 DefinedData *SymbolTable::addOptionalDataSymbol(StringRef name,
                                                 uint32_t value) {
   Symbol *s = find(name);
@@ -396,7 +397,7 @@ Symbol *SymbolTable::addDefinedEvent(StringRef name, uint32_t flags,
 // This function get called when an undefined symbol is added, and there is
 // already an existing one in the symbols table.  In this case we check that
 // custom 'import-module' and 'import-field' symbol attributes agree.
-// With LTO these attributes are not avialable when the bitcode is read and only
+// With LTO these attributes are not available when the bitcode is read and only
 // become available when the LTO object is read.  In this case we silently
 // replace the empty attributes with the valid ones.
 template <typename T>
@@ -533,7 +534,7 @@ void SymbolTable::addLazy(ArchiveFile *file, const Archive::Symbol *sym) {
     return;
 
   // The existing symbol is undefined, load a new one from the archive,
-  // unless the the existing symbol is weak in which case replace the undefined
+  // unless the existing symbol is weak in which case replace the undefined
   // symbols with a LazySymbol.
   if (s->isWeak()) {
     const WasmSignature *oldSig = nullptr;
@@ -646,7 +647,7 @@ void SymbolTable::handleWeakUndefines() {
       // It is possible for undefined functions not to have a signature (eg. if
       // added via "--undefined"), but weak undefined ones do have a signature.
       // Lazy symbols may not be functions and therefore Sig can still be null
-      // in some circumstantce.
+      // in some circumstance.
       assert(!isa<FunctionSymbol>(sym));
       continue;
     }
index 787ce7d..e621dbc 100644 (file)
@@ -148,8 +148,8 @@ public:
   // are unreferenced except by other bitcode objects.
   bool isUsedInRegularObj : 1;
 
-  // True if ths symbol is explicity marked for export (i.e. via the -e/--export
-  // command line flag)
+  // True if ths symbol is explicitly marked for export (i.e. via the
+  // -e/--export command line flag)
   bool forceExport : 1;
 
   // False if LTO shouldn't inline whatever this symbol points to. If a symbol