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 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebAssembly] Add support for custom sections
Copy user-defined custom sections into the output, concatenating sections with the same name. Differential Revision: https://reviews.llvm.org/D45340 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@329717 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
9 changed files
with
140 additions
and
1 deletion.
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,6 @@ | ||
target triple = "wasm32-unknown-unknown-wasm" | ||
|
||
!0 = !{ !"red", !"foo" } | ||
!1 = !{ !"green", !"bar" } | ||
!2 = !{ !"green", !"qux" } | ||
!wasm.custom_sections = !{ !0, !1, !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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
; RUN: llc -filetype=obj %s -o %t1.o | ||
; RUN: llc -filetype=obj %S/Inputs/custom.ll -o %t2.o | ||
; RUN: wasm-ld --check-signatures --relocatable -o %t.wasm %t1.o %t2.o | ||
; RUN: obj2yaml %t.wasm | FileCheck %s | ||
|
||
target triple = "wasm32-unknown-unknown-wasm" | ||
|
||
define i32 @_start() local_unnamed_addr { | ||
entry: | ||
%retval = alloca i32, align 4 | ||
ret i32 0 | ||
} | ||
|
||
!0 = !{ !"red", !"extra" } | ||
!wasm.custom_sections = !{ !0 } | ||
|
||
; CHECK: - Type: CUSTOM | ||
; CHECK-NEXT: Name: green | ||
; CHECK-NEXT: Payload: '05677265656E626172717578' | ||
; CHECK-NEXT: - Type: CUSTOM | ||
; CHECK-NEXT: Name: red | ||
; CHECK-NEXT: Payload: 037265646578747261666F6F |
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
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