From 74c048cdb4b19d41f70880ebf3d3e6eb58404097 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 26 Jan 2023 07:33:44 +0100 Subject: mcode: add new functions for JIT --- src/ortho/mcode/binary_file-memory.adb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/ortho/mcode/binary_file-memory.adb') diff --git a/src/ortho/mcode/binary_file-memory.adb b/src/ortho/mcode/binary_file-memory.adb index 2442952c1..4c823701c 100644 --- a/src/ortho/mcode/binary_file-memory.adb +++ b/src/ortho/mcode/binary_file-memory.adb @@ -204,9 +204,12 @@ package body Binary_File.Memory is end if; end Write_Memory_Relocate; - function Get_Section_Addr (Sect : Section_Acc) return System.Address is + function Get_Section_Addr (Sect : Section_Acc) return System.Address + is + function To_Address is new Ada.Unchecked_Conversion + (Source => Byte_Array_Acc, Target => System.Address); begin - return Sect.Data (0)'Address; + return To_Address (Sect.Data); end Get_Section_Addr; function Get_Section_Size (Sect : Section_Acc) return Pc_Type is -- cgit v1.2.3