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 memory/table information from emscripten_metadata #12189

Closed
wants to merge 2 commits into from

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Sep 12, 2020

We are moving away from the world where the memory layout is
determined by the python driver code and towards a world where
the wasm-ld decides the final layout.

For relocatable module (SIDE_MODULE and MAIN_MODULE) the size
and alignment of memory and table segments is already encoded
in the dylink sections.

For non-relocatable modules I don't think this information is
needed by the embedder anymore.

Symbols like __global_base or __data_end and __heap_base are
details we don't export by default but can be explicitly exported if needed.

This is part of an effort to completely remove DYNAMIC_BASE.

@sbc100
Copy link
Collaborator Author

sbc100 commented Sep 12, 2020

The emscripten metadata section was originally added back in #7815.

@rianhunter I'm hoping that these particular pieces are data are no longer needed. emscripten has moved a lot of this stuff into internal implementation details on the wasm side so I'm hoping that exporting it is no longer needed in order to run an emscripten-built module. What do you think? Could you confirm this for me?

@sbc100
Copy link
Collaborator Author

sbc100 commented Sep 12, 2020

For example, implementing malloc or sbrk outside of the wasm module previously required this information, but those functions are now always part of the module itself.

@sbc100 sbc100 changed the title Remove memory and table layout information from emscripten_metadata s… Remove memory/table information from emscripten_metadata Sep 15, 2020
@sbc100
Copy link
Collaborator Author

sbc100 commented Sep 15, 2020

See #12231

@@ -19,7 +18,7 @@
# NB: major version 0 implies no compatibility
# NB: when changing the metadata format, we should only append new fields, not
# reorder, modify, or remove existing ones.
EMSCRIPTEN_METADATA_MAJOR, EMSCRIPTEN_METADATA_MINOR = (0, 3)
EMSCRIPTEN_METADATA_MAJOR, EMSCRIPTEN_METADATA_MINOR = (1, 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 as the major version indicates stability (see line 19/18) - probably we don't want that?

We are moving away from the world where the memory layout if
decided by the python driver code and towards a world where
the wasm-ld decides the final layout.

For relocatable module (SIDE_MODULE and MAIN_MODULE) the size
and alignment of memory and table segments is already encoded
in the `dylink` sections.

For non-relocatable modules I don't think this information is
needed by the embedded as they can simply look at the requirements
on the table and memory that a given module imports.

In general symbols like `__global_base` or `__data_end` and
`__heap_base` are details we don't export by default but can
be explictly exported if needed.
@sbc100 sbc100 closed this Oct 29, 2020
@sbc100 sbc100 deleted the cleanup_emscripten_metadata branch October 29, 2020 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants