[lld-macho][NFC] refactor relocation handling
authorGreg McGary <gkm@fb.com>
Tue, 19 Jan 2021 15:44:42 +0000 (07:44 -0800)
committerGreg McGary <gkm@fb.com>
Tue, 2 Feb 2021 17:54:53 +0000 (10:54 -0700)
commit3a9d2f1488f0a767d4e55dc701bbdfc5438bbb3e
tree0a77f2a75f01eafff826f8f0311a05ac498df5ac
parenta3cc99658d52f79faad26beeea06691b3a50bc95
[lld-macho][NFC] refactor relocation handling

Add per-reloc-type attribute bits and migrate code from per-target file into target independent code, driven by reloc attributes.

Many cleanups

Differential Revision: https://reviews.llvm.org/D95121
18 files changed:
lld/MachO/Arch/X86_64.cpp
lld/MachO/Driver.cpp
lld/MachO/InputFiles.cpp
lld/MachO/InputSection.cpp
lld/MachO/InputSection.h
lld/MachO/SyntheticSections.cpp
lld/MachO/Target.cpp
lld/MachO/Target.h
lld/MachO/Writer.cpp
lld/test/MachO/invalid/bad-got-to-dylib-tlv-reference.s
lld/test/MachO/invalid/bad-got-to-tlv-reference.s
lld/test/MachO/invalid/bad-tlv-def.s
lld/test/MachO/invalid/bad-tlv-opcode.s
lld/test/MachO/invalid/bad-tlv-relocation.s
lld/test/MachO/invalid/invalid-relocation-length.yaml
lld/test/MachO/invalid/invalid-relocation-pcrel.yaml
lld/test/MachO/x86-64-reloc-subtract.s [new file with mode: 0644]
llvm/include/llvm/BinaryFormat/MachO.h