From 16a0b3b4abb10d0b03877f606f13863401bbd77f Mon Sep 17 00:00:00 2001 From: Aleksandra Pasek Date: Wed, 14 Apr 2021 10:44:04 -0400 Subject: [PATCH] [Ada] Add support for Aarch64 in System.Object_Reader gcc/ada/ * libgnat/s-objrea.adb (EM_AARCH64): New Constant. (Initialize): Handle EM_AARCH64 case. (Read_Address): Handle AARCH64 case. * libgnat/s-objrea.ads (Object_Arch): Add AARCH64 record component. --- gcc/ada/libgnat/s-objrea.adb | 7 ++++++- gcc/ada/libgnat/s-objrea.ads | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/ada/libgnat/s-objrea.adb b/gcc/ada/libgnat/s-objrea.adb index b5ca32f..9dd8c1f 100644 --- a/gcc/ada/libgnat/s-objrea.adb +++ b/gcc/ada/libgnat/s-objrea.adb @@ -78,6 +78,7 @@ package body System.Object_Reader is EM_SPARCV9 : constant := 43; -- SPARC v9 64-bit EM_IA_64 : constant := 50; -- Intel Merced EM_X86_64 : constant := 62; -- AMD x86-64 architecture + EM_AARCH64 : constant := 183; -- Aarch64 EN_NIDENT : constant := 16; @@ -648,6 +649,9 @@ package body System.Object_Reader is when EM_ARM => Res.Arch := ARM; + when EM_AARCH64 => + Res.Arch := AARCH64; + when others => raise Format_Error with "unrecognized architecture"; end case; @@ -2038,7 +2042,8 @@ package body System.Object_Reader is Address_32 := Read (S); return uint64 (Address_32); - when IA64 + when AARCH64 + | IA64 | PPC64 | SPARC64 | x86_64 diff --git a/gcc/ada/libgnat/s-objrea.ads b/gcc/ada/libgnat/s-objrea.ads index 28dabf5..a83ca53 100644 --- a/gcc/ada/libgnat/s-objrea.ads +++ b/gcc/ada/libgnat/s-objrea.ads @@ -120,9 +120,12 @@ package System.Object_Reader is PPC64, -- 64-bit PowerPC - ARM); + ARM, -- 32-bit ARM + AARCH64); + -- 64-bit ARM + ------------------ -- Target types -- ------------------ -- 2.7.4