mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-04 08:16:49 +00:00
[lld] Fix trivial typos in comments
Reviewed By: ruiu, MaskRay Differential Revision: https://reviews.llvm.org/D72196
This commit is contained in:
parent
5b24c08817
commit
7ae3d33546
@ -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) {
|
||||
|
@ -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).
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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).
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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");
|
||||
|
@ -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. "
|
||||
|
@ -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
|
||||
|
@ -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 §ion,
|
||||
uint64_t offsetInSect,
|
||||
|
@ -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.
|
||||
|
@ -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_$_");
|
||||
|
@ -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.
|
||||
|
@ -253,7 +253,7 @@ void atomFromSymbol(DefinedAtom::ContentType atomType, const Section §ion,
|
||||
? 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 {
|
||||
|
@ -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");
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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).
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user