]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
aarch64: Mark purecap object files with EF_AARCH64_CHERI_PURECAP
authorAlex Coplan <alex.coplan@arm.com>
Fri, 24 Sep 2021 12:56:59 +0000 (13:56 +0100)
committerAlex Coplan <alex.coplan@arm.com>
Fri, 24 Sep 2021 12:56:59 +0000 (13:56 +0100)
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  <alex.coplan@arm.com>

* config/tc-aarch64.c (md_begin): Set the ELF header flag
EF_AARCH64_CHERI_PURECAP if we have the C64 extension.

gas/ChangeLog
gas/config/tc-aarch64.c

index 56ff44ce127d9583a98bdfc7916d23837022854b..1bd68680e141a33de1cc338212e4aaffc00fc801 100644 (file)
@@ -1,3 +1,8 @@
+2021-09-24  Alex Coplan  <alex.coplan@arm.com>
+
+       * 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  <alex.coplan@arm.com>
 
        * testsuite/gas/aarch64/morello_ldst-c64.d: Update following
index 5c0a8067168c2f9e0330f8b5c8c2f80c560c058c..e1762df395efbbb9898784c5ee5b0dae4457a260 100644 (file)
@@ -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.  */