[PATCH] D133825: [lld-macho] Add support for N_INDR symbols

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 13 19:50:07 PDT 2022


thakis accepted this revision.
thakis added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lld/MachO/Driver.cpp:1216
+    if (auto *objFile = dyn_cast<ObjFile>(file)) {
+      for (const AliasSymbol *alias : objFile->aliases) {
+        if (const auto &aliased = symtab->find(alias->getAliasedName())) {
----------------
This feels a bit inelegant. Conceptually, an alias and its target could be two map entries pointing at the same symbol – if it weren't for the fact that the alias can have more restrictive visibility :/


================
Comment at: lld/MachO/SymbolTable.h:46
+  Defined *aliasDefined(Defined *src, StringRef target, InputFile *newFile,
+                        bool makePrivateExtern = false);
 
----------------
nit: `isPrivateExtern` for consistency with previous method?


================
Comment at: lld/test/MachO/symbol-aliases.s:43
+#--- aliases.s
+.globl _extern_alias_to_strong, _extern_alias_to_weak, _extern_alias_to_weak
+
----------------
Do you have a test for an extern alias to a local or a private extern target?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133825



More information about the llvm-commits mailing list