Fix handling of mach header and DSO handle symbols.
authorPete Cooper <peter_cooper@apple.com>
Tue, 2 Feb 2016 21:37:15 +0000 (21:37 +0000)
committerPete Cooper <peter_cooper@apple.com>
Tue, 2 Feb 2016 21:37:15 +0000 (21:37 +0000)
commitd4f414583ad3d7f5e599d8060ec6aaf99958a946
tree90fa595acec2e1174873f714fe673a92cc85e07d
parentde4208122b32222a575c4d817adfa080be7b1168
Fix handling of mach header and DSO handle symbols.

The magic file which contained these symbols inherited from archive
which meant that the resolver didn't add the required atoms as archive
members only get added when referenced.  Instead we now inherit from
SimpleFile which always links in the atoms needed.

The second issue was in the handling of these symbols when we emit
the MachO.  The mach header symbol needs to be in the atom list as
it gets an offset (0), and being in the atom list makes sure it is
emitted to the symbol table.  DSO handles are not emitted to the
symbol table.

rdar://problem/24450654

llvm-svn: 259574
lld/include/lld/Core/DefinedAtom.h
lld/include/lld/Core/File.h
lld/lib/Core/DefinedAtom.cpp
lld/lib/Core/Resolver.cpp
lld/lib/ReaderWriter/MachO/ExecutableAtoms.h
lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
lld/test/mach-o/arm-interworking-movw.yaml