This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[committed] MIPS/opcodes: Reorder ELF file header flag handling in disassembler
- From: "Maciej W. Rozycki" <macro at imgtec dot com>
- To: <binutils at sourceware dot org>
- Date: Wed, 14 Dec 2016 22:27:19 +0000
- Subject: [committed] MIPS/opcodes: Reorder ELF file header flag handling in disassembler
- Authentication-results: sourceware.org; auth=none
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.
---
No regressions with the usual MIPS test targets. Committed.
Maciej
binutils-opcodes-mips-dis-options-swap.diff
Index: binutils/opcodes/mips-dis.c
===================================================================
--- binutils.orig/opcodes/mips-dis.c 2016-11-29 20:44:43.189073222 +0000
+++ binutils/opcodes/mips-dis.c 2016-12-02 21:25:40.139680874 +0000
@@ -785,19 +819,6 @@ set_default_mips_dis_options (struct dis
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 +840,19 @@ set_default_mips_dis_options (struct dis
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