[PATCH] D113167: [lld-macho] Allow exporting weak def private-extern symbols.
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 5 12:32:41 PDT 2021
thakis added a comment.
In D113167#3109836 <https://reviews.llvm.org/D113167#3109836>, @oontvoo wrote:
> In D113167#3109188 <https://reviews.llvm.org/D113167#3109188>, @thakis wrote:
>
>> That honestly sounds like a bug in your build config, independently of if ld64 allows it, no?
>
> I still think that LLD shouldn't conflate the following two cases:
>
> // hidden.cc
> extern __attribute__((weak)) __attribute__((visibility("hidden"))) void foo() {return 5;}
> int bar() { return foo(); }
>
> VS
>
> // can_be_hidden.cc (Must be C++, not C)
> __attribute__((noinline)) inline int foo() { return 5; }
> int bar() { return foo(); }
>
> For the `hidden.cc`, clearly we shouldn't export `foo`. (current behaviour).
> But for the latter, it should be fine
You can make a case for this, but as far as I understand the only programs where this can make a difference in practice is one with ODR violations, right?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113167/new/
https://reviews.llvm.org/D113167
More information about the llvm-commits
mailing list