[PATCH] D73254: [ELF] Rename relocateOne() to relocate() and pass `Relocation` to it

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 09:52:08 PST 2020


peter.smith added a comment.

Looking at where we use relocateOne directly, I can see the PLT code, ARMErrataFix and AArch64ErrataFix , and Thunks that call relocateOne directly. For my selfish purposes this isn't a problem as for correcting ARM/Thumb interworking via BLX I'd only need to know the symbol type for R_ARM_CALL and R_ARM_THM_CALL which always have a symbol. I think that the R_ARM_THM_JUMP19, R_ARM_THM_JUMP24 and R_ARM_JUMP24 can be solved in needsThunk() which already has the information it needs.

I'm a bit torn about the interface as there are trade-offs. Having

  void relocate(uint8_t *loc, RelType type, uint64_t val, const Symbol *sym = nullptr) const;

Makes it a bit more explicit that sym can be nullptr. Perhaps instead of relocate and relocateOne we rename relocateOne to relocateWithoutSym(), a bit more verbose but there aren't too many callsites?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73254/new/

https://reviews.llvm.org/D73254





More information about the llvm-commits mailing list