gas: Add CodeView constant for aarch64
authorMark Harmstone <mark@harmstone.com>
Wed, 25 Jan 2023 23:54:37 +0000 (23:54 +0000)
committerMark Harmstone <mark@harmstone.com>
Fri, 27 Jan 2023 04:03:15 +0000 (04:03 +0000)
Adds the correct constant to the S_COMPILE3 CodeView record when
assembling aarch64-w64-mingw32 with the -gcodeview flag.

gas/codeview.c
gas/codeview.h

index 2d96d4467fcf204a137002f5c074c32e60bc9634..0d5f82848a5bcde25ae9e45e3314c9affcc5304f 100644 (file)
@@ -286,13 +286,20 @@ write_lines_info (void)
 static uint16_t
 target_processor (void)
 {
-  if (stdoutput->arch_info->arch != bfd_arch_i386)
-    return 0;
+  switch (stdoutput->arch_info->arch)
+    {
+    case bfd_arch_i386:
+      if (stdoutput->arch_info->mach & bfd_mach_x86_64)
+       return CV_CFL_X64;
+      else
+       return CV_CFL_80386;
 
-  if (stdoutput->arch_info->mach & bfd_mach_x86_64)
-    return CV_CFL_X64;
-  else
-    return CV_CFL_80386;
+    case bfd_arch_aarch64:
+      return CV_CFL_ARM64;
+
+    default:
+      return 0;
+    }
 }
 
 /* Write the CodeView symbols, describing the object name and
index def2a395748a967092f09040b7c6a67c61c44cff..2a3d8fc15e1746fc6a2584fbecf615c41e0114ce 100644 (file)
@@ -38,6 +38,7 @@
 
 #define CV_CFL_80386           0x03
 #define CV_CFL_X64             0xD0
+#define CV_CFL_ARM64           0xF6
 
 #define CHKSUM_TYPE_MD5                1