[PATCH] D143115: [lld][RISCV] Introduce handling for R_RISCV_PLT32 relocation

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 13:22:51 PST 2023


jrtc27 added inline comments.


================
Comment at: lld/test/ELF/riscv-undefined-weak.s:89
+.word target at plt - .
+# RELOC:      0xC R_RISCV_PLT32 target 0x0
----------------
MaskRay wrote:
> Place the CHECK line above the instruction (the style used in this test file).
This also needs a HEX, otherwise you're not testing the linker at all here.


================
Comment at: llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp:65
     case FK_PCRel_4:
-      return ELF::R_RISCV_32_PCREL;
+      return Target.getAccessVariant() == MCSymbolRefExpr::VK_PLT
+                 ? ELF::R_RISCV_PLT32
----------------
MC and LLD support should be separate commits


================
Comment at: llvm/test/MC/RISCV/elf-reloc-plt32.s:6
+this:
+  .word extern_func at PLT - this + 4
+
----------------
Just use .?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143115



More information about the llvm-commits mailing list