[PATCH] D143673: [lld][RISCV] Implement GP relaxation for R_RISCV_HI20/R_RISCV_LO12_I/R_RISCV_LO12_S.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 19:56:06 PDT 2023


craig.topper added inline comments.


================
Comment at: lld/test/ELF/riscv-relax-hi20-lo12-pie.s:1
+# REQUIRES: riscv
+# RUN: rm -rf %t && split-file %s %t && cd %t
----------------
craig.topper wrote:
> MaskRay wrote:
> > Merge the tests into `riscv-relax-hi20-lo12.s`. If the `-no-pie` test has exercised many cases, the `-pie` case can just check a few lines if you feel duplicating all `-no-pie` CHECK lines looks too verbose.
> > 
> > Also, add a `-shared` test. Note, it's not necessary to test all `riscv{32,64} x {-pie,-shared}` combinations.
> > `riscv32 -pie` and `riscv64 -shared` may suffice.
> I think I got an error for %lo/%hi on the non-absolute symbols with -pie
For example 

ld.lld: error: relocation R_RISCV_LO12_S cannot be used against symbol 'norelax'; recompile with -fPIC


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143673



More information about the llvm-commits mailing list