-
Notifications
You must be signed in to change notification settings - Fork 67
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
Export of local symbols in .o files #29
Comments
You mean |
Yes; updated. |
This is mostly for compatibility with other formats. Local symbols are visible in the symbol table of ELF and appear in the output of
The imports + exports is how we model the symbol table itself, so the only way to name a symbol right now is via an import or an export. Also, although relocations point to globals and functions (not imports and exports), its helpful if there is a symbol name associated. Once the name section expands to include naming things other than functions we could revisit this. Since the expected use case for these objects is as input to the linker I don't really see problem here. The local symbols will not be exported in the linked binary. |
Thanks. I agree; it's not urgent. For completeness, here's the link to the proposal to expand the name section: WebAssembly/design#1064. |
My current thinking is that we drop the NAME section completely from the object format, and only use it for the final binary. For the object format we want to more advanced concept of the symbol table. I'll open two new issues for (a) dropping NAME section from clang output files (b) creating a more advanced symbol table. |
This C:
currently compilers to this wasm:
It's surprising to see "
barfoo" exported here, since it has internal name linkage. The linkage is recorded in the metadata, viaWASM_SYM_BINDING_LOCAL
, however it seems like it would be more wasm-like to just omit the export.Local symbols are never comdat or weak and they don't have visibilities, so it seems like they could be omitted from the WASM_SYMBOL_INFO subsection altogether.
The text was updated successfully, but these errors were encountered: