[PATCH] D126950: [lld][WebAssembly] Retain data segments referenced via __start/__stop

Yuta Saito via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 3 21:01:59 PDT 2022


kateinoigakukun added a comment.

In D126950#3558031 <https://reviews.llvm.org/D126950#3558031>, @MaskRay wrote:

> In D126950#3558024 <https://reviews.llvm.org/D126950#3558024>, @kateinoigakukun wrote:
>
>> In D126950#3558023 <https://reviews.llvm.org/D126950#3558023>, @MaskRay wrote:
>>
>>>> As well as ELF linker does, retain all data segments named X referenced through __start_X or __stop_X.
>>>
>>> lld doesn't do this by default. This behavior requires `-z nostart-stop-gc`.
>>>
>>> Not force retaining `X` allows fine-grained GC of metadata sections: https://maskray.me/blog/2021-01-31-metadata-sections-comdat-and-shf-link-order
>>
>> Ah right, so my description is valid with GNU ld sorry. I'm going to add the option and make it default in wasm-ld.
>
> `-z start-stop-gc` is the ideal behavior. I am concerned the behavior as defaulted by this patch will make incur unnecessary size costs to metadata sections.

So should we revert this patch ASAP and reland with hiding it behind `-z nostart-stop-gc`? Or is it fine to wait for my upcoming follow-up patch?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126950



More information about the llvm-commits mailing list