MIPS/opcodes: Reorder ELF file header flag handling in disassembler
authorMaciej W. Rozycki <macro@imgtec.com>
Wed, 14 Dec 2016 21:27:00 +0000 (21:27 +0000)
committerMaciej W. Rozycki <macro@imgtec.com>
Wed, 14 Dec 2016 22:09:08 +0000 (22:09 +0000)
Move ELF file header flag interpretation code, used to set disassembler
options, beyond architecture setup.  No functional change as the effects
of both code sections are disjoint from each other, but this provides
for a further expansion of ELF file header flag interpretation.

opcodes/
* mips-dis.c (set_default_mips_dis_options): Reorder ELF file
header flag interpretation code.

opcodes/ChangeLog
opcodes/mips-dis.c

index 0138a9e5f6b3fbac310516b1453017e6e1334626..3f74c26931c6aef4d35f28c014b14183252cc770 100644 (file)
@@ -1,3 +1,8 @@
+2016-12-14  Maciej W. Rozycki  <macro@imgtec.com>
+
+       * mips-dis.c (set_default_mips_dis_options): Reorder ELF file
+       header flag interpretation code.
+
 2016-12-14  Maciej W. Rozycki  <macro@imgtec.com>
 
        * mips16-opc.c (mips16_opcodes): Set RD_SP rather than RD_PC in
index b3daacd1c65f1fff48ef147127d7e0b5d30f09b5..380a675b9dcccbd1bdac6255d468ff883727087c 100644 (file)
@@ -785,19 +785,6 @@ set_default_mips_dis_options (struct disassemble_info *info)
   mips_hwr_names = mips_hwr_names_numeric;
   no_aliases = 0;
 
-  /* Update settings according to the ELF file header flags.  */
-  if (info->flavour == bfd_target_elf_flavour && info->section != NULL)
-    {
-      Elf_Internal_Ehdr *header;
-
-      header = elf_elfheader (info->section->owner);
-      /* If an ELF "newabi" binary, use the n32/(n)64 GPR names.  */
-      if (is_newabi (header))
-       mips_gpr_names = mips_gpr_names_newabi;
-      /* If a microMIPS binary, then don't use MIPS16 bindings.  */
-      micromips_ase = is_micromips (header);
-    }
-
   /* Set ISA, architecture, and cp0 register names as best we can.  */
 #if ! SYMTAB_AVAILABLE
   /* This is running out on a target machine, not in a host tool.
@@ -819,6 +806,19 @@ set_default_mips_dis_options (struct disassemble_info *info)
       mips_hwr_names = chosen_arch->hwr_names;
     }
 #endif
+
+  /* Update settings according to the ELF file header flags.  */
+  if (info->flavour == bfd_target_elf_flavour && info->section != NULL)
+    {
+      Elf_Internal_Ehdr *header;
+
+      header = elf_elfheader (info->section->owner);
+      /* If an ELF "newabi" binary, use the n32/(n)64 GPR names.  */
+      if (is_newabi (header))
+       mips_gpr_names = mips_gpr_names_newabi;
+      /* If a microMIPS binary, then don't use MIPS16 bindings.  */
+      micromips_ase = is_micromips (header);
+    }
 }
 
 static void
This page took 0.028654 seconds and 4 git commands to generate.