Skip to content

wasm-emscripten-finalize: Internalize mutable __stack_pointer import#2213

Merged
sbc100 merged 2 commits intomasterfrom
internalize_sp
Jul 10, 2019
Merged

wasm-emscripten-finalize: Internalize mutable __stack_pointer import#2213
sbc100 merged 2 commits intomasterfrom
internalize_sp

Conversation

@sbc100
Copy link
Copy Markdown
Member

@sbc100 sbc100 commented Jul 10, 2019

I'm working on a change to lld that will cause -pie binaries to
import __stack_pointer, just like -shared do already. Because we
don't yet support mutable globals everywhere this change will
internalize the import and create a new immutable import that is used
to initialize the internal one.

This change is part of the fix for:
emscripten-core/emscripten#8915

I'm working on a change to lld that will cause `-pie` binaries to
import __stack_pointer, just like -shared do already.  Because we
don't yet support mutable globals everywhere this change will
internalize the import and create a new immutable import that is used
to initialize the internal one.

This change is part of the fix for:
emscripten-core/emscripten#8915
Comment thread src/wasm-emscripten.h Outdated
// and restore functions.
void replaceStackPointerGlobal();

// Remove the import of a mutable __stack_pointer and instead initialze the
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in initialize

}

Name internalName = stackPointer->name;
Name externalName = internalName.c_str() + std::string("_import");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about adding an assert that stackPointer->imported(), I think that might help readability too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an early return above when its not.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I missed that.

@sbc100 sbc100 merged commit 90449a5 into master Jul 10, 2019
@sbc100 sbc100 deleted the internalize_sp branch July 10, 2019 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants