[lld] [lld][ELF] Fix a corner case of elf::getLoongArchPageDelta (PR #71907)

Lu Weining via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 19 17:31:28 PST 2023


SixWeining wrote:


> This seems fine for static linking, but how to deal with object files (.o)? How to calculate the adjusting bits at this time?

Yes, seems it's impossible.

> Can we store the byte offset in `r_addend` for object file? It looks like there are enough bits.

I'm not sure how these byte offsets could be updated after instrucion scheduling.

Anyway, the `Detail` description of `R_LARCH_PCALA_HI20`, `R_LARCH_PCALA64_LO20` and `R_LARCH_PCALA64_HI12` in ABI is incorrect.
https://github.com/loongson/la-abi-specs/blob/v2.20/laelf.adoc?plain=1#L518
https://github.com/loongson/la-abi-specs/blob/v2.20/laelf.adoc?plain=1#L530
https://github.com/loongson/la-abi-specs/blob/v2.20/laelf.adoc?plain=1#L535


https://github.com/llvm/llvm-project/pull/71907


More information about the llvm-commits mailing list