summaryrefslogtreecommitdiffstats
path: root/lld/wasm/SyntheticSections.h
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2019-09-24 20:52:12 +0000
committerSam Clegg <sbc@chromium.org>2019-09-24 20:52:12 +0000
commit937b95583787086df2e9030d670ae4759b46c566 (patch)
tree899a52ca99cd907c9f41d7bbd0e61cae4c55bd34 /lld/wasm/SyntheticSections.h
parente9e1c88ed95040c6dd47c8d818ad08d0286fd00b (diff)
downloadbcm5719-llvm-937b95583787086df2e9030d670ae4759b46c566.tar.gz
bcm5719-llvm-937b95583787086df2e9030d670ae4759b46c566.zip
[lld][WebAssembly] Fix static linking of -fPIC code with external undefined functions
Differential Revision: https://reviews.llvm.org/D66784 llvm-svn: 372779
Diffstat (limited to 'lld/wasm/SyntheticSections.h')
-rw-r--r--lld/wasm/SyntheticSections.h14
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
OpenPOWER on IntegriCloud