[lld][WebAssembly] Update comments mentioning legacy function names. NFC

The __wasm_apply_relocs function was split into two separate
functions as part of https://reviews.llvm.org/D93066 but these
comments were not correctly updated at the time.

Differential Revision: https://reviews.llvm.org/D95623
This commit is contained in:
Sam Clegg 2021-01-28 08:20:42 -08:00
parent e29552c5af
commit 5c0164890c
5 changed files with 10 additions and 11 deletions

View File

@ -132,7 +132,7 @@ declare void @func_external()
; CHECK-NEXT: Index: 2
; CHECK-NEXT: Functions: [ 4, 3 ]
; check the generated code in __wasm_call_ctors and __wasm_apply_relocs functions
; check the generated code in __wasm_call_ctors and __wasm_apply_data_relocs functions
; TODO(sbc): Disassemble and verify instructions.
; CHECK: - Type: CODE

View File

@ -29,7 +29,7 @@ _start:
# Verify that we do not generate dynamic relocations for the GOT entry.
# CHECK-NOT: __wasm_apply_relocs
# CHECK-NOT: __wasm_apply_global_relocs
# Verify that we do not generate an import for foo
@ -45,7 +45,7 @@ _start:
# CHECK-NEXT: Value: 66560
# Global 'undefined_weak:foo' representing the GOT entry for foo
# Unlike other internal GOT entries that need to be mutable this one
# is immutable and not updated by `__wasm_apply_relocs`
# is immutable and not updated by `__wasm_apply_global_relocs`
# CHECK-NEXT: - Index: 1
# CHECK-NEXT: Type: I32
# CHECK-NEXT: Mutable: false

View File

@ -189,7 +189,7 @@ bool MarkLive::isCallCtorsLive() {
return false;
// In Emscripten-style PIC, we call `__wasm_call_ctors` which calls
// `__wasm_apply_relocs`.
// `__wasm_apply_data_relocs`.
if (config->isPic)
return true;

View File

@ -333,7 +333,7 @@ void GlobalSection::writeBody() {
WasmGlobal global;
// In the case of dynamic linking, internal GOT entries
// need to be mutable since they get updated to the correct
// runtime value during `__wasm_apply_relocs`.
// runtime value during `__wasm_apply_global_relocs`.
bool mutable_ = config->isPic & !sym->isStub;
global.Type = {WASM_TYPE_I32, mutable_};
global.InitExpr.Opcode = WASM_OPCODE_I32_CONST;

View File

@ -1121,8 +1121,8 @@ void Writer::createStartFunction() {
// For -shared (PIC) output, we create create a synthetic function which will
// apply any relocations to the data segments on startup. This function is
// called __wasm_apply_relocs and is added at the beginning of __wasm_call_ctors
// before any of the constructors run.
// called `__wasm_apply_data_relocs` and is added at the beginning of
// `__wasm_call_ctors` before any of the constructors run.
void Writer::createApplyDataRelocationsFunction() {
LLVM_DEBUG(dbgs() << "createApplyDataRelocationsFunction\n");
// First write the body's contents to a string.
@ -1160,7 +1160,7 @@ void Writer::createApplyGlobalRelocationsFunction() {
// in input object.
void Writer::createCallCtorsFunction() {
// If __wasm_call_ctors isn't referenced, there aren't any ctors, and we
// aren't calling `__wasm_apply_relocs` for Emscripten-style PIC, don't
// aren't calling `__wasm_apply_data_relocs` for Emscripten-style PIC, don't
// define the `__wasm_call_ctors` function.
if (!WasmSym::callCtors->isLive() && !WasmSym::applyDataRelocs &&
initFunctions.empty())
@ -1203,9 +1203,8 @@ void Writer::createCommandExportWrapper(uint32_t functionIndex,
raw_string_ostream os(bodyContent);
writeUleb128(os, 0, "num locals");
// If we have any ctors, or we're calling `__wasm_apply_relocs` for
// Emscripten-style PIC, call `__wasm_call_ctors` which performs those
// calls.
// Call `__wasm_call_ctors` which call static constructors (and
// applies any runtime relocations in Emscripten-style PIC mode)
if (WasmSym::callCtors->isLive()) {
writeU8(os, WASM_OPCODE_CALL, "CALL");
writeUleb128(os, WasmSym::callCtors->getFunctionIndex(),