Skip to content

Commit

Permalink
Support riscv
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 committed Mar 24, 2024
1 parent f6e06cd commit 1753201
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lsplt/src/main/jni/elf_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#define ELF_R_GENERIC_JUMP_SLOT R_X86_64_JUMP_SLOT
#define ELF_R_GENERIC_GLOB_DAT R_X86_64_GLOB_DAT
#define ELF_R_GENERIC_ABS R_X86_64_64
#elif defined(__riscv)
#define ELF_R_GENERIC_JUMP_SLOT R_RISCV_JUMP_SLOT
#define ELF_R_GENERIC_GLOB_DAT R_RISCV_32_PCREL
#define ELF_R_GENERIC_ABS R_RISCV_64
#endif

#if defined(__LP64__)
Expand Down Expand Up @@ -81,6 +85,8 @@ Elf::Elf(uintptr_t base_addr) : base_addr_(base_addr) {
if (EM_386 != header_->e_machine) return;
#elif defined(__x86_64__)
if (EM_X86_64 != header_->e_machine) return;
#elif defined(__riscv)
if (EM_RISCV != header_->e_machine) return;
#else
return;
#endif
Expand Down

0 comments on commit 1753201

Please sign in to comment.