diff options
Diffstat (limited to 'lld/wasm/SyntheticSections.h')
| -rw-r--r-- | lld/wasm/SyntheticSections.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lld/wasm/SyntheticSections.h b/lld/wasm/SyntheticSections.h index 88dc1fed87f..1557ce79d2d 100644 --- a/lld/wasm/SyntheticSections.h +++ b/lld/wasm/SyntheticSections.h @@ -175,17 +175,23 @@ class GlobalSection : public SyntheticSection { public: GlobalSection() : SyntheticSection(llvm::wasm::WASM_SEC_GLOBAL) {} uint32_t numGlobals() const { - return inputGlobals.size() + definedFakeGlobals.size() + gotSymbols.size(); + assert(isSealed); + return inputGlobals.size() + dataAddressGlobals.size() + + staticGotSymbols.size(); } bool isNeeded() const override { return numGlobals() > 0; } void assignIndexes() override; void writeBody() override; void addGlobal(InputGlobal *global); - void addDummyGOTEntry(Symbol *sym); + void addDataAddressGlobal(DefinedData *global); + void addStaticGOTEntry(Symbol *sym); + + std::vector<const DefinedData *> dataAddressGlobals; - std::vector<const DefinedData *> definedFakeGlobals; +protected: + bool isSealed = false; std::vector<InputGlobal *> inputGlobals; - std::vector<Symbol *> gotSymbols; + std::vector<Symbol *> staticGotSymbols; }; // The event section contains a list of declared wasm events associated with the |

