[patch] Update e_machine values

Cary Coutant ccoutant@gmail.com
Sat Dec 12 00:20:53 GMT 2020


[Sorry, meant to cc Nick on this...]

On Fri, Dec 11, 2020 at 12:36 PM <ccoutant@gmail.com> wrote:
>
> This patch updates the ELF headers and readelf to include
> the most recent e_machine assignments.
>
> OK for trunk?
>
> -cary
>
> 2020-12-11  Cary Coutant  <ccoutant@gmail.com>
>
> binutils/
>         * readelf.c (get_machine_name): Update list of e_machine values.
>
> include/
>         * elf/common.h: Update list of e_machine values.
>
> diff --git a/binutils/readelf.c b/binutils/readelf.c
> index 7f634d94bf..ed252f9c41 100644
> --- a/binutils/readelf.c
> +++ b/binutils/readelf.c
> @@ -2563,10 +2563,26 @@ get_machine_name (unsigned e_machine)
>      case EM_FT32:               return "FTDI Chip FT32";
>      case EM_MOXIE:              return "Moxie";
>      case EM_AMDGPU:            return "AMD GPU";
> +      /* 230 (all reserved) */
> +      /* 240 */
>      case EM_RISCV:             return "RISC-V";
>      case EM_LANAI:             return "Lanai 32-bit processor";
> +    case EM_CEVA:              return "CEVA Processor Architecture Family";
> +    case EM_CEVA_X2:           return "CEVA X2 Processor Family";
>      case EM_BPF:               return "Linux BPF";
> +    case EM_GRAPHCORE_IPU:     return "Graphcore Intelligent Processing Unit";
> +    case EM_IMG1:              return "Imagination Technologies";
> +      /* 250 */
>      case EM_NFP:               return "Netronome Flow Processor";
> +    case EM_VE:                        return "NEC Vector Engine";
> +    case EM_CSKY:              return "C-SKY";
> +    case EM_ARC_COMPACT3_64:   return "Synopsys ARCv2.3 64-bit";
> +    case EM_MCS6502:           return "MOS Technology MCS 6502 processor";
> +    case EM_ARC_COMPACT3:      return "Synopsys ARCv2.3 32-bit";
> +    case EM_KVX:               return "Kalray VLIW core of the MPPA processor family";
> +    case EM_65816:             return "WDC 65816/65C816";
> +    case EM_LOONGARCH:         return "Loongson Loongarch";
> +    case EM_KF32:              return "ChipON KungFu32";
>
>        /* Large numbers...  */
>      case EM_MT:                 return "Morpho Techologies MT processor";
> @@ -2581,7 +2597,6 @@ get_machine_name (unsigned e_machine)
>      case EM_ADAPTEVA_EPIPHANY: return "Adapteva EPIPHANY";
>      case EM_CYGNUS_FRV:                return "Fujitsu FR-V";
>      case EM_S12Z:               return "Freescale S12Z";
> -    case EM_CSKY:              return "C-SKY";
>
>      default:
>        snprintf (buff, sizeof (buff), _("<unknown>: 0x%x"), e_machine);
> diff --git a/include/elf/common.h b/include/elf/common.h
> index 6482f8c0bd..37122ccd99 100644
> --- a/include/elf/common.h
> +++ b/include/elf/common.h
> @@ -339,9 +339,21 @@
>  #define EM_AMDGPU      224     /* AMD GPU architecture */
>  #define EM_RISCV       243     /* RISC-V */
>  #define EM_LANAI       244     /* Lanai 32-bit processor.  */
> +#define EM_CEVA                245     /* CEVA Processor Architecture Family */
> +#define EM_CEVA_X2     246     /* CEVA X2 Processor Family */
>  #define EM_BPF         247     /* Linux BPF – in-kernel virtual machine.  */
> +#define EM_GRAPHCORE_IPU 248   /* Graphcore Intelligent Processing Unit */
> +#define EM_IMG1                249     /* Imagination Technologies */
>  #define EM_NFP         250     /* Netronome Flow Processor.  */
> +#define EM_VE          251     /* NEC Vector Engine */
>  #define EM_CSKY                252     /* C-SKY processor family.  */
> +#define EM_ARC_COMPACT3_64 253 /* Synopsys ARCv2.3 64-bit */
> +#define EM_MCS6502     254     /* MOS Technology MCS 6502 processor */
> +#define EM_ARC_COMPACT3        255     /* Synopsys ARCv2.3 32-bit */
> +#define EM_KVX         256     /* Kalray VLIW core of the MPPA processor family */
> +#define EM_65816       257     /* WDC 65816/65C816 */
> +#define EM_LOONGARCH   258     /* Loongson Loongarch */
> +#define EM_KF32                259     /* ChipON KungFu32 */
>
>  /* If it is necessary to assign new unofficial EM_* values, please pick large
>     random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision


More information about the Binutils mailing list