llvm-project
0d81d3c5 - [NFCI][ELF] Introduce explicit Computed state for DynamicReloc

Commit
61 days ago
[NFCI][ELF] Introduce explicit Computed state for DynamicReloc Currently we set the kind to AddendOnly in computeRaw() in order to catch cases where we're not treating the DynamicReloc as computed. Specifically, computeAddend() will then assert that sym is nullptr, so can catch any subsequent calls for relocations that have sym set. However, if the DynamicReloc was already AddendOnly (or MipsMultiGotPage), we will silently allow this, which does work correctly, but is not the intended use. We also cannot catch cases where needsDynSymIndex() is called after this point, which would give a misleading value if the kind were previously against a symbol. By introducing a new (internal) Computed kind we can be explicit and add more rigorous assertions, rather than abusing AddendOnly. Reviewers: arichardson, MaskRay Reviewed By: arichardson, MaskRay Pull Request: https://github.com/llvm/llvm-project/pull/150799
Author
Parents
Loading