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

Tim Northover t.p.northover at gmail.com
Thu Jun 26 08:41:27 PDT 2014


Hi kledzik,

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.

http://reviews.llvm.org/D4309

Files:
  lib/ReaderWriter/MachO/Atoms.h
  lib/ReaderWriter/MachO/File.h
  lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
  lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
  test/mach-o/Inputs/simple-dylib.yaml
  test/mach-o/lit.local.cfg
  test/mach-o/use-simple-dylib.yaml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4309.10885.patch
Type: text/x-patch
Size: 10835 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140626/a2436bac/attachment.bin>


More information about the llvm-commits mailing list