[lld] [llvm] [MC] Rename temporary symbols of empty name to ".L0" (PR #89693)
Kito Cheng via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 23 01:49:03 PDT 2024
================
@@ -725,7 +725,13 @@ void ELFWriter::computeSymbolTable(
HasLargeSectionIndex = true;
}
+ // Temporary symbols generated for certain assembler features (.eh_frame,
+ // .debug_line) of an empty name may be referenced by relocations due to
+ // linker relaxation. Rename them to ".L0" to match the gas fake label name
+ // and allow ld/objcopy --discard-locals to discard such symbols.
StringRef Name = Symbol.getName();
+ if (Name.empty())
+ Name = ".L0";
----------------
kito-cheng wrote:
It's ".L0 " rather than ".L0" in binutils actually
https://github.com/bminor/binutils-gdb/blob/master/include/opcode/riscv.h#L381
Ref: https://github.com/bminor/binutils-gdb/commit/884b49e3a91504b9c5528343823d67f4419b73bb
https://github.com/llvm/llvm-project/pull/89693
More information about the llvm-commits
mailing list