Add per-reloc-type attribute bits and migrate code from per-target file into target independent code, driven by reloc attributes.
Many cleanups
Paths
| Differential D95121
[lld-macho][NFC] refactor relocation handling ClosedPublic Authored by gkm on Jan 21 2021, 2:39 AM.
Details
Summary Add per-reloc-type attribute bits and migrate code from per-target file into target independent code, driven by reloc attributes. Many cleanups
Diff Detail
Event TimelineComment Actions I like this enum-bit-based design :)
gkm added inline comments.
int3 added inline comments.
This revision is now accepted and ready to land.Jan 28 2021, 11:56 PM Comment Actions I also completed the TODO(gkm): hoist into target-independent code driven by RelocAttrBits refactors for prepareSymbolRelocation() and resolveSymbolVA()
gkm marked an inline comment as done. Comment Actions
Comment Actions @int3 @smeenai How can I verify? The slow way is that I can run the entire premerge check on CentOS8 and hope that’s sufficiently close to the Debian environment. Is there some sort of health meter for tests so that I can see if these tests are broken for contemporaneous diffs, or main? This revision was landed with ongoing or failed builds.Feb 2 2021, 9:55 AM Closed by commit rG3a9d2f1488f0: [lld-macho][NFC] refactor relocation handling (authored by gkm). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 320830 lld/MachO/Arch/X86_64.cpp
lld/MachO/Driver.cpp
lld/MachO/InputFiles.cpp
lld/MachO/InputSection.h
lld/MachO/InputSection.cpp
lld/MachO/SyntheticSections.cpp
lld/MachO/Target.h
lld/MachO/Target.cpplld/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
llvm/include/llvm/BinaryFormat/MachO.h
|
gcc warns about this always being false since type is unsigned.
Can it be removed?
Similarly with the assert above, I suppose type >= 0 is always true and it can be removed.