[PATCH] D85255: [lld-macho] Generate ObjC symbols from .tbd files

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 14:34:04 PDT 2020


int3 added inline comments.


================
Comment at: lld/MachO/InputFiles.cpp:421
+      break;
+    }
+  }
----------------
smeenai wrote:
> compnerd wrote:
> > smeenai wrote:
> > > int3 wrote:
> > > > compnerd wrote:
> > > > > Same as last time - would be nice to actually compose with the user label prefix.
> > > > > 
> > > > > Remember that `x86_64-apple-coff` is a real target - and the user label prefix is empty there.  This breaks because you are assuming that the user label prefix is `_`.
> > > > > Remember that x86_64-apple-coff is a real target
> > > > 
> > > > oh what... is this actually used?
> > > I believe it's used for UEFI. Presumably that's something for LLD for COFF to worry about and not LLD for Mach-O though, right? Also, I'd be surprised if Objective-C is being used for UEFI :)
> > Sorry, that was a partial thought.  What I was getting at is that the user label prefix is important and in that case, you have MachO conversions that occur.  We should be more careful about the user label prefix rather than assume that it is guaranteed to be `_`.  That is a convention that is target dependent and not MachO dependent.
> I agree with you in theory, but in practice, are there any targets we'll be linking with LLD for Mach-O where you wouldn't expect the underscore? I think we're pretty much assuming that Mach-O == an Apple Mach-O target; we're certainly not testing with anything else.
> 
> Out of curiosity, what does ld64 do?
ld64 includes the underscore prefixes in their string literals


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85255



More information about the llvm-commits mailing list