File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -919,7 +919,8 @@ static void createSyntheticSymbols() {
919
919
}
920
920
921
921
if (ctx.isPic ||
922
- config->unresolvedSymbols == UnresolvedPolicy::ImportDynamic) {
922
+ config->unresolvedSymbols == UnresolvedPolicy::ImportDynamic ||
923
+ !config->isStatic ) {
923
924
// For PIC code, or when dynamically importing addresses, we create
924
925
// synthetic functions that apply relocations. These get called from
925
926
// __wasm_call_ctors before the user-level constructors.
Original file line number Diff line number Diff line change @@ -378,7 +378,7 @@ void InputChunk::generateRelocationCode(raw_ostream &os) const {
378
378
uint64_t offset = getVA (rel.Offset ) - getInputSectionOffset ();
379
379
380
380
Symbol *sym = file->getSymbol (rel);
381
- if (!ctx.isPic && sym->isDefined ())
381
+ if (!ctx.isPic && sym->isDefined () && !sym-> hasGOTIndex () )
382
382
continue ;
383
383
384
384
LLVM_DEBUG (dbgs () << " gen reloc: type=" << relocTypeToString (rel.Type )
Original file line number Diff line number Diff line change @@ -146,7 +146,8 @@ void scanRelocations(InputChunk *chunk) {
146
146
147
147
if (ctx.isPic ||
148
148
(sym->isUndefined () &&
149
- config->unresolvedSymbols == UnresolvedPolicy::ImportDynamic)) {
149
+ config->unresolvedSymbols == UnresolvedPolicy::ImportDynamic) ||
150
+ sym->isShared ()) {
150
151
switch (reloc.Type ) {
151
152
case R_WASM_TABLE_INDEX_SLEB:
152
153
case R_WASM_TABLE_INDEX_SLEB64:
You can’t perform that action at this time.
0 commit comments