diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 931baf5927a04..406d7d0df5ac8 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -2119,7 +2119,10 @@ ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id, // generated local labels used for internal purposes (e.g. debugging, // optimization) and are not relevant for symbol resolution or external // linkage. - if (llvm::StringRef(symbol_name).starts_with(".L")) + // LoongArch64 always uses symbols for relocations, so temporary symbols + // starting with ".L" should be preserved. + if (llvm::StringRef(symbol_name).starts_with(".L") && + arch.GetMachine() != llvm::Triple::loongarch64) continue; // No need to add non-section symbols that have no names if (symbol.getType() != STT_SECTION &&