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

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 07:50:41 PST 2023


heiher wrote:

Is this the correct way to get the four parts of PCALA64?

```
DELTA = DEST - PC[63:12][000]
DELTA = DELTA + (DELTA[11] << 12)
DELTA = DELTA + (DELTA[31] << 32)
DELTA = DELTA - (DELTA[11] << 32)

R_LARCH_PCALA_HI20   = DELTA[31:12]
R_LARCH_PCALA_LO20   = DELTA[11:00]
R_LARCH_PCALA64_LO20 = DELTA[51:32]
R_LARCH_PCALA64_HI12 = DELTA[63:52]
```

This is a simple validator, let me test it with boundary data: https://gist.github.com/heiher/bd7398397f3cb5598dce35cbc04d0075

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


More information about the llvm-commits mailing list