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

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 18 10:09:29 PDT 2022


oontvoo 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);
----------------
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)


================
Comment at: lld/test/MachO/aliases.s:7
+
+# RUN: not %lld -alias 2>&1 | FileCheck %s --check-prefix=INVALIDARG
+# RUN: not %lld -alias missing_second 2>&1 | FileCheck %s --check-prefix=INVALIDARG
----------------
nit: this shouldn't be needed (ie., the tests should be in  the OPT framework, not LLD-macho since it's not implementing argument parsing code)



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