[PATCH] D100835: [WIP][LLD][RISCV] Linker Relaxation

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 12 04:49:49 PDT 2022


luismarques added a comment.

Thanks for the patch. It would be great to finally have linker relaxations for RISC-V in LLD.

> This patch fully implements linker relaxation for RISC-V

Well, it doesn't implement things like:

    lui a0, %hi(x)
    addi a0, a0, %lo(x)
  ->
    addi a0, zero, %lo(x)

For &lo that fits in the 12 bit `addi` immediate. BFD implements that.

Likewise for `auipc+addi` with `%pcrel_*`. It's only implemented for `gp` / `__global_pointer$`, not for `x0`.

The patched LLD also doesn't seem to support relaxations for an explicitly defined `__global_pointer$`. Whether it's supposed to or not, I think that case should be included in the tests.


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

https://reviews.llvm.org/D100835



More information about the llvm-commits mailing list