[PATCH] D145474: [RISCV][MC] Adjust conditions to emit R_RISCV_ADD*/R_RISCV_SUB* pairs

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 07:30:01 PST 2023


compnerd added inline comments.


================
Comment at: llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp:232
+  if (B.isInSection())
+    return !IsEHOrAppleSection(B.getSection());
 
----------------
This really seems like the original cases were correct but need to be augmented further to handle data sections.  If there is a cross-section textual reference, that should generate the relocation pair.  The data section is interesting because the `.eh_frame`, `.apple_names`, `.apple_types`, and `.debug_*` do not want the pairwise relocation.  Adjusting this to handle it that way would not only fix this, but also likely fix the cases of fission that we currently fail on.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145474



More information about the llvm-commits mailing list