[Lldb-commits] [lldb] [lldb][LoongArch] Preserve temporary symbols starting with `.L` in lldb symbol table (PR #158551)

Lu Weining via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 15 00:58:33 PDT 2025


================
@@ -2119,8 +2119,12 @@ 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"))
-      continue;
+    // LoongArch64 always uses symbols for relocations, so temporary symbols
+    // starting with ".L" should be preserved.
+    if (arch.GetMachine() != llvm::Triple::loongarch64) {
+      if (llvm::StringRef(symbol_name).starts_with(".L"))
+        continue;
+    }
----------------
SixWeining wrote:

```suggestion
    // 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;
```

https://github.com/llvm/llvm-project/pull/158551


More information about the lldb-commits mailing list