This repository has been archived by the owner on Apr 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebAssembly] Add --stack-first option which places the shadow stack …
…at start of linear memory Fixes https://bugs.llvm.org/show_bug.cgi?id=37181 Differential Revision: https://reviews.llvm.org/D46141 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@331467 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
5 changed files
with
85 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
; Test that the --stack-first option places the stack at the start of linear | ||
; memory. In this case the --stack-first option is being passed along with a | ||
; stack size of 512. This means (since the stack grows down) the stack pointer | ||
; global should be initialized to 512. | ||
|
||
RUN: llc -filetype=obj %p/Inputs/start.ll -o %t.o | ||
|
||
RUN: wasm-ld --check-signatures -z stack-size=512 --stack-first --allow-undefined -o %t.wasm %t.o | ||
RUN: obj2yaml %t.wasm | FileCheck %s | ||
|
||
CHECK: - Type: GLOBAL | ||
CHECK-NEXT: Globals: | ||
CHECK-NEXT: - Index: 0 | ||
CHECK-NEXT: Type: I32 | ||
CHECK-NEXT: Mutable: true | ||
CHECK-NEXT: InitExpr: | ||
CHECK-NEXT: Opcode: I32_CONST | ||
CHECK-NEXT: Value: 512 | ||
CHECK-NEXT: - Index: 1 | ||
CHECK-NEXT: Type: I32 | ||
CHECK-NEXT: Mutable: false | ||
CHECK-NEXT: InitExpr: | ||
CHECK-NEXT: Opcode: I32_CONST | ||
CHECK-NEXT: Value: 512 | ||
CHECK-NEXT: - Index: 2 | ||
CHECK-NEXT: Type: I32 | ||
CHECK-NEXT: Mutable: false | ||
CHECK-NEXT: InitExpr: | ||
CHECK-NEXT: Opcode: I32_CONST | ||
CHECK-NEXT: Value: 512 | ||
CHECK-NEXT: - Type: EXPORT | ||
CHECK-NEXT: Exports: | ||
CHECK-NEXT: - Name: memory | ||
CHECK-NEXT: Kind: MEMORY | ||
CHECK-NEXT: Index: 0 | ||
CHECK-NEXT: - Name: __heap_base | ||
CHECK-NEXT: Kind: GLOBAL | ||
CHECK-NEXT: Index: 1 | ||
CHECK-NEXT: - Name: __data_end | ||
CHECK-NEXT: Kind: GLOBAL | ||
CHECK-NEXT: Index: 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters