[Lldb-commits] [PATCH] D141245: [LLDB][LoongArch] ObjectFile: add a case for `EM_LOONGARCH`

Hui Li via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Jan 8 18:23:41 PST 2023


lh03061238 created this revision.
lh03061238 added reviewers: SixWeining, wangleiat, xen0n, xry111, MaskRay, seehearfeel, DavidSpickett.
Herald added a subscriber: emaste.
Herald added a project: All.
lh03061238 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This adds the jump slot mapping for LoongArch. This is a simple
change that ensures lldb running properly.

Note that this problem was found only when CMake variables 
 "DLLVM_ENABLE_ASSERTIONS=ON" is selected.

Without this patch,

  $ build/bin/lldb  test
  
  ../ELFHeader::GetRelocationJumpSlotType() const: Assertion `false && "architecture not supported"' fail

With this patch

  $ build/bin/lldb  test
  (lldb) target create "test"
  Current executable set to '../test' (loongarch64).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141245

Files:
  lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp


Index: lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
===================================================================
--- lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
+++ lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
@@ -211,6 +211,9 @@
   case EM_RISCV:
     slot = R_RISCV_JUMP_SLOT;
     break;
+  case EM_LOONGARCH:
+    slot = R_LARCH_JUMP_SLOT;
+    break;
   }
 
   return slot;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141245.487255.patch
Type: text/x-patch
Size: 399 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230109/17546814/attachment.bin>


More information about the lldb-commits mailing list