I believe that LLVM MemoryBuffer interface is supposed to be read-only and it's allowed to use eg. read-only mmap of the underlying file. It isn't appropriate to modify the view at all.
in case of WASM_ENABLE_DEBUG_AOT, the whole buffer is written as the text section of the aot file. the modified e_type would confuse dwarf consumers. note that, even when we are using XIP, the debug info usually contains relocations. for example, llvm-dwarfdump doesn't seem to perform relocations on .debug_info section for ET_CORE (== 4 == our E_TYPE_XIP) objects.
I believe that LLVM MemoryBuffer interface is supposed to be read-only and it's allowed to use eg. read-only mmap of the underlying file. It isn't appropriate to modify the view at all.
in case of WASM_ENABLE_DEBUG_AOT, the whole buffer is written as the text section of the aot file. the modified e_type would confuse dwarf consumers. note that, even when we are using XIP, the debug info usually contains relocations. for example, llvm-dwarfdump doesn't seem to perform relocations on .debug_info section for ET_CORE (== 4 == our E_TYPE_XIP) objects.