This was already done for the indirect function table (wasmTable) in #12296 and is a nice win for code size, portability and complexity.
The only reason we couldn't do this before was that JS used to be able to make static allocation and change the memory size and a layout after wasm-ld was run. All that has now been removed the memory layout is now set at wasm-ld time which means that it should be able to create and export the memory to JS.