[lld] [llvm] [LoongArch] Use R_LARCH_ALIGN with section symbol (PR #84741)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 12 10:01:33 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)
----------------
MaskRay wrote:
I am more convinced that the generic function should be moved to Arch/ as I did for `relocateAlloc`. You might not be interested in doing such generic improvement. I'll investigate it.
https://github.com/llvm/llvm-project/pull/84741
More information about the llvm-commits
mailing list