Hi,
The attached patch is my initial attempts to get lld to read .dylib files correctly during link. I mostly followed ELF, which seems to have the following effects:
+ No undefinedAtoms, definedAtoms etc
+ SharedLibraryAtoms are produced on demand (so not all exported symbols end up in the final image).
+ the sharedLibraryAtoms function returns an empty set (I'm not sure why this is. If anyone does know the reasoning, I'd be glad to hear it).
On the MachO specific side, experiments with ld64 suggest that all N_EXT (even N_PEXT) symbols that aren't N_UNDF are should be eligible to be resolved in the dylib.
Does it look reasonable as a first pass? Or should I change some things?
Cheers.
Tim.
There is nothing to fix now. But long term, what we need to have happen is when the Resolver/SymbolTable replaces an UndefinedAtom with a SharedLibraryAtom, if the UndefinedAtom was marked canBeNullAtRuntime, then the SharedLibraryAtom needs to be marked that way too.