[PATCH] D132262: RISCV: adjust relocation emission

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 8 10:23:27 PDT 2023


MaskRay added a comment.
Herald added a subscriber: luke.

The description says

> We unfortunately **do not handle the case where the difference references a symbol that is not yet defined**. In such a case, we simply fail to resolve the difference, which should hopefully not be too onerous ...

Android riscv64 nterp: Fix "oat" code size calculation. <https://android-review.googlesource.com/c/platform/art/+/2619609> is an instance to work around suppressed `R_RISCV_ADD32`/`R_RISCV_SUB32`. It reduces to:

  # Both end and begin are not defined yet. We decide ADD/SUB relocations upfront and don't know they will be needed.
  .4byte end-begin
  
  begin:
    call foo
  end:

I have this in my notes (https://maskray.me/blog/2021-03-14-the-dark-side-of-riscv-linker-relaxation "Label differences related to text section symbols") and will think about improvements in my free time.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132262



More information about the llvm-commits mailing list