diff --git a/renderdoc/3rdparty/plthook/plthook_elf.c b/renderdoc/3rdparty/plthook/plthook_elf.c index 6fc2ac6e3..d170d8ea4 100644 --- a/renderdoc/3rdparty/plthook/plthook_elf.c +++ b/renderdoc/3rdparty/plthook/plthook_elf.c @@ -98,6 +98,10 @@ #elif defined __riscv #define R_JUMP_SLOT R_RISCV_JUMP_SLOT #define Elf_Plt_Rel Elf_Rela +#elif defined __loongarch64 +#define R_JUMP_SLOT R_LARCH_JUMP_SLOT +#define R_GLOBAL_DATA R_LARCH_64 +#define Elf_Plt_Rel Elf_Rela #elif 0 /* disabled because not tested */ && (defined __sparcv9 || defined __sparc_v9__) #define R_JUMP_SLOT R_SPARC_JMP_SLOT #define Elf_Plt_Rel Elf_Rela diff --git a/renderdoc/os/posix/linux/linux_process.cpp b/renderdoc/os/posix/linux/linux_process.cpp index 18feb52b3..fffffc078 100644 --- a/renderdoc/os/posix/linux/linux_process.cpp +++ b/renderdoc/os/posix/linux/linux_process.cpp @@ -236,6 +236,13 @@ static uint64_t get_nanotime() #define BREAK_INST_BYTES_SIZE 4 #define BREAK_INST_INST_PTR_ADJUST 4 +#elif defined(__loongarch64) +#define INST_PTR_REG csr_era +// ebreak +#define BREAK_INST 0x150000ULL +#define BREAK_INST_BYTES_SIZE 4 +#define BREAK_INST_INST_PTR_ADJUST 4 + #else #define BREAK_INST 0xccULL