From fbdd94847814c926f2767e656ba501b4ca7dfaae Mon Sep 17 00:00:00 2001 From: Lu Weining Date: Tue, 4 Jun 2024 09:00:14 +0800 Subject: [LoongArch] Use R_LARCH_ALIGN without symbol as much as possible (#93775) 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 https://github.com/llvm/llvm-project/pull/72962. Co-authored-by: Jinyang He Co-authored-by: Weining Lu --- lld/test/ELF/loongarch-relax-emit-relocs.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lld') diff --git a/lld/test/ELF/loongarch-relax-emit-relocs.s b/lld/test/ELF/loongarch-relax-emit-relocs.s index 581fce8..ba414e8 100644 --- a/lld/test/ELF/loongarch-relax-emit-relocs.s +++ b/lld/test/ELF/loongarch-relax-emit-relocs.s @@ -25,7 +25,7 @@ # CHECK-NEXT: R_LARCH_PCALA_LO12 _start # CHECK-NEXT: R_LARCH_RELAX *ABS* # CHECK-NEXT: nop -# CHECK-NEXT: R_LARCH_ALIGN .Lla-relax-align0+0x4 +# CHECK-NEXT: R_LARCH_ALIGN *ABS*+0xc # CHECK-NEXT: nop # CHECK-NEXT: ret @@ -37,7 +37,7 @@ # CHECKR-NEXT: R_LARCH_PCALA_LO12 _start # CHECKR-NEXT: R_LARCH_RELAX *ABS* # CHECKR-NEXT: nop -# CHECKR-NEXT: R_LARCH_ALIGN .Lla-relax-align0+0x4 +# CHECKR-NEXT: R_LARCH_ALIGN *ABS*+0xc # CHECKR-NEXT: nop # CHECKR-NEXT: nop # CHECKR-NEXT: ret -- cgit v1.1