make use of meabi_flags be ELF specific
[deliverable/binutils-gdb.git] / gas / config / tc-arm.c
index a08b024e934a98b1a9759143243db65c21a84db9..a7ebc51ccd2b0cff4208c7818a7610e3dc0ed616 100644 (file)
@@ -4,6 +4,8 @@
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
        Modified by David Taylor (dtaylor@armltd.co.uk)
        Cirrus coprocessor mods by Aldy Hernandez (aldyh@redhat.com)
+       Cirrus coprocessor fixes by Petko Manolov (petkan@nucleusys.com)
+       Cirrus coprocessor fixes by Vladimir Ivanov (vladitx@nucleusys.com)
 
    This file is part of GAS, the GNU Assembler.
 
 #define FPU_VFP_EXT_V1xD 0x10000000    /* Base VFP instruction set.  */
 #define FPU_VFP_EXT_V1  0x08000000     /* Double-precision insns.    */
 #define FPU_VFP_EXT_V2  0x04000000     /* ARM10E VFPr1.              */
+#define FPU_MAVERICK    0x02000000     /* Cirrus Maverick.           */
 #define FPU_NONE        0
 
 #define FPU_ARCH_FPE    FPU_FPA_EXT_V1
 #define FPU_ARCH_VFP_V1   (FPU_ARCH_VFP_V1xD | FPU_VFP_EXT_V1)
 #define FPU_ARCH_VFP_V2          (FPU_ARCH_VFP_V1 | FPU_VFP_EXT_V2)
 
+#define FPU_ARCH_MAVERICK  FPU_MAVERICK
+
+enum arm_float_abi
+{
+  ARM_FLOAT_ABI_HARD,
+  ARM_FLOAT_ABI_SOFTFP,
+  ARM_FLOAT_ABI_SOFT
+};
+
 /* Types of processor to assemble for.  */
 #define ARM_1          ARM_ARCH_V1
 #define ARM_2          ARM_ARCH_V2
@@ -178,6 +190,10 @@ static int mcpu_fpu_opt = -1;
 static int march_cpu_opt = -1;
 static int march_fpu_opt = -1;
 static int mfpu_opt = -1;
+static int mfloat_abi_opt = -1;
+#ifdef OBJ_ELF
+static int meabi_flags = EF_ARM_EABI_UNKNOWN;
+#endif
 
 /* This array holds the chars that always start a comment.  If the
    pre-processor is disabled, these aren't very useful.  */
@@ -918,7 +934,8 @@ static void do_vfp_sp_dyadic        PARAMS ((char *));
 static void do_vfp_dp_dyadic   PARAMS ((char *));
 static void do_vfp_reg_from_sp  PARAMS ((char *));
 static void do_vfp_sp_from_reg  PARAMS ((char *));
-static void do_vfp_sp_reg2     PARAMS ((char *));
+static void do_vfp_reg2_from_sp2 PARAMS ((char *));
+static void do_vfp_sp2_from_reg2 PARAMS ((char *));
 static void do_vfp_reg_from_dp  PARAMS ((char *));
 static void do_vfp_reg2_from_dp PARAMS ((char *));
 static void do_vfp_dp_from_reg  PARAMS ((char *));
@@ -1099,8 +1116,8 @@ static int cp_byte_address_required_here  PARAMS ((char **));
 /* "INSN<cond> X,Y" where X:bit16, Y:bit12.  */
 #define MAV_MODE2      0x0c10
 
-/* "INSN<cond> X,Y" where X:0, Y:bit16.  */
-#define MAV_MODE3      0x1000
+/* "INSN<cond> X,Y" where X:bit12, Y:bit16.  */
+#define MAV_MODE3      0x100c
 
 /* "INSN<cond> X,Y,Z" where X:16, Y:0, Z:12.  */
 #define MAV_MODE4      0x0c0010
@@ -1965,8 +1982,8 @@ static const struct asm_opcode insns[] =
   {"fcmpezd", 0xeeb50bc0, 7, FPU_VFP_EXT_V1,   do_vfp_dp_compare_z},
 
   /* VFP V2.  */
-  {"fmsrr",   0xec400a10, 5, FPU_VFP_EXT_V2,   do_vfp_sp_reg2},
-  {"fmrrs",   0xec500a10, 5, FPU_VFP_EXT_V2,   do_vfp_sp_reg2},
+  {"fmsrr",   0xec400a10, 5, FPU_VFP_EXT_V2,   do_vfp_sp2_from_reg2},
+  {"fmrrs",   0xec500a10, 5, FPU_VFP_EXT_V2,   do_vfp_reg2_from_sp2},
   {"fmdrr",   0xec400b10, 5, FPU_VFP_EXT_V2,   do_vfp_dp_from_reg2},
   {"fmrrd",   0xec500b10, 5, FPU_VFP_EXT_V2,   do_vfp_reg2_from_dp},
 
@@ -2163,18 +2180,18 @@ static const struct asm_opcode insns[] =
   {"cfmvr64l",   0xee100510, 8,  ARM_CEXT_MAVERICK, do_mav_binops_1c},
   {"cfmv64hr",   0xee000530, 8,  ARM_CEXT_MAVERICK, do_mav_binops_2c},
   {"cfmvr64h",   0xee100530, 8,  ARM_CEXT_MAVERICK, do_mav_binops_1c},
-  {"cfmval32",   0xee100610, 8,  ARM_CEXT_MAVERICK, do_mav_binops_3a},
-  {"cfmv32al",   0xee000610, 8,  ARM_CEXT_MAVERICK, do_mav_binops_3b},
-  {"cfmvam32",   0xee100630, 8,  ARM_CEXT_MAVERICK, do_mav_binops_3a},
-  {"cfmv32am",   0xee000630, 8,  ARM_CEXT_MAVERICK, do_mav_binops_3b},
-  {"cfmvah32",   0xee100650, 8,  ARM_CEXT_MAVERICK, do_mav_binops_3a},
-  {"cfmv32ah",   0xee000650, 8,  ARM_CEXT_MAVERICK, do_mav_binops_3b},
-  {"cfmva32",    0xee100670, 7,  ARM_CEXT_MAVERICK, do_mav_binops_3a},
-  {"cfmv32a",    0xee000670, 7,  ARM_CEXT_MAVERICK, do_mav_binops_3b},
-  {"cfmva64",    0xee100690, 7,  ARM_CEXT_MAVERICK, do_mav_binops_3c},
-  {"cfmv64a",    0xee000690, 7,  ARM_CEXT_MAVERICK, do_mav_binops_3d},
-  {"cfmvsc32",   0xee1006b0, 8,  ARM_CEXT_MAVERICK, do_mav_dspsc_1},
-  {"cfmv32sc",   0xee0006b0, 8,  ARM_CEXT_MAVERICK, do_mav_dspsc_2},
+  {"cfmval32",   0xee200440, 8,  ARM_CEXT_MAVERICK, do_mav_binops_3a},
+  {"cfmv32al",   0xee100440, 8,  ARM_CEXT_MAVERICK, do_mav_binops_3b},
+  {"cfmvam32",   0xee200460, 8,  ARM_CEXT_MAVERICK, do_mav_binops_3a},
+  {"cfmv32am",   0xee100460, 8,  ARM_CEXT_MAVERICK, do_mav_binops_3b},
+  {"cfmvah32",   0xee200480, 8,  ARM_CEXT_MAVERICK, do_mav_binops_3a},
+  {"cfmv32ah",   0xee100480, 8,  ARM_CEXT_MAVERICK, do_mav_binops_3b},
+  {"cfmva32",    0xee2004a0, 7,  ARM_CEXT_MAVERICK, do_mav_binops_3a},
+  {"cfmv32a",    0xee1004a0, 7,  ARM_CEXT_MAVERICK, do_mav_binops_3b},
+  {"cfmva64",    0xee2004c0, 7,  ARM_CEXT_MAVERICK, do_mav_binops_3c},
+  {"cfmv64a",    0xee1004c0, 7,  ARM_CEXT_MAVERICK, do_mav_binops_3d},
+  {"cfmvsc32",   0xee2004e0, 8,  ARM_CEXT_MAVERICK, do_mav_dspsc_1},
+  {"cfmv32sc",   0xee1004e0, 8,  ARM_CEXT_MAVERICK, do_mav_dspsc_2},
   {"cfcpys",     0xee000400, 6,  ARM_CEXT_MAVERICK, do_mav_binops_1d},
   {"cfcpyd",     0xee000420, 6,  ARM_CEXT_MAVERICK, do_mav_binops_1e},
   {"cfcvtsd",    0xee000460, 7,  ARM_CEXT_MAVERICK, do_mav_binops_1f},
@@ -2536,6 +2553,10 @@ static int arm_parse_extension PARAMS ((char *, int *));
 static int arm_parse_cpu PARAMS ((char *));
 static int arm_parse_arch PARAMS ((char *));
 static int arm_parse_fpu PARAMS ((char *));
+static int arm_parse_float_abi PARAMS ((char *));
+#ifdef OBJ_ELF
+static int arm_parse_eabi PARAMS ((char *));
+#endif
 #if 0 /* Suppressed - for now.  */
 #if defined OBJ_COFF || defined OBJ_ELF
 static void arm_add_note PARAMS ((const char *, const char *, unsigned int));
@@ -4031,7 +4052,6 @@ do_empty (str)
 {
   /* Do nothing really.  */
   end_of_line (str);
-  return;
 }
 
 static void
@@ -4215,7 +4235,6 @@ do_mull (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -4269,7 +4288,6 @@ do_mul (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -4325,7 +4343,6 @@ do_mla (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 /* Expects *str -> the characters "acc0", possibly with leading blanks.
@@ -4877,7 +4894,7 @@ do_umaal (str)
       || skip_past_comma (& str) == FAIL
       || (rm = reg_required_here (& str, 0)) == FAIL
       || skip_past_comma (& str) == FAIL
-      || (rm = reg_required_here (& str, 8)) == FAIL)
+      || (rs = reg_required_here (& str, 8)) == FAIL)
     {
       inst.error = BAD_ARGS;
       return;      
@@ -5760,7 +5777,6 @@ do_cps_mode (str)
     }
   
   inst.instruction |= expr.X_add_number;
-  return;
 }
 
 static void
@@ -6292,7 +6308,6 @@ do_iwmmxt_tandc (str)
 
   if (reg != REG_PC && !inst.error)
     inst.error = _("only r15 allowed here");
-  return;
 }
 
 static void
@@ -6300,8 +6315,6 @@ do_iwmmxt_tbcst (str)
      char * str;
 {
   check_iwmmxt_insn (str, check_tbcst, 0);
-
-  return;
 }
 
 static void
@@ -6314,7 +6327,6 @@ do_iwmmxt_textrc (str)
     return;
 
   inst.instruction |= number & 0x7;
-  return;
 }
 
 static void
@@ -6339,7 +6351,6 @@ do_iwmmxt_tinsr (str)
     return;
 
   inst.instruction |= number & 0x7;
-  return;
 }
 
 static void
@@ -6347,8 +6358,6 @@ do_iwmmxt_tmcr (str)
      char * str;
 {
   check_iwmmxt_insn (str, check_tmcr, 0);
-
-  return;
 }
 
 static void
@@ -6356,8 +6365,6 @@ do_iwmmxt_tmcrr (str)
      char * str;
 {
   check_iwmmxt_insn (str, check_tmcrr, 0);
-
-  return;
 }
 
 static void
@@ -6365,8 +6372,6 @@ do_iwmmxt_tmia (str)
      char * str;
 {
   check_iwmmxt_insn (str, check_tmia, 0);
-
-  return;
 }
 
 static void
@@ -6374,8 +6379,6 @@ do_iwmmxt_tmovmsk (str)
      char * str;
 {
   check_iwmmxt_insn (str, check_tmovmsk, 0);
-
-  return;
 }
 
 static void
@@ -6383,8 +6386,6 @@ do_iwmmxt_tmrc (str)
      char * str;
 {
   check_iwmmxt_insn (str, check_tmrc, 0);
-
-  return;
 }
 
 static void
@@ -6392,8 +6393,6 @@ do_iwmmxt_tmrrc (str)
      char * str;
 {
   check_iwmmxt_insn (str, check_tmrrc, 0);
-
-  return;
 }
 
 static void
@@ -6401,7 +6400,6 @@ do_iwmmxt_torc (str)
      char * str;
 {
   check_iwmmxt_insn (str, check_rd, 0);
-  return;
 }
 
 static void
@@ -6414,7 +6412,6 @@ do_iwmmxt_waligni (str)
     return;
 
   inst.instruction |= ((number & 0x7) << 20);
-  return;
 }
 
 static void
@@ -6425,7 +6422,6 @@ do_iwmmxt_wmov (str)
     return;
   
   inst.instruction |= ((inst.instruction >> 16) & 0xf);
-  return;
 }
 
 static void
@@ -6466,8 +6462,6 @@ do_iwmmxt_wrwr (str)
      char * str;
 {
   check_iwmmxt_insn (str, check_wrwr, 0);
-  
-  return;
 }
 
 static void
@@ -6475,8 +6469,6 @@ do_iwmmxt_wrwrwcg (str)
      char * str;
 {
   check_iwmmxt_insn (str, check_wrwrwcg, 0);
-
-  return;
 }
 
 static void
@@ -6484,8 +6476,6 @@ do_iwmmxt_wrwrwr (str)
      char * str;
 {
   check_iwmmxt_insn (str, check_wrwrwr, 0);
-
-  return;
 }
 
 static void
@@ -6498,7 +6488,6 @@ do_iwmmxt_wshufh (str)
     return;
 
   inst.instruction |= ((number & 0xf0) << 16) | (number & 0xf);
-  return;
 }
 
 static void
@@ -6509,7 +6498,6 @@ do_iwmmxt_wzero (str)
     return;
 
   inst.instruction |= ((inst.instruction & 0xf) << 12) | ((inst.instruction & 0xf) << 16);
-  return;
 }
 
 /* Xscale multiply-accumulate (argument parse)
@@ -7298,7 +7286,6 @@ do_arit (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -7321,7 +7308,9 @@ do_adr (str)
   /* Frag hacking will turn this into a sub instruction if the offset turns
      out to be negative.  */
   inst.reloc.type = BFD_RELOC_ARM_IMMEDIATE;
+#ifndef TE_WINCE
   inst.reloc.exp.X_add_number -= 8; /* PC relative adjust.  */
+#endif
   inst.reloc.pc_rel = 1;
 
   end_of_line (str);
@@ -7352,11 +7341,11 @@ do_adrl (str)
   /* Frag hacking will turn this into a sub instruction if the offset turns
      out to be negative.  */
   inst.reloc.type              = BFD_RELOC_ARM_ADRL_IMMEDIATE;
+#ifndef TE_WINCE  
   inst.reloc.exp.X_add_number -= 8; /* PC relative adjust  */
+#endif
   inst.reloc.pc_rel            = 1;
   inst.size                    = INSN_SIZE * 2;
-
-  return;
 }
 
 static void
@@ -7381,7 +7370,6 @@ do_cmp (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -7406,7 +7394,6 @@ do_mov (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static int
@@ -7657,7 +7644,6 @@ do_ldst (str)
 
   inst.instruction |= (pre_inc ? PRE_INDEX : 0);
   end_of_line (str);
-  return;
 }
 
 static void
@@ -7736,7 +7722,6 @@ do_ldstt (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static int
@@ -7992,7 +7977,6 @@ do_ldstv4 (str)
 
   inst.instruction |= (pre_inc ? PRE_INDEX : 0);
   end_of_line (str);
-  return;
 }
 
 static long
@@ -8189,7 +8173,6 @@ do_ldmstm (str)
 
   inst.instruction |= range;
   end_of_line (str);
-  return;
 }
 
 static void
@@ -8208,8 +8191,6 @@ do_swi (str)
   inst.reloc.type = BFD_RELOC_ARM_SWI;
   inst.reloc.pc_rel = 0;
   end_of_line (str);
-
-  return;
 }
 
 static void
@@ -8270,7 +8251,6 @@ do_swap (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -8315,7 +8295,6 @@ do_branch (str)
 #endif /* OBJ_ELF  */
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -8397,7 +8376,6 @@ do_cdp (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -8433,7 +8411,6 @@ do_lstc (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -8495,7 +8472,6 @@ do_co_reg (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -8515,7 +8491,6 @@ do_fpa_ctrl (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -8711,7 +8686,6 @@ do_fpa_dyadic (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -8736,7 +8710,6 @@ do_fpa_monadic (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -8761,7 +8734,6 @@ do_fpa_cmp (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -8786,7 +8758,6 @@ do_fpa_from_reg (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -8807,7 +8778,6 @@ do_fpa_to_reg (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static int
@@ -8906,7 +8876,6 @@ do_vfp_sp_monadic (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -8927,7 +8896,6 @@ do_vfp_dp_monadic (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -8950,7 +8918,6 @@ do_vfp_sp_dyadic (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -8973,7 +8940,6 @@ do_vfp_dp_dyadic (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -8994,19 +8960,16 @@ do_vfp_reg_from_sp (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
-do_vfp_sp_reg2 (str)
+do_vfp_reg2_from_sp2 (str)
      char *str;
 {
   skip_whitespace (str);
 
-  if (reg_required_here (&str, 12) == FAIL)
-    return;
-
-  if (skip_past_comma (&str) == FAIL
+  if (reg_required_here (&str, 12) == FAIL
+      || skip_past_comma (&str) == FAIL
       || reg_required_here (&str, 16) == FAIL
       || skip_past_comma (&str) == FAIL)
     {
@@ -9023,7 +8986,6 @@ do_vfp_sp_reg2 (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -9044,7 +9006,32 @@ do_vfp_sp_from_reg (str)
     }
 
   end_of_line (str);
-  return;
+}
+
+static void
+do_vfp_sp2_from_reg2 (str)
+     char *str;
+{
+  skip_whitespace (str);
+
+  /* We require exactly two consecutive SP registers.  */
+  if (vfp_sp_reg_list (&str, VFP_REG_Sm) != 2)
+    {
+      if (! inst.error)
+       inst.error = _("only two consecutive VFP SP registers allowed here");
+    }
+
+  if (skip_past_comma (&str) == FAIL
+      || reg_required_here (&str, 12) == FAIL
+      || skip_past_comma (&str) == FAIL
+      || reg_required_here (&str, 16) == FAIL)
+    {
+      if (! inst.error)
+       inst.error = BAD_ARGS;
+      return;
+    }
+
+  end_of_line (str);
 }
 
 static void
@@ -9065,7 +9052,6 @@ do_vfp_reg_from_dp (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -9088,7 +9074,6 @@ do_vfp_reg2_from_dp (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -9109,7 +9094,6 @@ do_vfp_dp_from_reg (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -9124,7 +9108,7 @@ do_vfp_dp_from_reg2 (str)
   if (skip_past_comma (&str) == FAIL
       || reg_required_here (&str, 12) == FAIL
       || skip_past_comma (&str) == FAIL
-      || reg_required_here (&str, 16))
+      || reg_required_here (&str, 16) == FAIL)
     {
       if (! inst.error)
        inst.error = BAD_ARGS;
@@ -9132,7 +9116,6 @@ do_vfp_dp_from_reg2 (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static const struct vfp_reg *
@@ -9211,7 +9194,6 @@ do_vfp_reg_from_ctrl (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -9232,7 +9214,6 @@ do_vfp_ctrl_from_reg (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -9257,7 +9238,6 @@ do_vfp_sp_ldst (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -9282,7 +9262,6 @@ do_vfp_dp_ldst (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 /* Parse and encode a VFP SP register list, storing the initial
@@ -9649,7 +9628,6 @@ do_vfp_sp_compare_z (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -9666,7 +9644,6 @@ do_vfp_dp_compare_z (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -9687,7 +9664,6 @@ do_vfp_dp_sp_cvt (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 static void
@@ -9708,7 +9684,6 @@ do_vfp_sp_dp_cvt (str)
     }
 
   end_of_line (str);
-  return;
 }
 
 /* Thumb specific routines.  */
@@ -10608,7 +10583,7 @@ do_mav_quad_6b (str)
             REG_TYPE_MVFX);
 }
 
-/* cfmvsc32<cond> DSPSC,MVFX[15:0].  */
+/* cfmvsc32<cond> DSPSC,MVDX[15:0].  */
 static void
 do_mav_dspsc_1 (str)
      char * str;
@@ -10618,7 +10593,7 @@ do_mav_dspsc_1 (str)
   /* cfmvsc32.  */
   if (mav_reg_required_here (&str, -1, REG_TYPE_DSPSC) == FAIL
       || skip_past_comma (&str) == FAIL
-      || mav_reg_required_here (&str, 16, REG_TYPE_MVFX) == FAIL)
+      || mav_reg_required_here (&str, 12, REG_TYPE_MVDX) == FAIL)
     {
       if (!inst.error)
        inst.error = BAD_ARGS;
@@ -10629,7 +10604,7 @@ do_mav_dspsc_1 (str)
   end_of_line (str);
 }
 
-/* cfmv32sc<cond> MVFX[15:0],DSPSC.  */
+/* cfmv32sc<cond> MVDX[15:0],DSPSC.  */
 static void
 do_mav_dspsc_2 (str)
      char * str;
@@ -10637,7 +10612,7 @@ do_mav_dspsc_2 (str)
   skip_whitespace (str);
 
   /* cfmv32sc.  */
-  if (mav_reg_required_here (&str, 0, REG_TYPE_MVFX) == FAIL
+  if (mav_reg_required_here (&str, 12, REG_TYPE_MVDX) == FAIL
       || skip_past_comma (&str) == FAIL
       || mav_reg_required_here (&str, -1, REG_TYPE_DSPSC) == FAIL)
     {
@@ -10967,7 +10942,6 @@ do_mav_ldst (str, reg0)
 fail_ldst:
   if (!inst.error)
      inst.error = BAD_ARGS;
-  return;
 }
 
 static void
@@ -10976,7 +10950,6 @@ do_t_nop (str)
 {
   /* Do nothing.  */
   end_of_line (str);
-  return;
 }
 
 /* Handle the Format 4 instructions that do not have equivalents in other
@@ -11350,7 +11323,6 @@ do_t_swi (str)
 
   inst.reloc.type = BFD_RELOC_ARM_SWI;
   end_of_line (str);
-  return;
 }
 
 static void
@@ -11719,29 +11691,57 @@ md_begin ()
 
   cpu_variant = mcpu_cpu_opt | mfpu_opt;
 
-#if defined OBJ_COFF || defined OBJ_ELF
   {
     unsigned int flags = 0;
 
-    /* Set the flags in the private structure.  */
-    if (uses_apcs_26)      flags |= F_APCS26;
-    if (support_interwork) flags |= F_INTERWORK;
-    if (uses_apcs_float)   flags |= F_APCS_FLOAT;
-    if (pic_code)          flags |= F_PIC;
-    if ((cpu_variant & FPU_ANY) == FPU_NONE
-       || (cpu_variant & FPU_ANY) == FPU_ARCH_VFP) /* VFP layout only.  */
-      flags |= F_SOFT_FLOAT;
-    /* Using VFP conventions (even if soft-float).  */
-    if (cpu_variant & FPU_VFP_EXT_NONE) flags |= F_VFP_FLOAT;
-
 #if defined OBJ_ELF
-    if (cpu_variant & ARM_CEXT_MAVERICK)
+    flags = meabi_flags;
+
+    switch (meabi_flags)
       {
-       flags &= ~ F_SOFT_FLOAT;
-       flags |= EF_ARM_MAVERICK_FLOAT;
-      }
+      case EF_ARM_EABI_UNKNOWN:
+#endif
+#if defined OBJ_COFF || defined OBJ_ELF
+       /* Set the flags in the private structure.  */
+       if (uses_apcs_26)      flags |= F_APCS26;
+       if (support_interwork) flags |= F_INTERWORK;
+       if (uses_apcs_float)   flags |= F_APCS_FLOAT;
+       if (pic_code)          flags |= F_PIC;
+       if ((cpu_variant & FPU_ANY) == FPU_NONE
+            || (cpu_variant & FPU_ANY) == FPU_ARCH_VFP) /* VFP layout only.  */
+         flags |= F_SOFT_FLOAT;
+
+       switch (mfloat_abi_opt)
+         {
+         case ARM_FLOAT_ABI_SOFT:
+         case ARM_FLOAT_ABI_SOFTFP:
+           flags |= F_SOFT_FLOAT;
+           break;
+
+         case ARM_FLOAT_ABI_HARD:
+           if (flags & F_SOFT_FLOAT)
+             as_bad (_("hard-float conflicts with specified fpu"));
+           break;
+         }
+
+       /* Using VFP conventions (even if soft-float).  */
+       if (cpu_variant & FPU_VFP_EXT_NONE)
+         flags |= F_VFP_FLOAT;
 #endif
+#if defined OBJ_ELF
+       if (cpu_variant & FPU_ARCH_MAVERICK)
+           flags |= EF_ARM_MAVERICK_FLOAT;
+       break;
 
+      case EF_ARM_EABI_VER3:
+       /* No additional flags to set.  */
+       break;
+
+      default:
+       abort ();
+      }
+#endif
+#if defined OBJ_COFF || defined OBJ_ELF
     bfd_set_private_flags (stdoutput, flags);
 
     /* We have run out flags in the COFF header to encode the
@@ -11761,8 +11761,8 @@ md_begin ()
            bfd_set_section_contents (stdoutput, sec, NULL, 0, 0);
          }
       }
-  }
 #endif
+  }
 
   /* Record the CPU type as well.  */
   switch (cpu_variant & ARM_CPU_MASK)
@@ -11834,6 +11834,9 @@ md_begin ()
     bfd_set_section_flags (stdoutput, arm_arch,
                           SEC_DATA | SEC_ALLOC | SEC_LOAD | SEC_LINK_ONCE \
                           | SEC_HAS_CONTENTS);
+#else
+    bfd_set_section_flags (stdoutput, arm_arch,
+                          SEC_READONLY | SEC_HAS_CONTENTS);
 #endif
     arm_arch->output_section = arm_arch;
     subseg_set (arm_arch, 0);
@@ -12848,6 +12851,16 @@ tc_gen_reloc (section, fixp)
       return NULL;
 
     case BFD_RELOC_ARM_OFFSET_IMM:
+      if (fixp->fx_addsy != NULL
+         && !S_IS_DEFINED (fixp->fx_addsy)
+         && S_IS_LOCAL (fixp->fx_addsy))
+       {
+         as_bad_where (fixp->fx_file, fixp->fx_line,
+                       _("undefined local label `%s'"),
+                       S_GET_NAME (fixp->fx_addsy));
+         return NULL;
+       }
+
       as_bad_where (fixp->fx_file, fixp->fx_line,
                    _("internal_relocation (type: OFFSET_IMM) not fixed up"));
       return NULL;
@@ -13341,6 +13354,7 @@ static struct arm_cpu_option_table arm_cpus[] =
   {"arm9e-r0",         ARM_ARCH_V5TExP, FPU_ARCH_VFP_V2},
   {"arm9e",            ARM_ARCH_V5TE,   FPU_ARCH_VFP_V2},
   {"arm926ej",         ARM_ARCH_V5TEJ,  FPU_ARCH_VFP_V2},
+  {"arm926ejs",                ARM_ARCH_V5TEJ,  FPU_ARCH_VFP_V2},
   {"arm946e-r0",       ARM_ARCH_V5TExP, FPU_ARCH_VFP_V2},
   {"arm946e",          ARM_ARCH_V5TE,   FPU_ARCH_VFP_V2},
   {"arm966e-r0",       ARM_ARCH_V5TExP, FPU_ARCH_VFP_V2},
@@ -13350,6 +13364,7 @@ static struct arm_cpu_option_table arm_cpus[] =
   {"arm1020",          ARM_ARCH_V5TE,   FPU_ARCH_VFP_V2},
   {"arm1020t",         ARM_ARCH_V5T,    FPU_ARCH_VFP_V1},
   {"arm1020e",         ARM_ARCH_V5TE,   FPU_ARCH_VFP_V2},
+  {"arm1026ejs",       ARM_ARCH_V5TE,   FPU_ARCH_VFP_V2},
   {"arm1136js",                ARM_ARCH_V6,     FPU_NONE},
   {"arm1136jfs",       ARM_ARCH_V6,     FPU_ARCH_VFP_V2},
   /* ??? XSCALE is really an architecture.  */
@@ -13358,7 +13373,7 @@ static struct arm_cpu_option_table arm_cpus[] =
   {"iwmmxt",           ARM_ARCH_IWMMXT, FPU_ARCH_VFP_V2},
   {"i80200",           ARM_ARCH_XSCALE, FPU_ARCH_VFP_V2},
   /* Maverick */
-  {"ep9312",           ARM_ARCH_V4T | ARM_CEXT_MAVERICK, FPU_NONE},
+  {"ep9312",           ARM_ARCH_V4T | ARM_CEXT_MAVERICK, FPU_ARCH_MAVERICK},
   {NULL, 0, 0}
 };
 
@@ -13391,6 +13406,7 @@ static struct arm_arch_option_table arm_archs[] =
   {"armv5texp",                ARM_ARCH_V5TExP, FPU_ARCH_VFP},
   {"armv5tej",         ARM_ARCH_V5TEJ,  FPU_ARCH_VFP},
   {"armv6",             ARM_ARCH_V6,     FPU_ARCH_VFP},
+  {"armv6j",            ARM_ARCH_V6,     FPU_ARCH_VFP},
   {"xscale",           ARM_ARCH_XSCALE, FPU_ARCH_VFP},
   {"iwmmxt",           ARM_ARCH_IWMMXT, FPU_ARCH_VFP},
   {NULL, 0, 0}
@@ -13439,9 +13455,40 @@ static struct arm_fpu_option_table arm_fpus[] =
   {"arm1020t",         FPU_ARCH_VFP_V1},
   {"arm1020e",         FPU_ARCH_VFP_V2},
   {"arm1136jfs",       FPU_ARCH_VFP_V2},
+  {"maverick",         FPU_ARCH_MAVERICK},
   {NULL, 0}
 };
 
+struct arm_float_abi_option_table
+{
+  char *name;
+  int value;
+};
+
+static struct arm_float_abi_option_table arm_float_abis[] =
+{
+  {"hard",     ARM_FLOAT_ABI_HARD},
+  {"softfp",   ARM_FLOAT_ABI_SOFTFP},
+  {"soft",     ARM_FLOAT_ABI_SOFT},
+  {NULL, 0}
+};
+
+struct arm_eabi_option_table
+{
+  char *name;
+  unsigned int value;
+};
+
+#ifdef OBJ_ELF
+/* We only know hot to output GNU and ver 3 (AAELF) formats.  */
+static struct arm_eabi_option_table arm_eabis[] =
+{
+  {"gnu",      EF_ARM_EABI_UNKNOWN},
+  {"3",                EF_ARM_EABI_VER3},
+  {NULL, 0}
+};
+#endif
+
 struct arm_long_option_table
 {
   char *option;                /* Substring to match.  */
@@ -13588,6 +13635,41 @@ arm_parse_fpu (str)
   return 0;
 }
 
+static int
+arm_parse_float_abi (str)
+     char * str;
+{
+  struct arm_float_abi_option_table *opt;
+
+  for (opt = arm_float_abis; opt->name != NULL; opt++)
+    if (strcmp (opt->name, str) == 0)
+      {
+       mfloat_abi_opt = opt->value;
+       return 1;
+      }
+
+  as_bad (_("unknown floating point abi `%s'\n"), str);
+  return 0;
+}
+
+#ifdef OBJ_ELF
+static int
+arm_parse_eabi (str)
+     char * str;
+{
+  struct arm_eabi_option_table *opt;
+
+  for (opt = arm_eabis; opt->name != NULL; opt++)
+    if (strcmp (opt->name, str) == 0)
+      {
+       meabi_flags = opt->value;
+       return 1;
+      }
+  as_bad (_("unknown EABI `%s'\n"), str);
+  return 0;
+}
+#endif
+
 struct arm_long_option_table arm_long_opts[] =
 {
   {"mcpu=", N_("<cpu name>\t  assemble for CPU <cpu name>"),
@@ -13596,6 +13678,12 @@ struct arm_long_option_table arm_long_opts[] =
    arm_parse_arch, NULL},
   {"mfpu=", N_("<fpu name>\t  assemble for FPU architecture <fpu name>"),
    arm_parse_fpu, NULL},
+  {"mfloat-abi=", N_("<abi>\t  assemble for floating point ABI <abi>"),
+   arm_parse_float_abi, NULL},
+#ifdef OBJ_ELF
+  {"meabi=", N_("<ver>\t  assemble for eabi version <ver>"),
+   arm_parse_eabi, NULL},
+#endif
   {NULL, NULL, 0, NULL}
 };
 
@@ -13741,8 +13829,6 @@ fix_new_arm (frag, where, size, exp, pc_rel, reloc)
   arm_data = (arm_fix_data *) obstack_alloc (& notes, sizeof (arm_fix_data));
   new_fix->tc_fix_data = (PTR) arm_data;
   arm_data->thumb_mode = thumb_mode;
-
-  return;
 }
 
 /* This fix_new is called by cons via TC_CONS_FIX_NEW.  */
This page took 0.036899 seconds and 4 git commands to generate.