From: Simon Marchi Date: Fri, 10 Nov 2023 18:20:22 +0000 (-0500) Subject: bfd, binutils: add gfx11 amdgpu architectures X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a7a0cb6c92ea76b580b3a1aab5185115459bd7e5;p=binutils-gdb.git bfd, binutils: add gfx11 amdgpu architectures Teach bfd and readelf about some recent gfx11 architectures. This code is taken from the rocgdb 5.7.x branch [1]. [1] https://github.com/rocm-Developer-Tools/rocgdb/tree/rocm-5.7.x bfd/ChangeLog: * archures.c (bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101, bfd_mach_amdgcn_gfx1102): New. * bfd-in2.h (bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101, bfd_mach_amdgcn_gfx1102): New. * cpu-amdgcn.c (arch_info_struct): Add entries for bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101, bfd_mach_amdgcn_gfx1102. binutils/ChangeLog: * readelf.c (decode_AMDGPU_machine_flags): Handle gfx1100, gfx1101, gfx1102. include/ChangeLog: * elf/amdgpu.h (EF_AMDGPU_MACH_AMDGCN_GFX1100, EF_AMDGPU_MACH_AMDGCN_GFX1101, EF_AMDGPU_MACH_AMDGCN_GFX1102): New. Change-Id: I95a8a62942e359781a1c9fa2079950fbcf2a78b8 Co-Authored-By: Laurent Morichetti Cc: Lancelot Six --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f8086fb843b..7a0b178f3b3 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,13 @@ +2023-11-10 Simon Marchi + + * archures.c (bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101, + bfd_mach_amdgcn_gfx1102): New. + * bfd-in2.h (bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101, + bfd_mach_amdgcn_gfx1102): New. + * cpu-amdgcn.c (arch_info_struct): Add entries for + bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101, + bfd_mach_amdgcn_gfx1102. + 2023-11-10 Nick Clifton * elf.c (assign_file_positions_except_relocs): Turn warnings about diff --git a/bfd/archures.c b/bfd/archures.c index b59979e60ac..c4455de7c28 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -575,6 +575,9 @@ DESCRIPTION .#define bfd_mach_amdgcn_gfx1030 0x036 .#define bfd_mach_amdgcn_gfx1031 0x037 .#define bfd_mach_amdgcn_gfx1032 0x038 +.#define bfd_mach_amdgcn_gfx1100 0x041 +.#define bfd_mach_amdgcn_gfx1101 0x046 +.#define bfd_mach_amdgcn_gfx1102 0x047 . bfd_arch_last . }; */ diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 79f7f24436c..040d5560cdf 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1831,6 +1831,9 @@ enum bfd_architecture #define bfd_mach_amdgcn_gfx1030 0x036 #define bfd_mach_amdgcn_gfx1031 0x037 #define bfd_mach_amdgcn_gfx1032 0x038 +#define bfd_mach_amdgcn_gfx1100 0x041 +#define bfd_mach_amdgcn_gfx1101 0x046 +#define bfd_mach_amdgcn_gfx1102 0x047 bfd_arch_last }; diff --git a/bfd/cpu-amdgcn.c b/bfd/cpu-amdgcn.c index 9d6c26056f3..d9be7a399d9 100644 --- a/bfd/cpu-amdgcn.c +++ b/bfd/cpu-amdgcn.c @@ -52,7 +52,10 @@ static const bfd_arch_info_type arch_info_struct[] = N (bfd_mach_amdgcn_gfx1012, "amdgcn:gfx1012", false, NN (7)), N (bfd_mach_amdgcn_gfx1030, "amdgcn:gfx1030", false, NN (8)), N (bfd_mach_amdgcn_gfx1031, "amdgcn:gfx1031", false, NN (9)), - N (bfd_mach_amdgcn_gfx1032, "amdgcn:gfx1032", false, NULL) + N (bfd_mach_amdgcn_gfx1032, "amdgcn:gfx1032", false, NN (10)), + N (bfd_mach_amdgcn_gfx1100, "amdgcn:gfx1100", false, NN (11)), + N (bfd_mach_amdgcn_gfx1101, "amdgcn:gfx1101", false, NN (12)), + N (bfd_mach_amdgcn_gfx1102, "amdgcn:gfx1102", false, NULL) }; const bfd_arch_info_type bfd_amdgcn_arch = diff --git a/binutils/ChangeLog b/binutils/ChangeLog index b64591e02c6..57a8fa73ee3 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2023-11-10 Simon Marchi + + * readelf.c (decode_AMDGPU_machine_flags): Handle gfx1100, + gfx1101, gfx1102. + 2023-11-10 Vsevolod Alekseyev PR 30880 diff --git a/binutils/readelf.c b/binutils/readelf.c index 13b105cb584..661ef0aab18 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -4552,6 +4552,9 @@ decode_AMDGPU_machine_flags (char *out, unsigned int e_flags, Filedata *filedata AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1031, "gfx1031") AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1032, "gfx1032") AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1033, "gfx1033") + AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1100, "gfx1100") + AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1101, "gfx1101") + AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1102, "gfx1102") AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX602, "gfx602") AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX705, "gfx705") AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX805, "gfx805") diff --git a/include/ChangeLog b/include/ChangeLog index 7ea77f81693..dbef999e8fb 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,9 @@ +2023-11-10 Simon Marchi + + * elf/amdgpu.h (EF_AMDGPU_MACH_AMDGCN_GFX1100, + EF_AMDGPU_MACH_AMDGCN_GFX1101, + EF_AMDGPU_MACH_AMDGCN_GFX1102): New. + 2023-11-10 Nick Clifton * bfdlink.h (struct bfd_link_info): Update descriptions of the diff --git a/include/elf/amdgpu.h b/include/elf/amdgpu.h index d44244194e9..15720356ac0 100644 --- a/include/elf/amdgpu.h +++ b/include/elf/amdgpu.h @@ -67,8 +67,11 @@ #define EF_AMDGPU_MACH_AMDGCN_GFX1034 0x03e #define EF_AMDGPU_MACH_AMDGCN_GFX90A 0x03f #define EF_AMDGPU_MACH_AMDGCN_GFX940 0x040 +#define EF_AMDGPU_MACH_AMDGCN_GFX1100 0x041 #define EF_AMDGPU_MACH_AMDGCN_GFX1013 0x042 #define EF_AMDGPU_MACH_AMDGCN_GFX1036 0x045 +#define EF_AMDGPU_MACH_AMDGCN_GFX1101 0x046 +#define EF_AMDGPU_MACH_AMDGCN_GFX1102 0x047 /* Code object v3 machine flags. */