[ARC][committed] Code cleanup and improvements.
authorClaudiu Zissulescu <claziss@gmail.com>
Mon, 13 Jan 2020 09:16:47 +0000 (11:16 +0200)
committerClaudiu Zissulescu <claziss@gmail.com>
Mon, 13 Jan 2020 09:16:47 +0000 (11:16 +0200)
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.

12 files changed:
gas/ChangeLog
gas/config/tc-arc.c
gas/config/tc-arc.h
gas/testsuite/gas/arc/pseudos.d
ld/ChangeLog
ld/Makefile.am
ld/Makefile.in
ld/configure.tgt
ld/emulparams/arcelf_prof.sh [deleted file]
ld/emulparams/arclinux_prof.sh [deleted file]
opcodes/ChangeLog
opcodes/arc-opc.c

index c6f93cc8d2e6e3fd8faf4ba37af52edd3d77e0d5..0bf722b2099f62a8a3e954c98b616d1e7b51fab7 100644 (file)
@@ -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.
index ed1e3fb5dd5c9504c66e1f377f3d85a4f322a33b..f8d469cc2e1a52430fa02bce9c1c0e3cb476b207 100644 (file)
@@ -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
index 9bd2ff67b31c3ba6193a7a3dbf690d190c1e2709..b8eee4fb0522d6ee2162ecfdf0ccb69d4fc210dd 100644 (file)
    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
index 9332f4d787d559276d77036e0fdd6ce59ac489fe..7f59d472399a9cf124790d256aea6d3582287998 100644 (file)
@@ -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
index 58f9b8b44cf3a314732147da944293249ba464cf..0c4a05631396dd8ec006b0b90997911e895831c5 100644 (file)
@@ -1,3 +1,12 @@
+2020-01-13  Claudiu Zissulescu  <claziss@gmail.com>
+
+       * Makefile.am: Remove earcelf_prof.c and earclinux_prof.c
+       emulations.
+       * configure.tgt: Likewise.
+       * Makefile.in: Regenerate.
+       * emulparams/arcelf_prof.sh: Remove file.
+       * emulparams/arclinux_prof.sh: Likewise.
+
 2020-01-13  Claudiu Zissulescu  <claziss@gmail.com>
 
        * scripttempl/elfarcv2.sc : Allow interrupt vector table to be
index 2c7e337cea2d893a83dab7225f9a70643c3e45bb..2ed13eba87c27958fd4f15371d6ed5ca30f4ada0 100644 (file)
@@ -170,10 +170,8 @@ ALL_EMULATION_SOURCES = \
        earcv2elf.c \
        earcv2elfx.c \
        earcelf.c \
-       earcelf_prof.c \
        earclinux.c \
        earclinux_nps.c \
-       earclinux_prof.c \
        earm_wince_pe.c \
        earmelf.c \
        earmelf_fbsd.c \
@@ -660,10 +658,8 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earcv2elf.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earcv2elfx.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earcelf.Pc@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earcelf_prof.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earclinux.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earclinux_nps.Pc@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earclinux_prof.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earm_wince_pe.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_fbsd.Pc@am__quote@
index e79a8c855b76d6fcb0b16c70ddcc4ae6db678bfa..f635845643531d9e566a5b5ba7854fdc76dfd170 100644 (file)
@@ -660,10 +660,8 @@ ALL_EMULATION_SOURCES = \
        earcv2elf.c \
        earcv2elfx.c \
        earcelf.c \
-       earcelf_prof.c \
        earclinux.c \
        earclinux_nps.c \
-       earclinux_prof.c \
        earm_wince_pe.c \
        earmelf.c \
        earmelf_fbsd.c \
@@ -1215,10 +1213,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ealpha.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ealphavms.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earcelf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earcelf_prof.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earclinux.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earclinux_nps.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earclinux_prof.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earcv2elf.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earcv2elfx.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earm_wince_pe.Po@am__quote@
@@ -2266,10 +2262,8 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earcv2elf.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earcv2elfx.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earcelf.Pc@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earcelf_prof.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earclinux.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earclinux_nps.Pc@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earclinux_prof.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earm_wince_pe.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_fbsd.Pc@am__quote@
index 18c3ba4c4d43539974ac0c758beb124b72202867..23194e357f8eee50f06a6ff2b36f4e431190dade 100644 (file)
@@ -105,7 +105,7 @@ alpha*-*-*vms*)             targ_emul=alphavms
 am33_2.0-*-linux*)     targ_emul=elf32am33lin # mn10300 variant
                        ;;
 arc*-*-elf*)           targ_emul=arcelf
-                       targ_extra_emuls="arcelf_prof arclinux arclinux_nps arclinux_prof arcv2elf arcv2elfx"
+                       targ_extra_emuls="arclinux arclinux_nps arcv2elf arcv2elfx"
                        ;;
 arc*-*-linux*)         case "${with_cpu}" in
                        nps400) targ_emul=arclinux_nps
@@ -115,7 +115,7 @@ arc*-*-linux*)              case "${with_cpu}" in
                                targ_extra_emuls=arclinux_nps
                                ;;
                        esac
-                       targ_extra_emuls="${targ_extra_emuls} arclinux_prof arcelf arcelf_prof arcv2elf arcv2elfx"
+                       targ_extra_emuls="${targ_extra_emuls} arcelf arcv2elf arcv2elfx"
                        ;;
 arm*-*-cegcc*)         targ_emul=arm_wince_pe
                        targ_extra_ofiles="deffilep.o pe-dll.o"
diff --git a/ld/emulparams/arcelf_prof.sh b/ld/emulparams/arcelf_prof.sh
deleted file mode 100644 (file)
index cd01769..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-source_sh ${srcdir}/emulparams/arc-endianness.sh
-SCRIPT_NAME=elfarc
-TEMPLATE_NAME=elf
-if [ "x${ARC_ENDIAN}" = "xbig" ]; then
-  OUTPUT_FORMAT="elf32-bigarc"
-else
-  OUTPUT_FORMAT="elf32-littlearc"
-fi
-LITTLE_OUTPUT_FORMAT="elf32-littlearc"
-BIG_OUTPUT_FORMAT="elf32-bigarc"
-# leave room for vector table, 32 vectors * 8 bytes
-TEXT_START_ADDR=0x100
-MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
-#NONPAGED_TEXT_START_ADDR=0x0
-ARCH=arc
-MACHINE=
-ENTRY=__start
-SDATA_START_SYMBOLS='__SDATA_BEGIN__ = .;'
-OTHER_READONLY_SECTIONS="
-  .__arc_profile_desc ${RELOCATING-0} : { *(.__arc_profile_desc) }
-  .__arc_profile_forward ${RELOCATING-0} : { *(.__arc_profile_forward) }
-"
-OTHER_BSS_SECTIONS="
-  .__arc_profile_counters ${RELOCATING-0} : { *(.__arc_profile_counters) }
-"
-EMBEDDED=yes
diff --git a/ld/emulparams/arclinux_prof.sh b/ld/emulparams/arclinux_prof.sh
deleted file mode 100644 (file)
index da5ab40..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-source_sh ${srcdir}/emulparams/arc-endianness.sh
-SCRIPT_NAME=arclinux
-if [ "x${ARC_ENDIAN}" = "xbig" ]; then
-  OUTPUT_FORMAT="elf32-bigarc"
-else
-  OUTPUT_FORMAT="elf32-littlearc"
-fi
-LITTLE_OUTPUT_FORMAT="elf32-littlearc"
-BIG_OUTPUT_FORMAT="elf32-bigarc"
-TEXT_START_ADDR=0x10000
-MAXPAGESIZE=0x2000
-COMMONPAGESIZE=0x2000
-NONPAGED_TEXT_START_ADDR=0x10000
-ARCH=arc
-MACHINE=
-ENTRY=__start
-TEMPLATE_NAME=elf
-EXTRA_EM_FILE=arclinux
-GENERATE_SHLIB_SCRIPT=yes
-SDATA_START_SYMBOLS='__SDATA_BEGIN__ = .;'
-OTHER_READONLY_SECTIONS="
-  .__arc_profile_desc ${RELOCATING-0} : { *(.__arc_profile_desc) }
-  .__arc_profile_forward ${RELOCATING-0} : { *(.__arc_profile_forward) }
-"
-OTHER_BSS_SECTIONS="
-  .__arc_profile_counters ${RELOCATING-0} : { *(.__arc_profile_counters) }
-"
index 91ce74284632fb984bfe1560e3548d72a807f94e..bb235dce4cae859a6199c037630f2ca3b8a355d9 100644 (file)
@@ -1,3 +1,7 @@
+2012-01-13  Claudiu Zissulescu <claziss@gmail.com>
+
+       * arc-opc.c (C_NE): Make it required.
+
 2012-01-13  Claudiu Zissulescu <claziss@gmail.com>
 
         * opcode/arc-dis.c (regnames): Correct ACCL/ACCH naming, fix typo
index b90e5dad1b0c798e99d0de453dcaf05b0b79e6aa..675738aa6befdf1bc016b3bc8ddff5ff36d3b557 100644 (file)
@@ -1691,7 +1691,7 @@ const struct arc_flag_class arc_flag_classes[] =
   { F_CLASS_OPTIONAL, { F_ASFAKE, F_NULL}},
 
 #define C_NE       (C_AS + 1)
-  { F_CLASS_OPTIONAL, { F_NE, F_NULL}},
+  { F_CLASS_REQUIRED, { F_NE, F_NULL}},
 
   /* ARC NPS400 Support: See comment near head of file.  */
 #define C_NPS_CL     (C_NE + 1)