Skip to content

Commit ee776f1

Browse files
committed
riscv32: Add DWARF support
Signed-off-by: Paul Guyot <[email protected]>
1 parent 9b3a525 commit ee776f1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

libs/jit/src/jit_dwarf.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ elf(_State, _NativeCode) ->
350350
-define(EM_ARM, 40).
351351
-define(EM_X86_64, 62).
352352
-define(EM_AARCH64, 183).
353+
-define(EM_RISCV, 243).
353354
-define(SHT_PROGBITS, 1).
354355
-define(SHT_SYMTAB, 2).
355356
-define(SHT_STRTAB, 3).
@@ -369,7 +370,8 @@ elf(_State, _NativeCode) ->
369370
%% Map JIT backend to ELF machine type
370371
backend_to_machine_type(jit_x86_64) -> ?EM_X86_64;
371372
backend_to_machine_type(jit_aarch64) -> ?EM_AARCH64;
372-
backend_to_machine_type(jit_armv6m) -> ?EM_ARM.
373+
backend_to_machine_type(jit_armv6m) -> ?EM_ARM;
374+
backend_to_machine_type(jit_riscv32) -> ?EM_RISCV.
373375

374376
%% Map JIT backend to ELF flags
375377
backend_to_elf_flags(jit_armv6m) ->

libs/jit/src/jit_riscv32.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@
237237
-define(PARAMETER_REGS, [a0, a1, a2, a3, a4, a5, a6, a7]).
238238
-define(SCRATCH_REGS, [t6, t5, t4, t2, t1, t0]).
239239

240+
-include("jit_backend_dwarf_impl.hrl").
241+
240242
%%-----------------------------------------------------------------------------
241243
%% @doc Return the word size in bytes, i.e. the sizeof(term) i.e.
242244
%% sizeof(uintptr_t)

0 commit comments

Comments
 (0)