llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.44k stars 12.17k forks source link

[NFC][lld][ELF] move the commone interface "initSymbolAnchors" to "Writer.cpp" #101867

Open coderchenlin opened 4 months ago

coderchenlin commented 4 months ago

When I implement linker relaxation for a target, I notice the function "initSymbolAnchors" is defined in "lld/ELF/Arch/RISCV.cpp". but it looks like it is a common interface, and was used in RISCV and Loong architecture. Also, this function is independent of targets. Thus, I think taking this function in "lld/ELF/Writer.cpp" would be more reasonable.

llvmbot commented 4 months ago

@llvm/issue-subscribers-lld-elf

Author: chenlin (coderchenlin)

When I implement linker relaxation for a target, I notice the function "initSymbolAnchors" is defined in "lld/ELF/Arch/RISCV.cpp". but it looks like it is a common interface, and was used in RISCV and Loong architecture. Also, this function is independent of targets. Thus, I think taking this function in "lld/ELF/Writer.cpp" would be more reasonable.