indirect calls were broken.
Unified · Split
| @@ -359,8 +359,8 @@ static void gcall(void) · 358 unmodified lines | |||
| 359 | R_RISCV_CALL_PLT, (int)vtop->c.i); | 359 | R_RISCV_CALL_PLT, (int)vtop->c.i); |
| 360 | o(0x17 | (1 << 7)); // auipc ra, 0 %call(func) | 360 | o(0x17 | (1 << 7)); // auipc ra, 0 %call(func) |
| 361 | o(0x80e7); // jalr ra, 0 %call(func) | 361 | o(0x80e7); // jalr ra, 0 %call(func) |
| 362 | } else if ((vtop->r & VT_VALMASK) < VT_CONST) { | 362 | } else if (vtop->r < VT_CONST) { |
| 363 | int r = ireg(vtop->r & VT_VALMASK); | 363 | int r = ireg(vtop->r); |
| 364 | EI(0x67, 0, 1, r, 0); // jalr ra, 0(R) | 364 | EI(0x67, 0, 1, r, 0); // jalr ra, 0(R) |
| 365 | } else { | 365 | } else { |
| 366 | int r = TREG_RA; | 366 | int r = TREG_RA; |