Yuta Saito ba3c1f9ce3
[WebAssembly] Add segment RETAIN flag to support private retained data (#81539)
In WebAssembly, we have `WASM_SYMBOL_NO_STRIP` symbol flag to mark the
referenced content as retained. However, the flag is not enough to
express retained data that is not referenced by any symbol. This patch
adds a new segment flag`WASM_SEG_FLAG_RETAIN` to support "private"
linkage data that is retained by llvm.used.

This kind of data that is not referenced but must be retained is usually
used with encapsulation symbols (__start/__stop). Swift runtime uses
this technique and depends on the fact "all metadata sections in live
objects are retained", which was not guaranteed with `--gc-sections`
before this patch.

This is a revised version of https://reviews.llvm.org/D126950 (has been
reverted) based on @MaskRay's comments
2024-02-21 03:35:36 +09:00
..
2023-09-26 14:25:11 +01:00
2023-01-26 10:26:24 +00:00
2023-01-26 10:26:24 +00:00
2023-02-22 10:02:16 +00:00
2023-01-26 10:26:24 +00:00
2023-01-26 10:26:24 +00:00