aarch64: Decode dwarf2 register numbers
authorRichard Henderson <rth@twiddle.net>
Fri, 22 Aug 2014 21:40:10 +0000 (14:40 -0700)
committerRichard Henderson <rth@twiddle.net>
Fri, 22 Aug 2014 21:40:10 +0000 (14:40 -0700)
* dwarf.h (init_dwarf_regnames_aarch64): Declare.
* dwarf.c (dwarf_regnames_aarch64): New.
(init_dwarf_regnames_aarch64): New.
(init_dwarf_regnames): Call it.
* objdump.c (dump_dwarf): Likewise.

binutils/ChangeLog
binutils/dwarf.c
binutils/dwarf.h
binutils/objdump.c

index 782c2fd1177894e6030ba10178e86f3e2291db83..19569d42baf02601392e92105434189e045a7200 100644 (file)
@@ -1,3 +1,11 @@
+2014-08-22  Richard Henderson  <rth@redhat.com>
+
+       * dwarf.h (init_dwarf_regnames_aarch64): Declare.
+       * dwarf.c (dwarf_regnames_aarch64): New.
+       (init_dwarf_regnames_aarch64): New.
+       (init_dwarf_regnames): Call it.
+       * objdump.c (dump_dwarf): Likewise.
+
 2014-08-19  Alan Modra  <amodra@gmail.com>
 
        * configure: Regenerate.
index a6986ad4045d8ef9cecb30808e8d637cc840d637..348e20ff4a31d033634dd5410fd9b094aef27a25 100644 (file)
@@ -5093,6 +5093,29 @@ init_dwarf_regnames_x86_64 (void)
   dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_x86_64);
 }
 
+static const char *const dwarf_regnames_aarch64[] =
+{
+   "x0",  "x1",  "x2",  "x3",  "x4",  "x5",  "x6",  "x7", 
+   "x8",  "x9", "x10", "x11", "x12", "x13", "x14", "x15", 
+  "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23",
+  "x24", "x25", "x26", "x27", "x28", "x29", "x30", "sp",
+   NULL, "elr",  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,
+   NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,
+   NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,
+   NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,
+   "v0",  "v1",  "v2",  "v3",  "v4",  "v5",  "v6",  "v7", 
+   "v8",  "v9", "v10", "v11", "v12", "v13", "v14", "v15", 
+  "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23",
+  "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31",
+};
+
+void
+init_dwarf_regnames_aarch64 (void)
+{
+  dwarf_regnames = dwarf_regnames_aarch64;
+  dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_aarch64);
+}
+
 void
 init_dwarf_regnames (unsigned int e_machine)
 {
@@ -5109,6 +5132,10 @@ init_dwarf_regnames (unsigned int e_machine)
       init_dwarf_regnames_x86_64 ();
       break;
 
+    case EM_AARCH64:
+      init_dwarf_regnames_aarch64 ();
+      break;
+
     default:
       break;
     }
index db235a9112c28f7686a91fd5702f7745e64907cd..124d9d6d3583277d7b48514f34fdaf8835945d5f 100644 (file)
@@ -235,6 +235,7 @@ extern int dwarf_check;
 extern void init_dwarf_regnames (unsigned int);
 extern void init_dwarf_regnames_i386 (void);
 extern void init_dwarf_regnames_x86_64 (void);
+extern void init_dwarf_regnames_aarch64 (void);
 
 extern int load_debug_section (enum dwarf_section_display_enum, void *);
 extern void free_debug_section (enum dwarf_section_display_enum);
index 5086a15c190e4468d4d7ac52834d53b4cf03bc27..413de5600cd3bf4f7fe3d12a032f1bdab8731682 100644 (file)
@@ -2407,6 +2407,10 @@ dump_dwarf (bfd *abfd)
        }
       break;
 
+    case bfd_arch_aarch64:
+      init_dwarf_regnames_aarch64();
+      break;
+
     default:
       break;
     }