aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorClaudiu Zissulescu <claziss@gmail.com>2020-01-13 11:16:47 +0200
committerClaudiu Zissulescu <claziss@gmail.com>2020-01-13 11:16:47 +0200
commit5e4f7e0518ee149838e258331ddb339c578501f6 (patch)
treeef60a1f92383167a492c384fc96bef90936c1e39 /gas
parent39fe16e0780ac85a8907e9ad9a38b88066674b03 (diff)
downloadgdb-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')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-arc.c12
-rw-r--r--gas/config/tc-arc.h7
-rw-r--r--gas/testsuite/gas/arc/pseudos.d2
4 files changed, 24 insertions, 4 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index c6f93cc..0bf722b 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2020-01-13 Claudiu Zissulescu <claziss@gmail.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.
+
2020-01-13 Alan Modra <amodra@gmail.com>
* testsuite/gas/wasm32/allinsn.d: Update expected output.
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
diff --git a/gas/config/tc-arc.h b/gas/config/tc-arc.h
index 9bd2ff6..b8eee4f 100644
--- a/gas/config/tc-arc.h
+++ b/gas/config/tc-arc.h
@@ -20,14 +20,15 @@
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
-#include "opcode/arc.h"
-
+#ifndef TC_ARC
/* By convention, you should define this macro in the `.h' file. For
example, `tc-m68k.h' defines `TC_M68K'. You might have to use this
if it is necessary to add CPU specific code to the object format
file. */
#define TC_ARC
+#include "opcode/arc.h"
+
/* We want local label support. */
#define LOCAL_LABELS_FB 1
@@ -267,3 +268,5 @@ struct arc_relax_type
/* Number of flags. Used for re-assembling in md_convert_frag. */
int nflg;
};
+
+#endif
diff --git a/gas/testsuite/gas/arc/pseudos.d b/gas/testsuite/gas/arc/pseudos.d
index 9332f4d..7f59d47 100644
--- a/gas/testsuite/gas/arc/pseudos.d
+++ b/gas/testsuite/gas/arc/pseudos.d
@@ -6,7 +6,7 @@
Disassembly of section .text:
-00000000 <.text>:
+[0]+ <.text>:
0: 1cfc b008 st.aw r0,\[sp,-4\]
4: 1404 3401 ld.ab r1,\[sp,4\]
8: 0901 0002 brlt.* r1,r0,0 ;0x8