]> granicus.if.org Git - llvm/commit
[WebAssembly] Use __stack_pointer global when writing wasm binary
authorSam Clegg <sbc@chromium.org>
Fri, 16 Jun 2017 23:59:10 +0000 (23:59 +0000)
committerSam Clegg <sbc@chromium.org>
Fri, 16 Jun 2017 23:59:10 +0000 (23:59 +0000)
commit46016f24b43bd188943613903094306dc42b5f55
tree2b53e82cbbce0498f7052cf5679b36e16c3c0022
parent2757ca62d7713893f184fdb8f6a5a3d773983353
[WebAssembly] Use __stack_pointer global when writing wasm binary

This ensures that symbolic relocations are generated for stack
pointer manipulations.

These relocations are of type R_WEBASSEMBLY_GLOBAL_INDEX_LEB.
This change also adds support for reading relocations of this
type in WasmObjectFile.cpp.

Since its a globally imported symbol this does mean that
the get_global/set_global instruction won't be valid until
the objects are linked that global used in no longer an
imported global.

Differential Revision: https://reviews.llvm.org/D34172

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305616 91177308-0d34-0410-b5e6-96231b3b80d8
17 files changed:
include/llvm/CodeGen/MachineModuleInfoImpls.h
lib/CodeGen/MachineModuleInfoImpls.cpp
lib/MC/WasmObjectWriter.cpp
lib/Object/WasmObjectFile.cpp
lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp
lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp
lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp
lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
test/CodeGen/WebAssembly/byval.ll
test/CodeGen/WebAssembly/reg-stackify.ll
test/CodeGen/WebAssembly/stack-alignment.ll
test/CodeGen/WebAssembly/userstack.ll
test/MC/WebAssembly/func-address.ll
test/MC/WebAssembly/stack-ptr.ll [new file with mode: 0644]