[PATCH] D45181: [RISCV] Add diff relocation support for RISC-V

James Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 17 06:55:11 PDT 2019


jrtc27 added a comment.

The problem is that `Length` is the length of the CIE, i.e. the data structure itself; this means it isn't subject to relaxations and so the difference expression can be folded. I don't see much merit in teaching all the tools out there to check relocations for `Length` when we can instead just emit the "right" thing. I think the fix is to make sure we only return true from `requiresDiffExpressionRelocations` if a target is in a code section? `MCSection::UseCodeAlign` will tell you this (or you can use `MCSectionELF::getFlags() & ELF::SHF_EXECINSTR` to be less general), though perhaps it should be renamed to `isCodeSection` to match `isVirtualSection`.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D45181





More information about the llvm-commits mailing list