[lld] NFC: fix trivial typos in comments

Differential Revision: https://reviews.llvm.org/D72339
This commit is contained in:
Kazuaki Ishizaki
2020-04-02 01:21:08 +09:00
parent 153dadf3a3
commit 7c5fcb3591
40 changed files with 50 additions and 50 deletions

View File

@@ -137,7 +137,7 @@ getRelaTocSymAndAddend(InputSectionBase *tocSec, uint64_t offset) {
// When accessing a symbol defined in another translation unit, compilers
// reserve a .toc entry, allocate a local label and generate toc-indirect
// instuctions:
// instructions:
//
// addis 3, 2, .LC0@toc@ha # R_PPC64_TOC16_HA
// ld 3, .LC0@toc@l(3) # R_PPC64_TOC16_LO_DS, load the address from a .toc entry

View File

@@ -263,7 +263,7 @@ DenseMap<const InputSectionBase *, int> CallGraphSort::run() {
// 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³ huristic. All clusters are then sorted by a density
// according to the C³ heuristic. All clusters are then sorted by a density
// metric to further improve locality.
DenseMap<const InputSectionBase *, int> computeCallGraphProfileOrder() {
return CallGraphSort().run();

View File

@@ -708,7 +708,7 @@ static uint64_t getRelocTargetVA(const InputFile *file, RelType type, int64_t a,
// ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf
// microMIPS variants of these relocations use slightly different
// expressions: AHL + GP - P + 3 for %lo() and AHL + GP - P - 1 for %hi()
// to correctly handle less-sugnificant bit of the microMIPS symbol.
// to correctly handle less-significant bit of the microMIPS symbol.
uint64_t v = in.mipsGot->getGp(file) + a - p;
if (type == R_MIPS_LO16 || type == R_MICROMIPS_LO16)
v += 4;

View File

@@ -187,7 +187,7 @@ static std::vector<StringRef> tokenizeExpr(StringRef s) {
break;
}
// Get a token before the opreator.
// Get a token before the operator.
if (e != 0)
ret.push_back(s.substr(0, e));

View File

@@ -2151,7 +2151,7 @@ template <class ELFT> void SymbolTableSection<ELFT>::writeTo(uint8_t *buf) {
eSym->st_size = sym->getSize();
// st_value is usually an address of a symbol, but that has a
// special meaining for uninstantiated common symbols (this can
// special meaning for uninstantiated common symbols (this can
// occur if -r is given).
if (BssSection *commonSec = getCommonSec(ent.sym))
eSym->st_value = commonSec->alignment;
@@ -2250,7 +2250,7 @@ size_t SymtabShndxSection::getSize() const {
// DSOs. That means resolving all dynamic symbols takes O(m)*O(n)
// where m is the number of DSOs and n is the number of dynamic
// symbols. For modern large programs, both m and n are large. So
// making each step faster by using hash tables substiantially
// making each step faster by using hash tables substantially
// improves time to load programs.
//
// (Note that this is not the only way to design the shared library.

View File

@@ -364,7 +364,7 @@ private:
// Try to merge two GOTs. In case of success the `Dst` contains
// result of merging and the function returns true. In case of
// ovwerflow the `Dst` is unchanged and the function returns false.
// overflow the `Dst` is unchanged and the function returns false.
bool tryMergeGots(FileGot & dst, FileGot & src, bool isPrimary);
};

View File

@@ -91,7 +91,7 @@ public:
/// Some relocations require a symbol and a value (e.g. foo + 4).
virtual Addend addend() const = 0;
/// During linking, some optimzations may change addend value.
/// During linking, some optimizations may change addend value.
virtual void setAddend(Addend) = 0;
/// Returns target specific attributes of the reference.

View File

@@ -61,7 +61,7 @@ public:
/// Used by GOTPass to update GOT References.
void updateReferenceToGOT(const Reference *ref, bool targetNowGOT) override {
// If GOT slot was instanciated, transform:
// If GOT slot was instantiated, transform:
// gotPage21/gotOffset12 -> page21/offset12scale8
// If GOT slot optimized away, transform:
// gotPage21/gotOffset12 -> page21/addOffset12

View File

@@ -576,5 +576,5 @@ void addCompactUnwindPass(PassManager &pm, const MachOLinkingContext &ctx) {
pm.add(std::make_unique<CompactUnwindPass>(ctx));
}
} // end namesapce mach_o
} // end namesapce lld
} // end namespace mach_o
} // end namespace lld

View File

@@ -179,5 +179,5 @@ void addGOTPass(PassManager &pm, const MachOLinkingContext &ctx) {
pm.add(std::make_unique<GOTPass>(ctx));
}
} // end namesapce mach_o
} // end namesapce lld
} // end namespace mach_o
} // end namespace lld

View File

@@ -136,5 +136,5 @@ void addTLVPass(PassManager &pm, const MachOLinkingContext &ctx) {
pm.add(std::make_unique<TLVPass>(ctx));
}
} // end namesapce mach_o
} // end namesapce lld
} // end namespace mach_o
} // end namespace lld

View File

@@ -3,7 +3,7 @@
# RUN: lld-link -entry:main -nodefaultlib %t.obj -out:%t.exe
# RUN: llvm-readobj %t.exe -sections -section-data | FileCheck %s
# Section relocations against absolute symbols resolve to the last real ouput
# Section relocations against absolute symbols resolve to the last real output
# section index plus one.
.text

View File

@@ -16,7 +16,7 @@ sym4:
.long .Lprologue_end - .Lprologue_start # prologue length
.Lprologue_start:
.byte 1 # minimum instruction length
.byte 1 # maximum operatiosn per instruction
.byte 1 # maximum operations per instruction
.byte 1 # default is_stmt
.byte -5 # line base
.byte 14 # line range
@@ -59,7 +59,7 @@ sym4:
.long .Lprologue2_end - .Lprologue2_start # prologue length
.Lprologue2_start:
.byte 1 # minimum instruction length
.byte 1 # maximum operatiosn per instruction
.byte 1 # maximum operations per instruction
.byte 1 # default is_stmt
.byte -5 # line base
.byte 14 # line range

View File

@@ -14,7 +14,7 @@
# RUN: llvm-objdump -d %t3 | FileCheck %s
# RUN: llvm-objdump -d %t4 | FileCheck --check-prefix=REVERT %s
# inputs contain different constants for instuction movl.
# inputs contain different constants for instruction movl.
# Tests below checks that order of files in command line
# affects on what symbol will be used.
# If flag allow-multiple-definition is enabled the first

View File

@@ -10,7 +10,7 @@
// The range of addresses covered by the table entry is terminated by the
// next table entry. This means that an executable section without a .ARM.exidx
// section does not terminate the range of addresses. To fix this the linker
// synthesises an EXIDX_CANTUNWIND entry for each section wihout a .ARM.exidx
// synthesises an EXIDX_CANTUNWIND entry for each section without a .ARM.exidx
// section.
.syntax unified

View File

@@ -1,7 +1,7 @@
# REQUIRES: x86
## --unresolved-symbols=ignore-all behaves similar to -shared:
## for PLT relocations to undefined symbols, produce dynamic reloctions if we
## for PLT relocations to undefined symbols, produce dynamic relocations if we
## emit .dynsym.
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o

View File

@@ -4,7 +4,7 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %S/Inputs/icf-absolute2.s -o %t2
# RUN: ld.lld %t %t2 -o /dev/null --icf=all --print-icf-sections | FileCheck -allow-empty %s
## Test we do not crash and do not fold sections which relocations reffering to
## Test we do not crash and do not fold sections which relocations referring to
## absolute symbols with a different values.
# CHECK-NOT: selected

View File

@@ -8,7 +8,7 @@
## YAML below contains 2 relocations of type R_X86_64_GOTTPOFF, and a .text
## with fake content filled by 0xFF. That means instructions for relaxation are
## "broken", so they does not match any known valid relaxations. We also generate
## .tls section because we need it for correct proccessing of STT_TLS symbol.
## .tls section because we need it for correct processing of STT_TLS symbol.
!ELF
FileHeader:
Class: ELFCLASS64
@@ -44,4 +44,4 @@ Symbols:
Value: 0x12345
Size: 4
Binding: STB_GLOBAL

View File

@@ -34,7 +34,7 @@ SECTIONS {
# RUN: ld.lld -o %t5 --script %t.script %t.o
# RUN: llvm-objdump --section-headers %t5 | FileCheck %s --check-prefix=ZERO
## Test we fail gracefuly when alignment value is not a power of 2 (#1).
## Test we fail gracefully when alignment value is not a power of 2 (#1).
# RUN: echo "SECTIONS { . = 0x123; . = ALIGN(0x123, 3); .aaa : { *(.aaa) } }" > %t.script
# RUN: not ld.lld -o /dev/null --script %t.script %t.o 2>&1 | FileCheck -check-prefix=ERR %s

View File

@@ -34,7 +34,7 @@
# RUN: ld.lld %t1.o --script %t4.script -o %t4
# RUN: llvm-objdump -s %t4 | FileCheck --check-prefix=SUBALIGN %s
## Test we fail gracefuly when alignment value is not a power of 2.
## Test we fail gracefully when alignment value is not a power of 2.
# RUN: echo "SECTIONS { .aaa : SUBALIGN(3) { *(.aaa*) } }" > %t5.script
# RUN: not ld.lld %t1.o --script %t5.script -o /dev/null 2>&1 | FileCheck --check-prefix=ERR2 %s
# ERR2: {{.*}}.script:1: alignment must be power of 2

View File

@@ -2,7 +2,7 @@
;; Make sure that common symbols are properly internalized.
;; In this file, @a does not interpose any symbol in a DSO,
;; so LTO should be able to internelize it.
;; so LTO should be able to internalize it.
; RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux /dev/null -o %t.so.o
; RUN: ld.lld -shared -o %t.so %t.so.o

View File

@@ -1,7 +1,7 @@
# REQUIRES: mips
# In case of linking PIC and non-PIC code together and generation
# of a relocatable object, all PIC symbols should have STO_MIPS_PIC
# flag in the symbol table of the ouput file.
# flag in the symbol table of the output file.
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t-npic.o
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \

View File

@@ -69,7 +69,7 @@
// ANDROID32-HEADERS: 0x6000000F ANDROID_REL [[ADDR]]
// ANDROID32-HEADERS: 0x60000010 ANDROID_RELSZ [[SIZE]]
// Packed should have the groups of non-relative reloations first, followed
// Packed should have the groups of non-relative relocations first, followed
// by the larger groups of relative relocations (i.e. the 8 and 9 followed
// by the 7.)
// ANDROID32: Section ({{.+}}) .rel.dyn {

View File

@@ -95,7 +95,7 @@ k:
// OutputRelocs-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend
// OutputRelocs-NEXT: R_PPC64_DTPMOD64
// Check that the got has 3 entries, 1 for the TOC and 1 stucture of 2 entries
// Check that the got has 3 entries, 1 for the TOC and 1 structure of 2 entries
// for the tls variables. Also verify the address so we can check the offsets
// we calculate for each relocation type.
// CheckGot: got 00000018 0000000000020100

View File

@@ -16,7 +16,7 @@
# A caller with a stack that is small enough that the addis instruction
# from the split-stack prologue is unneeded, and after the prologue adjustment
# the stack size still fits whithin 16 bits.
# the stack size still fits within 16 bits.
.p2align 2
.global caller_small_stack
.type caller_small_stack, @function
@@ -56,7 +56,7 @@ caller_small_stack:
# CHECK-NEXT: cmpld 7, 12, 0
# CHECK-NEXT: bt- 28, 0x10010204
# A caller that has a stack size that fits whithin 16 bits, but the adjusted
# A caller that has a stack size that fits within 16 bits, but the adjusted
# stack size after prologue adjustment now overflows 16 bits needing both addis
# and addi instructions.
.p2align 2

View File

@@ -39,7 +39,7 @@
# RUN: echo ".globl foo; foo: call bar" | llvm-mc -filetype=obj -triple=x86_64-unknown-linux - -o %t4.o
# RUN: ld.lld --fatal-warnings --warn-backrefs %t1.o --start-lib %t3.o %t4.o --end-lib -o /dev/null
# We don't report backward references to weak symbols as they can be overriden later.
# We don't report backward references to weak symbols as they can be overridden later.
# RUN: echo ".weak foo; foo:" | llvm-mc -filetype=obj -triple=x86_64-unknown-linux - -o %t5.o
# RUN: ld.lld --fatal-warnings --warn-backrefs --start-lib %t5.o --end-lib %t1.o %t2.o -o /dev/null

View File

@@ -1,7 +1,7 @@
# RUN: ld64.lld -arch i386 -macosx_version_min 10.8 %s %p/Inputs/hello-world-x86.yaml -o %t && llvm-nm -m %t | FileCheck %s
# RUN: not ld64.lld -arch i386 -ios_simulator_version_min 5.0 %s %p/Inputs/hello-world-x86.yaml -o %t 2>&1 | FileCheck %s --check-prefix=ERROR
#
# Test that i386 can link with a macos version but gives an error with a simululator version.
# Test that i386 can link with a macos version but gives an error with a simulator version.
#
--- !mach-o

View File

@@ -1,7 +1,7 @@
# RUN: not ld64.lld -arch x86_64 -r -print_atoms %s -o %t 2> %t.err
# RUN: FileCheck %s < %t.err
#
# Test for error if literal section is not correct size mulitple.
# Test for error if literal section is not correct size multiple.
#
--- !mach-o

View File

@@ -1,4 +1,4 @@
; Verify that the entry point signauture can be flexible.
; Verify that the entry point signature can be flexible.
; RUN: llc -filetype=obj %s -o %t.o
; RUN: wasm-ld -o %t1.wasm %t.o

View File

@@ -1,7 +1,7 @@
; Optional linker-synthetic symbols are only created if they are undefined
; in the final output.
; 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*
; symbol caused an undefined reference to an optional symbol to occur *after*
; the optional symbols were created.
; RUN: llc -filetype=obj %s -o %t.o

View File

@@ -3,7 +3,7 @@
; RUN: not wasm-ld --fatal-warnings %t.o %t1.o -o %t.wasm 2>&1 | FileCheck %s
; Test that functions defined in bitcode correctly report signature
; mistmaches with existing undefined sybmols in normal objects.
; mismatches with existing undefined sybmols in normal objects.
target triple = "wasm32-unknown-unknown"

View File

@@ -8,7 +8,7 @@ target triple = "wasm32-unknown-unknown"
declare i32 @bar()
; Symbols such as foo which are only called indirectly are handled slightly
; differently with resepect to signature checking.
; differently with respect to signature checking.
declare i32 @foo()
@ptr = global i8* bitcast (i32 ()* @foo to i8*), align 8

View File

@@ -4,7 +4,7 @@
; RUN: wasm-ld --fatal-warnings -o %t.wasm %t.main.o %t.ret32.o
; Also test the case where there are two different object files that contains
; referneces ret32:
; references ret32:
; %t.main.o: Does not call ret32 directly; used the wrong signature.
; %t.call-ret32.o: Calls ret32 directly; uses the correct signature.
; RUN: llc -filetype=obj %p/Inputs/call-ret32.ll -o %t.call-ret32.o

View File

@@ -3,7 +3,7 @@ RUN: not wasm-ld -o %t.wasm %t.ret32.o 2>&1 | FileCheck %s
RUN: not wasm-ld --allow-undefined -o %t.wasm %t.ret32.o 2>&1 | FileCheck %s
RUN: not wasm-ld -entry=foo -o %t.wasm %t.ret32.o 2>&1 | FileCheck %s -check-prefix=CHECK-CUSTOM
CHECK: error: entry symbol not defined (pass --no-entry to supress): _start
CHECK-CUSTOM: error: entry symbol not defined (pass --no-entry to supress): foo
CHECK: error: entry symbol not defined (pass --no-entry to suppress): _start
CHECK-CUSTOM: error: entry symbol not defined (pass --no-entry to suppress): foo
RUN: wasm-ld --no-entry -o %t.wasm %t.ret32.o

View File

@@ -3,12 +3,12 @@
; RUN: rm -f %t2.a
; RUN: llvm-ar rcs %t2.a %t2.o
; Test that symbols with hidden visitiblity are not export, even with
; Test that symbols with hidden visibility are not export, even with
; --export-dynamic
; RUN: wasm-ld --export-dynamic %t.o %t2.a -o %t.wasm
; RUN: obj2yaml %t.wasm | FileCheck %s
; Test that symbols with default visitiblity are not exported without
; Test that symbols with default visibility are not exported without
; --export-dynamic
; RUN: wasm-ld %t.o %t2.a -o %t.nodef.wasm
; RUN: obj2yaml %t.nodef.wasm | FileCheck %s -check-prefix=NO-DEFAULT

View File

@@ -784,7 +784,7 @@ void LinkerDriver::link(ArrayRef<const char *> argsArr) {
if (entrySym && entrySym->isDefined())
entrySym->forceExport = true;
else
error("entry symbol not defined (pass --no-entry to supress): " +
error("entry symbol not defined (pass --no-entry to suppress): " +
config->entry);
}

View File

@@ -138,7 +138,7 @@ static void reportTypeError(const Symbol *existing, const InputFile *file,
}
// Check the type of new symbol matches that of the symbol is replacing.
// Returns true if the function types match, false is there is a singature
// Returns true if the function types match, false is there is a signature
// mismatch.
static bool signatureMatches(FunctionSymbol *existing,
const WasmSignature *newSig) {
@@ -279,7 +279,7 @@ Symbol *SymbolTable::addDefinedFunction(StringRef name, uint32_t flags,
std::tie(s, wasInserted) = insert(name, file);
auto replaceSym = [&](Symbol *sym) {
// If the new defined function doesn't have signture (i.e. bitcode
// If the new defined function doesn't have signature (i.e. bitcode
// functions) but the old symbol does, then preserve the old signature
const WasmSignature *oldSig = s->getSignature();
auto* newSym = replaceSymbol<DefinedFunction>(sym, name, flags, file, function);

View File

@@ -108,7 +108,7 @@ private:
llvm::DenseMap<llvm::CachedHashStringRef, int> symMap;
std::vector<Symbol *> symVector;
// For certain symbols types, e.g. function symbols, we allow for muliple
// For certain symbols types, e.g. function symbols, we allow for multiple
// variants of the same symbol with different signatures.
llvm::DenseMap<llvm::CachedHashStringRef, std::vector<Symbol *>> symVariants;

View File

@@ -156,7 +156,7 @@ void Symbol::setGOTIndex(uint32_t index) {
LLVM_DEBUG(dbgs() << "setGOTIndex " << name << " -> " << index << "\n");
assert(gotIndex == INVALID_INDEX);
if (config->isPic) {
// Any symbol that is assigned a GOT entry must be exported othewise the
// Any symbol that is assigned a GOT entry must be exported otherwise the
// dynamic linker won't be able create the entry that contains it.
forceExport = true;
}

View File

@@ -415,7 +415,7 @@ public:
// Lazy symbols can have a signature because they can replace an
// UndefinedFunction which which case we need to be able to preserve the
// signture.
// signature.
// TODO(sbc): This repetition of the signature field is inelegant. Revisit
// the use of class hierarchy to represent symbol taxonomy.
const WasmSignature *signature = nullptr;