[all-commits] [llvm/llvm-project] 06a728: [lld][ELF] Support relax R_LARCH_ALIGN (#78692)
Jinyang He via All-commits
all-commits at lists.llvm.org
Mon Feb 5 17:09:25 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 06a728f3feab876f9195738b5774e82dadc0f3a7
https://github.com/llvm/llvm-project/commit/06a728f3feab876f9195738b5774e82dadc0f3a7
Author: Jinyang He <hejinyang at loongson.cn>
Date: 2024-02-06 (Tue, 06 Feb 2024)
Changed paths:
M lld/ELF/Arch/LoongArch.cpp
M lld/ELF/Arch/RISCV.cpp
M lld/ELF/InputSection.cpp
M lld/ELF/InputSection.h
M lld/ELF/Target.h
M lld/ELF/Writer.cpp
A lld/test/ELF/loongarch-relax-align.s
A lld/test/ELF/loongarch-relax-emit-relocs.s
Log Message:
-----------
[lld][ELF] Support relax R_LARCH_ALIGN (#78692)
Refer to commit 6611d58f5bbc ("Relax R_RISCV_ALIGN"), we can relax
R_LARCH_ALIGN by same way. Reuse `SymbolAnchor`, `RISCVRelaxAux` and
`initSymbolAnchors` to simplify codes. As `riscvFinalizeRelax` is an
arch-specific function, put it override on `TargetInfo::finalizeRelax`,
so that LoongArch can override it, too.
The flow of relax R_LARCH_ALIGN is almost consistent with RISCV. The
difference is that LoongArch only has 4-bytes NOP and all executable
insn is 4-bytes aligned. So LoongArch not need rewrite NOP sequence.
Alignment maxBytesEmit parameter is supported in psABI v2.30.
More information about the All-commits
mailing list