diff --git a/lld/Common/Filesystem.cpp b/lld/Common/Filesystem.cpp --- a/lld/Common/Filesystem.cpp +++ b/lld/Common/Filesystem.cpp @@ -87,7 +87,7 @@ // 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) { diff --git a/lld/ELF/Arch/X86.cpp b/lld/ELF/Arch/X86.cpp --- a/lld/ELF/Arch/X86.cpp +++ b/lld/ELF/Arch/X86.cpp @@ -116,7 +116,7 @@ // 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). diff --git a/lld/ELF/ICF.cpp b/lld/ELF/ICF.cpp --- a/lld/ELF/ICF.cpp +++ b/lld/ELF/ICF.cpp @@ -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 diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -296,7 +296,7 @@ } } - // 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); } diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -421,7 +421,7 @@ p->r_addend = getAddend(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); diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -89,7 +89,7 @@ // 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; diff --git a/lld/docs/WebAssembly.rst b/lld/docs/WebAssembly.rst --- a/lld/docs/WebAssembly.rst +++ b/lld/docs/WebAssembly.rst @@ -62,7 +62,7 @@ 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 diff --git a/lld/docs/windows_support.rst b/lld/docs/windows_support.rst --- a/lld/docs/windows_support.rst +++ b/lld/docs/windows_support.rst @@ -28,7 +28,7 @@ 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 diff --git a/lld/include/lld/Core/Atom.h b/lld/include/lld/Core/Atom.h --- a/lld/include/lld/Core/Atom.h +++ b/lld/include/lld/Core/Atom.h @@ -38,7 +38,7 @@ 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). diff --git a/lld/include/lld/Core/Instrumentation.h b/lld/include/lld/Core/Instrumentation.h --- a/lld/include/lld/Core/Instrumentation.h +++ b/lld/include/lld/Core/Instrumentation.h @@ -58,7 +58,7 @@ /// 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; diff --git a/lld/include/lld/Core/Reference.h b/lld/include/lld/Core/Reference.h --- a/lld/include/lld/Core/Reference.h +++ b/lld/include/lld/Core/Reference.h @@ -104,7 +104,7 @@ /// 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; diff --git a/lld/include/lld/ReaderWriter/MachOLinkingContext.h b/lld/include/lld/ReaderWriter/MachOLinkingContext.h --- a/lld/include/lld/ReaderWriter/MachOLinkingContext.h +++ b/lld/include/lld/ReaderWriter/MachOLinkingContext.h @@ -248,7 +248,7 @@ /// 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 diff --git a/lld/lib/Core/Resolver.cpp b/lld/lib/Core/Resolver.cpp --- a/lld/lib/Core/Resolver.cpp +++ b/lld/lib/Core/Resolver.cpp @@ -435,7 +435,7 @@ 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"); diff --git a/lld/lib/Driver/DarwinLdDriver.cpp b/lld/lib/Driver/DarwinLdDriver.cpp --- a/lld/lib/Driver/DarwinLdDriver.cpp +++ b/lld/lib/Driver/DarwinLdDriver.cpp @@ -788,7 +788,7 @@ 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 @@ 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 @@ 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 @@ 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. " diff --git a/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp b/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp --- a/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp +++ b/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp @@ -304,7 +304,7 @@ // 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 commonEncodings; // Now sort the entries by final address and fixup the compact encoding to diff --git a/lld/lib/ReaderWriter/MachO/File.h b/lld/lib/ReaderWriter/MachO/File.h --- a/lld/lib/ReaderWriter/MachO/File.h +++ b/lld/lib/ReaderWriter/MachO/File.h @@ -135,7 +135,7 @@ _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 §ion, uint64_t offsetInSect, diff --git a/lld/lib/ReaderWriter/MachO/GOTPass.cpp b/lld/lib/ReaderWriter/MachO/GOTPass.cpp --- a/lld/lib/ReaderWriter/MachO/GOTPass.cpp +++ b/lld/lib/ReaderWriter/MachO/GOTPass.cpp @@ -109,7 +109,7 @@ 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. diff --git a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp --- a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp +++ b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp @@ -830,7 +830,7 @@ } // 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_$_"); diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp @@ -1267,7 +1267,7 @@ 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 @@ 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. diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp @@ -253,7 +253,7 @@ ? 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 @@ 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 @@ "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 @@ } // 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 { diff --git a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp --- a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp +++ b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp @@ -121,7 +121,7 @@ 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 @@ 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"); diff --git a/lld/test/ELF/aarch64-movw-tprel.s b/lld/test/ELF/aarch64-movw-tprel.s --- a/lld/test/ELF/aarch64-movw-tprel.s +++ b/lld/test/ELF/aarch64-movw-tprel.s @@ -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 diff --git a/lld/test/ELF/linkerscript/assert.s b/lld/test/ELF/linkerscript/assert.s --- a/lld/test/ELF/linkerscript/assert.s +++ b/lld/test/ELF/linkerscript/assert.s @@ -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 diff --git a/lld/test/ELF/ppc64-bsymbolic-toc-restore.s b/lld/test/ELF/ppc64-bsymbolic-toc-restore.s --- a/lld/test/ELF/ppc64-bsymbolic-toc-restore.s +++ b/lld/test/ELF/ppc64-bsymbolic-toc-restore.s @@ -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). diff --git a/lld/test/wasm/export-optional-lazy.ll b/lld/test/wasm/export-optional-lazy.ll --- a/lld/test/wasm/export-optional-lazy.ll +++ b/lld/test/wasm/export-optional-lazy.ll @@ -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. diff --git a/lld/test/wasm/signature-mismatch-unknown.ll b/lld/test/wasm/signature-mismatch-unknown.ll --- a/lld/test/wasm/signature-mismatch-unknown.ll +++ b/lld/test/wasm/signature-mismatch-unknown.ll @@ -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 diff --git a/lld/wasm/Config.h b/lld/wasm/Config.h --- a/lld/wasm/Config.h +++ b/lld/wasm/Config.h @@ -72,7 +72,7 @@ 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; diff --git a/lld/wasm/InputChunks.h b/lld/wasm/InputChunks.h --- a/lld/wasm/InputChunks.h +++ b/lld/wasm/InputChunks.h @@ -83,7 +83,7 @@ // 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 @@ // 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(); diff --git a/lld/wasm/InputFiles.cpp b/lld/wasm/InputFiles.cpp --- a/lld/wasm/InputFiles.cpp +++ b/lld/wasm/InputFiles.cpp @@ -299,8 +299,7 @@ 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; diff --git a/lld/wasm/SymbolTable.cpp b/lld/wasm/SymbolTable.cpp --- a/lld/wasm/SymbolTable.cpp +++ b/lld/wasm/SymbolTable.cpp @@ -203,8 +203,9 @@ } // 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 @@ // 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 @@ -533,7 +534,7 @@ 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 @@ // 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(sym)); continue; } diff --git a/lld/wasm/Symbols.h b/lld/wasm/Symbols.h --- a/lld/wasm/Symbols.h +++ b/lld/wasm/Symbols.h @@ -148,8 +148,8 @@ // 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