diff options
| author | Sam Clegg <sbc@chromium.org> | 2019-07-11 13:13:25 +0000 |
|---|---|---|
| committer | Sam Clegg <sbc@chromium.org> | 2019-07-11 13:13:25 +0000 |
| commit | fd11ce32bb8ddc7994bee584d18085ca9f09667c (patch) | |
| tree | 5e56f765bb648d839f4c522c3befa5ff0d123d5c /lld/wasm/Writer.cpp | |
| parent | 67828edbbd6f7b63149056b37d7ece10691d23ae (diff) | |
| download | bcm5719-llvm-fd11ce32bb8ddc7994bee584d18085ca9f09667c.tar.gz bcm5719-llvm-fd11ce32bb8ddc7994bee584d18085ca9f09667c.zip | |
[WebAssembly] Import __stack_pointer when building -pie binaries
The -pie binary doesn't know that layout ahead of time so needs to
import the stack pointer from the embedder, just like we do already
for shared libraries.
This change is needed in order to address:
https://github.com/emscripten-core/emscripten/issues/8915
Differential Revision: https://reviews.llvm.org/D64516
llvm-svn: 365771
Diffstat (limited to 'lld/wasm/Writer.cpp')
| -rw-r--r-- | lld/wasm/Writer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp index 11c4b913fd3..1a353440620 100644 --- a/lld/wasm/Writer.cpp +++ b/lld/wasm/Writer.cpp @@ -204,7 +204,7 @@ void Writer::layoutMemory() { uint32_t memoryPtr = 0; auto placeStack = [&]() { - if (config->relocatable || config->shared) + if (config->relocatable || config->isPic) return; memoryPtr = alignTo(memoryPtr, stackAlignment); if (config->zStackSize != alignTo(config->zStackSize, stackAlignment)) |

