[lld] [llvm] [LoongArch] Use R_LARCH_ALIGN without symbol as much as possible (PR #93775)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 16:22:00 PDT 2024


MaskRay wrote:

"Squash and merge" assigns the author field to the PR author (not the patch author) and adds Co-authored-by tags for commit authors.
If you are a coauthor, you can set the Co-authored-by tag in the description.

> In LoongArch psABI v2.30, the R_LARCH_ALIGN requires symbol index to to support the third parameter of alignment directive. Following this extended R_LARCH_ALIGN make the symbol index be redundant in some case. E.g. .align 4 or .align 4,,16. Thus, use the extended R_LARCH_ALIGN only when the third parameter is effective. Otherwise use the orginal R_LARCH_ALIGN for simple.

"... to support the third parameter of the alignment directive, R_LARCH_ALIGN relocations need a non-zero symbol index.
In many cases we don't need the third parameter  and can set the symbol index to 0.
This patch will remove a lot of `.Lla-relax-align*` symbols and mitigate the size regression due to #72962."


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


More information about the llvm-commits mailing list