[lld] [llvm] [LoongArch] Use R_LARCH_ALIGN with section symbol (PR #84741)
Jinyang He via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 28 00:52:27 PDT 2024
================
@@ -462,7 +462,11 @@ void InputSection::copyRelocations(uint8_t *buf,
addend += sec->getFile<ELFT>()->mipsGp0;
}
- if (RelTy::IsRela)
+ if (config->emachine == EM_LOONGARCH && type == R_LARCH_ALIGN)
+ // LoongArch psABI v2.30, the R_LARCH_ALIGN requires symbol index.
+ // If it use the section symbol, the addend should not be changed.
+ p->r_addend = addend;
+ else if (RelTy::IsRela)
----------------
MQ-mengqing wrote:
> ```
> if (RelTy::IsRela && !(config->emachine == EM_LOONGARCH && type == R_LARCH_ALIGN))
> ....
> ```
But it will go next if condition and do something wrong.
https://github.com/llvm/llvm-project/pull/84741
More information about the llvm-commits
mailing list