[lld] 5c01648 - [lld][WebAssembly] Update comments mentioning legacy function names. NFC
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 28 08:57:21 PST 2021
Author: Sam Clegg
Date: 2021-01-28T08:52:14-08:00
New Revision: 5c0164890c2626393f954b79d2779174319dc958
URL: https://github.com/llvm/llvm-project/commit/5c0164890c2626393f954b79d2779174319dc958
DIFF: https://github.com/llvm/llvm-project/commit/5c0164890c2626393f954b79d2779174319dc958.diff
LOG: [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
Added:
Modified:
lld/test/wasm/shared.ll
lld/test/wasm/weak-undefined-pic.s
lld/wasm/MarkLive.cpp
lld/wasm/SyntheticSections.cpp
lld/wasm/Writer.cpp
Removed:
################################################################################
diff --git a/lld/test/wasm/shared.ll b/lld/test/wasm/shared.ll
index 61337fcc6a3a..28ef9b6470d1 100644
--- a/lld/test/wasm/shared.ll
+++ b/lld/test/wasm/shared.ll
@@ -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
diff --git a/lld/test/wasm/weak-undefined-pic.s b/lld/test/wasm/weak-undefined-pic.s
index 17dbc54faf7c..b0f31e1a12d9 100644
--- a/lld/test/wasm/weak-undefined-pic.s
+++ b/lld/test/wasm/weak-undefined-pic.s
@@ -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
diff --git a/lld/wasm/MarkLive.cpp b/lld/wasm/MarkLive.cpp
index f21774b0eec1..23c9ae83696f 100644
--- a/lld/wasm/MarkLive.cpp
+++ b/lld/wasm/MarkLive.cpp
@@ -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;
diff --git a/lld/wasm/SyntheticSections.cpp b/lld/wasm/SyntheticSections.cpp
index 6044601c4e6a..0fc476530833 100644
--- a/lld/wasm/SyntheticSections.cpp
+++ b/lld/wasm/SyntheticSections.cpp
@@ -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;
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp
index 3cf773fc4826..1587e97b5b2d 100644
--- a/lld/wasm/Writer.cpp
+++ b/lld/wasm/Writer.cpp
@@ -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(),
More information about the llvm-commits
mailing list