[PATCH] [lld] [mach-o]: Initial support for reading dylibs during link.

Tim Northover t.p.northover at gmail.com
Thu Jun 26 12:15:02 PDT 2014


Hi Nick,

Most of the comments seem fine, but...

> +  for (auto &sym : normalizedFile.globalSymbols) {
> +    file->addSharedLibraryAtom(sym.name, copyRefs);
> +  }
> +
> ----------------
> Probably should check visibility of symbol.  In dylibs, only global symbols should be in globalSymbols.  On the other hand, in .o files, hidden (scopeLinkageUnit) symbols  are also in globalSymbols.

Are you sure about this one? As far as I can tell, scopeLinkageUnit
corresponds to N_PEXT. I specifically ran some tests on .dylibs with
N_PEXT symbols and ld64 was quite happy to resolve them to that
.dylib. Did I cock up my tests, or are we talking about different
things?

Cheers.

Tim.

http://reviews.llvm.org/D4309






More information about the llvm-commits mailing list