[PATCH] D94371: [lld/mac] Implement -u flag

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 11:37:31 PST 2021


int3 added a comment.

> Since we emit diagnostics for undefineds in Writer::scanRelocations()

I've been wondering whether this is the right way to do it... in particular, we end up emitting one error message per relocation to an undefined, even if they all point to the same undefined. I made a brief attempt to scan the symbol table instead, but that creates spurious errors for things like `.globl unused_and_undefined`. I suppose we could always just dedup the symbols when scanning through the relocations though. Do you know how LLD-ELF handles this?



================
Comment at: lld/test/MachO/u.s:22
+# UNDEF: error: undefined symbol: _asdf
+
+#--- foo.s
----------------
thakis wrote:
> MaskRay wrote:
> > Would be nice to check the interaction with `.weak_reference`
> As far as I understand, `.weak_reference` only affects which opcodes are written to the import bind FSA description and doesn't interact with symbol lookup. Are you thinking of `-U` instead of `-u` maybe? Or do you mean a test that checks if a `-u` resolved against a dylib pulls in the dylib (independent of weak_ref)?
yeah I don't see how `weak_reference` would need to be tested here either


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

https://reviews.llvm.org/D94371



More information about the llvm-commits mailing list