[mach-o] refactor x86_64 relocation handling.
authorNick Kledzik <kledzik@apple.com>
Fri, 27 Jun 2014 18:25:01 +0000 (18:25 +0000)
committerNick Kledzik <kledzik@apple.com>
Fri, 27 Jun 2014 18:25:01 +0000 (18:25 +0000)
commit3f69076278421d731a80804a743f89c72384b379
treec169e62efc983af55f662101612ae1241d2ff07f
parentdad0a645a7b392900c9fb34f11815060d03a2233
[mach-o] refactor x86_64 relocation handling.

This is first step in reworking how mach-o relocations are processed.
The existing KindHandler is going to become a delgate/helper object for
processing architecture specific references.  The KindHandler knows how
to convert mach-o relocations into References and back, as well, as fixing
up the content the relocation is on.

One of the messy things about mach-o relocations is that they sometime
come in pairs, but the pairs still convert to one lld::Reference. So, the
conversion has to detect pairs (arch specific) and change the stride.

llvm-svn: 211921
14 files changed:
lld/lib/ReaderWriter/MachO/Atoms.h
lld/lib/ReaderWriter/MachO/File.h
lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
lld/lib/ReaderWriter/MachO/ReferenceKinds.cpp
lld/lib/ReaderWriter/MachO/ReferenceKinds.h
lld/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp
lld/test/darwin/hello-world.objtxt
lld/test/darwin/native-and-mach-o.objtxt
lld/test/mach-o/parse-cfstring64.yaml
lld/test/mach-o/parse-data-relocs-x86_64.yaml [new file with mode: 0644]
lld/test/mach-o/parse-initializers64.yaml
lld/test/mach-o/parse-text-relocs-x86_64.yaml [new file with mode: 0644]