From 7e23b94e2937713acdf368220f88bf7b581e656a Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 2 Mar 2020 10:49:02 -0800 Subject: [PATCH] Add CHERI-RISC-V ELF header flags. --- binutils/readelf.c | 6 ++++++ include/elf/riscv.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/binutils/readelf.c b/binutils/readelf.c index 87f88fe371b..3d0024e069b 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -4153,6 +4153,12 @@ get_machine_flags (Filedata * filedata, unsigned e_flags, unsigned e_machine) strcat (buf, ", quad-float ABI"); break; } + + if (e_flags & EF_RISCV_CHERIABI) + strcat (buf, ", CheriABI"); + + if (e_flags & EF_RISCV_CAPMODE) + strcat (buf, ", capmode"); break; case EM_SH: diff --git a/include/elf/riscv.h b/include/elf/riscv.h index d0acf6886d8..34b02f05448 100644 --- a/include/elf/riscv.h +++ b/include/elf/riscv.h @@ -114,6 +114,12 @@ END_RELOC_NUMBERS (R_RISCV_max) /* File uses the 32E base integer instruction. */ #define EF_RISCV_RVE 0x0008 +/* File uses CheriABI. */ +#define EF_RISCV_CHERIABI 0x00010000 + +/* File uses capability mode encodings. */ +#define EF_RISCV_CAPMODE 0x00020000 + /* The name of the global pointer symbol. */ #define RISCV_GP_SYMBOL "__global_pointer$" -- 2.47.2