[PATCH] D99887: [lld][WebAssembly] Add `--export-if-defined`

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 9 19:04:28 PDT 2021


MaskRay added a comment.

In D99887#2669855 <https://reviews.llvm.org/D99887#2669855>, @sbc100 wrote:

> In D99887#2669582 <https://reviews.llvm.org/D99887#2669582>, @MaskRay wrote:
>
>> I don't know wasm enough... In ELF, `--export-dynamic-symbol` only affects defined symbols. `--export-dynamic` affects all defined symbols. They don't have effect on other symbols.
>
> Interesting.. aside from not really conveying its meaning clearly `--export-dynamic-symbol` sounds like it might be what we want here.

I think the reason is because for non-defined symbols, there is no point specifically mentioning "exported".

An undefined symbol not defined anywhere or defined in a shared object is naturally exported, because otherwise it cannot be resolved to a different module at runtime.
For a defined symbol, there is a distinction whether it should be exported.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99887



More information about the llvm-commits mailing list