[PATCH] D113167: [lld-macho]Allow exporting weak_def_can_be_hidden(AKA "autohide") symbols

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 11 08:00:41 PST 2021


oontvoo added inline comments.


================
Comment at: lld/MachO/InputFiles.cpp:577-582
+    if (isWeakDefCanBeHidden) {
+      if (isPrivateExtern)
+        isWeakDefCanBeHidden = false;
+      else
+        isPrivateExtern = true;
+    }
----------------
int3 wrote:
> what happens if there is an existing symbol that's `isWeakDefCanBeHidden` and another one that's `isPrivateExtern`? I.e. what if those two properties are defined on different symbols with the same name?
> 
> (should also add a test that covers this)
will add a test - but I'd think the privateExtern symbol would be picked over the weakdef one, which means it won't be exported (makes sense logically).

Now the question is, what if both are weak? ....


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