From 3db9073904a273776c456d2599027d3ee37791ec Mon Sep 17 00:00:00 2001 From: Alex Coplan Date: Fri, 24 Sep 2021 13:56:59 +0100 Subject: [PATCH] aarch64: Mark purecap object files with EF_AARCH64_CHERI_PURECAP This simple patch sets the ELF header flag EF_AARCH64_CHERI_PURECAP for purecap Morello object files, as documented in aaelf64-morello: https://github.com/ARM-software/abi-aa/blob/main/aaelf64-morello/aaelf64-morello.rst gas/ChangeLog: 2021-09-24 Alex Coplan * config/tc-aarch64.c (md_begin): Set the ELF header flag EF_AARCH64_CHERI_PURECAP if we have the C64 extension. --- gas/ChangeLog | 5 +++++ gas/config/tc-aarch64.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/gas/ChangeLog b/gas/ChangeLog index 56ff44ce127..1bd68680e14 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2021-09-24 Alex Coplan + + * config/tc-aarch64.c (md_begin): Set the ELF header flag + EF_AARCH64_CHERI_PURECAP if we have the C64 extension. + 2021-09-24 Alex Coplan * testsuite/gas/aarch64/morello_ldst-c64.d: Update following diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 5c0a8067168..e1762df395e 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -9518,6 +9518,11 @@ md_begin (void) mach = ilp32_p ? bfd_mach_aarch64_ilp32 : bfd_mach_aarch64; bfd_set_arch_mach (stdoutput, TARGET_ARCH, mach); + +#ifdef OBJ_ELF + if (IS_C64) + bfd_set_private_flags (stdoutput, EF_AARCH64_CHERI_PURECAP); +#endif } /* Command line processing. */ -- 2.39.2