[PATCH] D129938: [lld-macho] Add support for -alias

Keith Smiley via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 18 10:25:12 PDT 2022


keith added inline comments.


================
Comment at: lld/MachO/Driver.cpp:1569-1573
+          symtab->addDefined(pair.second, defined->getFile(), defined->isec,
+                             defined->value, defined->size,
+                             defined->isWeakDef(), defined->privateExtern,
+                             defined->thumb, defined->referencedDynamically,
+                             defined->noDeadStrip, defined->weakDefCanBeHidden);
----------------
oontvoo wrote:
> i wonder if it's worth adding a `Symtab::copy(<src>, <target>)` rather than listing all the symbol's internals here. (reason being that occasionally we do add a new field, which means going to hunt down all these instances and update them - kind of bug-prone)
Yea good idea, I moved it. I didn't see any other similar logic today so I made it specific to this use case, but it still seems nicer to live with the other symtab logic. lmk what you think!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129938



More information about the llvm-commits mailing list