Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused data segments #21

Closed
fitzgen opened this issue Jan 17, 2018 · 5 comments
Closed

Remove unused data segments #21

fitzgen opened this issue Jan 17, 2018 · 5 comments

Comments

@fitzgen
Copy link
Member

fitzgen commented Jan 17, 2018

I used wasm-snip to remove all the panicking and formatting code from my .wasm, but my data section is still mostly fragments of diagnostic messages for panicking and formatting, and wasm-gc and wasm-opt can't remove them.

This is almost 20% of my .wasm's code size.

We need some way to mechanically remove this stuff -- doing it by hand is not feasible.

@koute
Copy link

koute commented Jan 17, 2018

You can easily remove the data sections automatically; the problem is mostly figuring out which ones you can safely remove, as any references to them in the bytecode look like normal integers, AFAIK.

@pepyakin
Copy link
Member

I think it is hard to solve in general. Segments can be not separated (so you can't always know exact length of data blob) and these integers can be crafted.

@alexcrichton
Copy link
Contributor

@pepyakin
Copy link
Member

@alexcrichton
Copy link
Contributor

Done now that LLD is merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants