[PATCH] D149552: [JITLink][RISCV] Fix logic for R_RISCV_ALIGN

Jonas Hahnfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 30 09:41:02 PDT 2023


Hahnfeld added a comment.

In D149552#4308808 <https://reviews.llvm.org/D149552#4308808>, @jobnoorman wrote:

> The required alignment is defined as <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#relocation-for-alignment> `NextPowerOf2(Addend)` (as you changed it to) and I believe it should be ok to ignore the relocation if this value is `<=2` (not sure if this will actually happen in practice).

I don't think this can ever happen because the smallest compressed instruction is two bytes.

> However, please not that I just submitted a patch to implement linker relaxation which also handles alignment properly: D149526 <https://reviews.llvm.org/D149526>

Thanks for letting me know, I wasn't aware. I left some comments ;-)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149552



More information about the llvm-commits mailing list