[PATCH] D131376: [wasm-ld] Allow importing/exporting the output module's memory with arbitrary names

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 10:36:35 PDT 2022


sbc100 added a comment.

In D131376#3711300 <https://reviews.llvm.org/D131376#3711300>, @Liamolucko wrote:

>> 1. Are there going to be other cabi-relatated things, that warrent just putting this behind a single "cabi" flag rather than requiring N different flags for this?
>
> Yeah, the linker will also have to merge together `cabi_start` definitions, so using a unified flag makes more sense. I'll make a new patch to do it that way. Does Phabricator have a way to close this one?
>
>> If we made `__linear_memory` into first class symbol like `__indirection_function_table` then perhaps we could allow the toolchain to control its import/export name directly using the import_name/export_name attributes in assembly and avoid the need for any new command line flag and re-using the existing machinery?
>
> Yeah, that seems like the proper way to allow renaming. That would require adding a new `SYMTAB_MEMORY` to https://github.com/WebAssembly/tool-conventions/blob/main/Linking.md#linking-metadata-section, right?

Yes, I think so,  plus a bunch of work in MC and wasm-ld layers to support multiple memories.    This work was already done for the multi-table use case, so we should be able to follow that pattern.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131376/new/

https://reviews.llvm.org/D131376



More information about the llvm-commits mailing list