Blame SOURCES/binutils-aa64-dwarf2.patch

881b8e
diff -ruP binutils-orig/binutils/dwarf.c binutils-new/binutils/dwarf.c
881b8e
--- binutils-orig/binutils/dwarf.c	2014-08-21 11:06:45.920455860 -0700
881b8e
+++ binutils-new/binutils/dwarf.c	2014-08-21 11:13:15.920455860 -0700
881b8e
@@ -4781,6 +4781,29 @@
881b8e
   dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_x86_64);
881b8e
 }
881b8e
 
881b8e
+static const char *const dwarf_regnames_aarch64[] =
881b8e
+{
881b8e
+   "x0",  "x1",  "x2",  "x3",  "x4",  "x5",  "x6",  "x7", 
881b8e
+   "x8",  "x9", "x10", "x11", "x12", "x13", "x14", "x15", 
881b8e
+  "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23",
881b8e
+  "x24", "x25", "x26", "x27", "x28", "x29", "x30", "sp",
881b8e
+   NULL, "elr",  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,
881b8e
+   NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,
881b8e
+   NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,
881b8e
+   NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,
881b8e
+   "v0",  "v1",  "v2",  "v3",  "v4",  "v5",  "v6",  "v7", 
881b8e
+   "v8",  "v9", "v10", "v11", "v12", "v13", "v14", "v15", 
881b8e
+  "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23",
881b8e
+  "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31",
881b8e
+};
881b8e
+
881b8e
+void
881b8e
+init_dwarf_regnames_aarch64 (void)
881b8e
+{
881b8e
+  dwarf_regnames = dwarf_regnames_aarch64;
881b8e
+  dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_aarch64);
881b8e
+}
881b8e
+
881b8e
 void
881b8e
 init_dwarf_regnames (unsigned int e_machine)
881b8e
 {
881b8e
@@ -4797,6 +4820,10 @@
881b8e
       init_dwarf_regnames_x86_64 ();
881b8e
       break;
881b8e
 
881b8e
+    case EM_AARCH64:
881b8e
+      init_dwarf_regnames_aarch64 ();
881b8e
+      break;
881b8e
+
881b8e
     default:
881b8e
       break;
881b8e
     }
881b8e
diff -ruP binutils-orig/binutils/dwarf.h binutils-new/binutils/dwarf.h
881b8e
--- binutils-orig/binutils/dwarf.h	2013-02-27 12:28:03.000000000 -0800
881b8e
+++ binutils-new/binutils/dwarf.h	2014-08-21 11:13:15.920455860 -0700
881b8e
@@ -232,6 +232,7 @@
881b8e
 extern void init_dwarf_regnames (unsigned int);
881b8e
 extern void init_dwarf_regnames_i386 (void);
881b8e
 extern void init_dwarf_regnames_x86_64 (void);
881b8e
+extern void init_dwarf_regnames_aarch64 (void);
881b8e
 
881b8e
 extern int load_debug_section (enum dwarf_section_display_enum, void *);
881b8e
 extern void free_debug_section (enum dwarf_section_display_enum);
881b8e
diff -ruP binutils-orig/binutils/objdump.c binutils-new/binutils/objdump.c
881b8e
--- binutils-orig/binutils/objdump.c	2013-02-27 12:28:03.000000000 -0800
881b8e
+++ binutils-new/binutils/objdump.c	2014-08-21 11:13:15.930455860 -0700
881b8e
@@ -2404,6 +2404,10 @@
881b8e
 	}
881b8e
       break;
881b8e
 
881b8e
+    case bfd_arch_aarch64:
881b8e
+      init_dwarf_regnames_aarch64();
881b8e
+      break;
881b8e
+
881b8e
     default:
881b8e
       break;
881b8e
     }
881b8e
diff -ruP binutils-orig/gas/config/tc-aarch64.c binutils-new/gas/config/tc-aarch64.c
881b8e
--- binutils-orig/gas/config/tc-aarch64.c	2014-08-21 11:06:48.090455860 -0700
881b8e
+++ binutils-new/gas/config/tc-aarch64.c	2014-08-21 11:13:15.930455860 -0700
881b8e
@@ -5881,12 +5881,15 @@
881b8e
     case REG_TYPE_SP_64:
881b8e
     case REG_TYPE_R_32:
881b8e
     case REG_TYPE_R_64:
881b8e
+      return reg->number;
881b8e
+
881b8e
     case REG_TYPE_FP_B:
881b8e
     case REG_TYPE_FP_H:
881b8e
     case REG_TYPE_FP_S:
881b8e
     case REG_TYPE_FP_D:
881b8e
     case REG_TYPE_FP_Q:
881b8e
-      return reg->number;
881b8e
+      return reg->number + 64;
881b8e
+
881b8e
     default:
881b8e
       break;
881b8e
     }
881b8e
diff -ruP binutils-orig/gas/config/tc-aarch64.h binutils-new/gas/config/tc-aarch64.h
881b8e
--- binutils-orig/gas/config/tc-aarch64.h	2013-02-27 12:28:03.000000000 -0800
881b8e
+++ binutils-new/gas/config/tc-aarch64.h	2014-08-21 11:13:15.930455860 -0700
881b8e
@@ -145,13 +145,13 @@
881b8e
       goto LABEL;								\
881b8e
     }
881b8e
 
881b8e
-#define DWARF2_LINE_MIN_INSN_LENGTH 	2
881b8e
+#define DWARF2_LINE_MIN_INSN_LENGTH 	4
881b8e
 
881b8e
 /* The lr register is r30.  */
881b8e
 #define DWARF2_DEFAULT_RETURN_COLUMN  30
881b8e
 
881b8e
 /* Registers are generally saved at negative offsets to the CFA.  */
881b8e
-#define DWARF2_CIE_DATA_ALIGNMENT     (-4)
881b8e
+#define DWARF2_CIE_DATA_ALIGNMENT     (-8)
881b8e
 
881b8e
 #ifdef OBJ_ELF
881b8e
 # define obj_frob_symbol(sym, punt)	aarch64elf_frob_symbol ((sym), & (punt))