[lld] [llvm] [MC] Rename temporary symbols of empty name to ".L0 " (PR #89693)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 23 10:39:59 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";
----------------
MaskRay wrote:
I assume that fake labels `.L0\x01` for other ports cannot be retained in .symtab . Even if they do, LLVM likely doesn't want to customize on this.
https://github.com/llvm/llvm-project/pull/89693
More information about the llvm-commits
mailing list