[PATCH] D71978: [RISCV] Fix evalutePCRelLo for symbols at the end of a fragment

James Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 13:46:59 PST 2020


jrtc27 added a comment.

If you look at the implementation of `getPCRelHiFixup`, the fixup returned is normally the same fragment as the AUIPC symbol, which is what this code was relying on. However, the one case where it doesn't is the special case of being at the end of a fragment, where `getPCRelHiFixup` gets the fixup from the *next* fragment *at offset 0*. This logic therefore needs to be mirrored in `evaluatePCRelLo` so that they agree on what fragment they're talking about for the AUIPC fixup. The issue arises because `.option` (and other directives) are delayed until the next code/data, but emitting a symbol does not flush that, so the local symbols end up at the end of the previous fragment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71978





More information about the llvm-commits mailing list