diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index d7422e3a73a49..f6d8559218312 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -731,7 +731,10 @@ void MacroAssembler::la(Register Rd, const address addr, int32_t &offset) { offset = ((int32_t)distance << 20) >> 20; } else { assert(!CodeCache::contains(addr), "Must be"); - movptr(Rd, addr, offset); + // The load of the address will be generated with + // position independent instruction. + // Hence relocations will not change them. + mv(Rd, addr, offset); // li } }