diff options
author | Claudiu Zissulescu <claziss@gmail.com> | 2020-01-13 11:16:47 +0200 |
---|---|---|
committer | Claudiu Zissulescu <claziss@gmail.com> | 2020-01-13 11:16:47 +0200 |
commit | 5e4f7e0518ee149838e258331ddb339c578501f6 (patch) | |
tree | ef60a1f92383167a492c384fc96bef90936c1e39 /gas/config/tc-arc.c | |
parent | 39fe16e0780ac85a8907e9ad9a38b88066674b03 (diff) | |
download | gdb-5e4f7e0518ee149838e258331ddb339c578501f6.zip gdb-5e4f7e0518ee149838e258331ddb339c578501f6.tar.gz gdb-5e4f7e0518ee149838e258331ddb339c578501f6.tar.bz2 |
[ARC][committed] Code cleanup and improvements.
Code clean up and improvements when changing the cpu from command
line. Also, remove unused/old emulations.
gas/
xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
* config/tc-arc.c (arc_select_cpu): Re-init the bfd if we change
the CPU.
* config/tc-arc.h: Add header if/defs.
* testsuite/gas/arc/pseudos.d: Improve matching pattern.
ls/
xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
* Makefile.am: Remove earcelf_prof.c and earclinux_prof.c
emulations.
* Makefile.in: Regenerate.
* configure.tgt: Likewise.
* emulparams/arcelf_prof.sh: Remove file.
* emulparams/arclinux_prof.sh: Likewise.
opcodes/
xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
* arc-opc.c (C_NE): Make it required.
Diffstat (limited to 'gas/config/tc-arc.c')
-rw-r--r-- | gas/config/tc-arc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c index ed1e3fb..f8d469c 100644 --- a/gas/config/tc-arc.c +++ b/gas/config/tc-arc.c @@ -841,6 +841,7 @@ static void arc_select_cpu (const char *arg, enum mach_selection_type sel) { int i; + static struct cpu_type old_cpu = { 0, 0, 0, E_ARC_OSABI_CURRENT, 0 }; /* We should only set a default if we've not made a selection from some other source. */ @@ -871,7 +872,6 @@ arc_select_cpu (const char *arg, enum mach_selection_type sel) } return; } - /* Initialise static global data about selected machine type. */ selected_cpu.flags = cpu_types[i].flags; selected_cpu.name = cpu_types[i].name; @@ -889,7 +889,17 @@ arc_select_cpu (const char *arg, enum mach_selection_type sel) /* Check if set features are compatible with the chosen CPU. */ arc_check_feature (); + /* If we change the CPU, we need to re-init the bfd. */ + if (mach_selection_mode != MACH_SELECTION_NONE + && (old_cpu.mach != selected_cpu.mach)) + { + bfd_find_target (arc_target_format, stdoutput); + if (! bfd_set_arch_mach (stdoutput, bfd_arch_arc, selected_cpu.mach)) + as_warn (_("Could not set architecture and machine")); + } + mach_selection_mode = sel; + old_cpu = selected_cpu; } /* Here ends all the ARCompact extension instruction assembling |