Add LoongArch64 support

With addition macros project able to build and run on LoongArch64 machine
This commit is contained in:
zllangty
2025-05-13 12:18:06 +01:00
committed by Baldur Karlsson
parent 0e2cfde411
commit 9fab650555
2 changed files with 11 additions and 0 deletions
+4
View File
@@ -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
@@ -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