-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking issue for the #[wasm_custom_section] attribute #51088
Copy link
Copy link
Closed
Labels
B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCO-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCO-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This issue tracks the
wasm_custom_sectionattribute which is used to define the contents of a custom section in the wasm executable.cc rustwasm/team#82.
The attribute is used like so:
The attribute in its current form can only be applied to
constvalues and must be of the form[u8; N]. The attribute also must be of the form#[wasm_custom_section = "name"].Custom sections are a feature of the WebAssembly binary encoding. They are intended to allow wasm files to encode arbitrary information useful for tools like debuggers, profilers, or transformations like
wasm-bindgen. Each custom section must have a UTF-8 name and a payload of bytes. There is no restricton on the name or payload otherwise.The linker, LLD, for the wasm target will concatenate custom sections of the same name in the order the objects appear on the comand line. For example if both crate
aand cratebdefine a custom section with the namefoothe final output will contain only one custom section with the name offoowhere the contents ofaandbare concatenated (byte-wise).Helpful links: