[RFC PATCH 11/11] MIPS: IEEE Std 754 NaN interlinking support

Maciej W. Rozycki macro@imgtec.com
Fri Nov 20 14:52:00 GMT 2015


Implement static linker support for IEEE Std 754 NaN interlinking, as 
per "MIPS ABI Extension for IEEE Std 754 Non-Compliant Interlinking" 
<https://dmz-portal.mips.com/wiki/MIPS_ABI_-_NaN_Interlinking>:

* handle the AFL_FLAGS1_IEEE, AFL_FLAGS2_NOWARN and AFL_FLAGS2_RELAXED 
  flags in the `.MIPS.abiflags' section of binaries processed,

* interpret input files which have their AFL_FLAGS1_IEEE flag clear in
  the `.MIPS.abiflags' section or have no such section at all as if the
  AFL_FLAGS2_NOWARN and AFL_FLAGS2_RELAXED flags were cleared,

* implement command-line options to control the link mode:

  --ieee=strict  -- to select the strict compliance link mode, which is 
                    also the default,

  --ieee=relaxed -- to select the relaxed compliance link mode,

  --ieee=warn    -- to select the noisy mode, which is also the default, 
                    in which a warning is issued whenever the relaxed 
                    compliance link mode has been selected, but no 
                    relaxed objects have been seen in input,

  --ieee=nowarn  -- to select the quiet mode in which no warnings are 
                    issued related to IEEE Std 754 compliance.

* always set the AFL_FLAGS1_IEEE flag in output,

* set the AFL_FLAGS2_RELAXED flag in output according to --ieee=strict 
  and --ieee=relaxed options,

* clear the AFL_FLAGS2_NOWARN flag in final links and set it according 
  to the AND of the input AFL_FLAGS2_NOWARN flags seen in incremental 
  links.

Implement an assembler interface following the recommendations set out 
in the specification:

* always set the AFL_FLAGS1_IEEE flag in the `.MIPS.abiflags' section of 
  binaries produced,

* implement command-line options and source-code directives to set the 
  AFL_FLAGS2_NOWARN and AFL_FLAGS2_RELAXED flags in the `.MIPS.abiflags' 
  section of binaries produced, as follows:

  -mieee=strict --  to clear the AFL_FLAGS2_RELAXED flag, which is also 
                    the default and equivalent to `.ieee strict' 
                    directive,

  -mieee=relaxed -- to set the AFL_FLAGS2_RELAXED flag, which is 
                    equivalent to `.ieee relaxed' directive,

  -mieee=warn    -- to clear the AFL_FLAGS2_NOWARN flag, which is also 
                    the default and equivalent to `.ieee warn' 
                    directive,

  -mieee=nowarn  -- to set the AFL_FLAGS2_NOWARN flag, which is 
                    equivalent to `.ieee nowarn' directive.

Add test cases to cover the new semantics and update preexisting cases 
for the presence of the AFL_FLAGS1_IEEE flag.

	include/elf/
	* mips.h (AFL_FLAGS1_IEEE): New macro.
	(AFL_FLAGS2_NOWARN, AFL_FLAGS2_RELAXED): Likewise.

	bfd/
	* elfxx-mips.h (_bfd_mips_elf_ieee_relaxed): New prototype.
	(_bfd_mips_elf_ieee_nowarn): Likewise.
	* elfxx-mips.c (mips_elf_link_hash_table): Add `ieee_relaxed',
	`ieee_relaxed_seen', `ieee_nowarn' and `ieee_warn_seen' members.
	(_bfd_mips_elf_ieee_relaxed): New function.
	(_bfd_mips_elf_ieee_nowarn): Likewise.
	(infer_mips_abiflags): Handle AFL_FLAGS1_IEEE.
	(_bfd_mips_elf_final_link): Add a relaxed compliance link
	warning.
	(mips_elf_merge_obj_abiflags): Implement IEEE Std 754
	interlinking rules.
	(_bfd_mips_elf_merge_private_bfd_data): Handle AFL_FLAGS2_NOWARN
	and AFL_FLAGS2_RELAXED.  Implement IEEE Std
	754 interlinking rules.

	gas/
	* config/tc-mips.c (mips_ieee_relaxed): New variable.
	(mips_ieee_nowarn): Likewise.
	(options): Add OPTION_IEEE enum value.
	(md_longopts): Handle it.
	(md_parse_option): Likewise.
	(mips_pseudo_table): Add "ieee" entry.
	(s_ieee): New function.	
	(mips_elf_final_processing): Handle AFL_FLAGS1_IEEE,
	AFL_FLAGS2_NOWARN and AFL_FLAGS2_RELAXED.
	(md_show_usage): Add -mieee.

	* doc/as.texinfo (Overview): Add -mieee.
	* doc/c-mips.texi (MIPS Opts): Document -mieee.
	(MIPS IEEE Std 754 Compliance Modes): New node.  Document .ieee
	directive.
	(MIPS-Dependent): List the new node.

	gas/testsuite/
	* gas/mips/attr-gnu-4-6.d: Adjust for ABI flags updates.
	* gas/mips/attr-gnu-4-7.d: Likewise.
	* gas/mips/attr-none-o32-fp64-nooddspreg.d: Likewise.
	* gas/mips/attr-none-o32-fp64.d: Likewise.
	* gas/mips/call-nonpic-1.d: Likewise.
	* gas/mips/elf_arch_mips1.d: Likewise.
	* gas/mips/elf_arch_mips2.d: Likewise.
	* gas/mips/elf_arch_mips3.d: Likewise.
	* gas/mips/elf_arch_mips4.d: Likewise.
	* gas/mips/elf_arch_mips5.d: Likewise.
	* gas/mips/module-defer-warn1.d: Likewise.
	* gas/mips/module-mfpxx.d: Likewise.
	* gas/mips/module-override.d: Likewise.
	* gas/mips/no-odd-spreg.d: Likewise.
	* gas/mips/odd-spreg.d: Likewise.
	* gas/mips/ieee-nowarn-1.d: New test.
	* gas/mips/ieee-nowarn-2.d: New test.
	* gas/mips/ieee-nowarn-3.d: New test.
	* gas/mips/ieee-nowarn-4.d: New test.
	* gas/mips/ieee-relaxed-1.d: New test.
	* gas/mips/ieee-relaxed-2.d: New test.
	* gas/mips/ieee-relaxed-3.d: New test.
	* gas/mips/ieee-relaxed-4.d: New test.
	* gas/mips/ieee-relaxed-5.d: New test.
	* gas/mips/ieee-strict-1.d: New test.
	* gas/mips/ieee-strict-2.d: New test.
	* gas/mips/ieee-strict-3.d: New test.
	* gas/mips/ieee-strict-4.d: New test.
	* gas/mips/ieee-strict-5.d: New test.
	* gas/mips/ieee-strict-6.d: New test.
	* gas/mips/ieee-warn-1.d: New test.
	* gas/mips/ieee-warn-2.d: New test.
	* gas/mips/ieee-warn-3.d: New test.
	* gas/mips/ieee-warn-4.d: New test.
	* gas/mips/ieee-warn-5.d: New test.
	* gas/mips/ieee-error-1.l: New list test.
	* gas/mips/ieee-error-2.l: New list test.
	* gas/mips/ieee-error-1.s: New test source.
	* gas/mips/ieee-error-2.s: New test source.
	* gas/mips/ieee-nowarn-override.s: New test source.
	* gas/mips/ieee-nowarn.s: New test source.
	* gas/mips/ieee-relaxed-nowarn.s: New test source.
	* gas/mips/ieee-relaxed-override.s: New test source.
	* gas/mips/ieee-relaxed.s: New test source.
	* gas/mips/ieee-strict-nowarn.s: New test source.
	* gas/mips/ieee-strict-override.s: New test source.
	* gas/mips/ieee-strict.s: New test source.
	* gas/mips/ieee-warn-override.s: New test source.
	* gas/mips/ieee-warn.s: New test source.
	* gas/mips/mips.exp: Run the new tests.

	ld/
	* emultempl/mipself.em (mips_ieee_relaxed): New variable.
	(mips_ieee_nowarn): Likewise.
	(mips_create_output_section_statements): Handle --ieee options.
	(PARSE_AND_LIST_PROLOGUE): Add OPTION_IEEE enum value.
	(PARSE_AND_LIST_LONGOPTS): Add --ieee option.
	(PARSE_AND_LIST_OPTIONS): Likewise.
	(PARSE_AND_LIST_ARGS_CASES): Likewise.

	* ld.texinfo (Options specific to MIPS targets): Document --ieee.
	(ld and MIPS family): Likewise.

	ld/testsuite/
	* ld-mips-elf/mips16-pic-1.gd: Adjust for ABI flags updates.
	* ld-mips-elf/mips16-pic-2.gd: Likewise.
	* ld-mips-elf/mips16-pic-3.gd: Likewise.
	* ld-mips-elf/mips16-pic-4a.gd: Likewise.
	* ld-mips-elf/ieee-default-1.d: New test.
	* ld-mips-elf/ieee-default-2.d: New test.
	* ld-mips-elf/ieee-default-3.d: New test.
	* ld-mips-elf/ieee-default-4.d: New test.
	* ld-mips-elf/ieee-default-5.d: New test.
	* ld-mips-elf/ieee-default-6.d: New test.
	* ld-mips-elf/ieee-default-final.d: New test.
	* ld-mips-elf/ieee-relaxed-1.d: New test.
	* ld-mips-elf/ieee-relaxed-2.d: New test.
	* ld-mips-elf/ieee-relaxed-3.d: New test.
	* ld-mips-elf/ieee-relaxed-4.d: New test.
	* ld-mips-elf/ieee-relaxed-5.d: New test.
	* ld-mips-elf/ieee-relaxed-6.d: New test.
	* ld-mips-elf/ieee-relaxed-final.d: New test.
	* ld-mips-elf/ieee-relaxed-nowarn-1.d: New test.
	* ld-mips-elf/ieee-relaxed-nowarn-2.d: New test.
	* ld-mips-elf/ieee-relaxed-nowarn-3.d: New test.
	* ld-mips-elf/ieee-relaxed-nowarn-4.d: New test.
	* ld-mips-elf/ieee-relaxed-nowarn-5.d: New test.
	* ld-mips-elf/ieee-relaxed-nowarn-6.d: New test.
	* ld-mips-elf/ieee-relaxed-nowarn-final.d: New test.
	* ld-mips-elf/ieee-strict-1.d: New test.
	* ld-mips-elf/ieee-strict-2.d: New test.
	* ld-mips-elf/ieee-strict-3.d: New test.
	* ld-mips-elf/ieee-strict-4.d: New test.
	* ld-mips-elf/ieee-strict-5.d: New test.
	* ld-mips-elf/ieee-strict-6.d: New test.
	* ld-mips-elf/ieee-strict-final.d: New test.
	* ld-mips-elf/ieee-strict-nowarn-1.d: New test.
	* ld-mips-elf/ieee-strict-nowarn-2.d: New test.
	* ld-mips-elf/ieee-strict-nowarn-3.d: New test.
	* ld-mips-elf/ieee-strict-nowarn-4.d: New test.
	* ld-mips-elf/ieee-strict-nowarn-5.d: New test.
	* ld-mips-elf/ieee-strict-nowarn-6.d: New test.
	* ld-mips-elf/ieee-strict-nowarn-final.d: New test.
	* ld-mips-elf/ieee-nowarn.s: New test source.
	* ld-mips-elf/ieee-relaxed.s: New test source.
	* ld-mips-elf/ieee-strict.s: New test source.
	* ld-mips-elf/mips-elf.exp: Run the new tests.
---
binutils-mips-nan-interlink.diff
Index: binutils/bfd/elfxx-mips.c
===================================================================
--- binutils.orig/bfd/elfxx-mips.c	2015-11-17 13:09:10.742503608 +0000
+++ binutils/bfd/elfxx-mips.c	2015-11-17 13:09:19.763523377 +0000
@@ -443,6 +443,20 @@ struct mips_elf_link_hash_table
   /* True if we can only use 32-bit microMIPS instructions.  */
   bfd_boolean insn32;
 
+  /* IEEE Std 754 relaxed compliance mode selected.  */
+  bfd_boolean ieee_relaxed;
+
+  /* This is set if we see any object marked for the IEEE Std 754 relaxed
+     compliance mode.  */
+  bfd_boolean ieee_relaxed_seen;
+
+  /* Warning on IEEE Std 754 relaxed compliance mode suppressed.  */
+  bfd_boolean ieee_nowarn;
+
+  /* This is set if we see any object marked for warning on the IEEE Std
+     754 relaxed compliance mode.  */
+  bfd_boolean ieee_warn_seen;
+
   /* True if we're generating code for VxWorks.  */
   bfd_boolean is_vxworks;
 
@@ -13911,6 +13925,24 @@ _bfd_mips_elf_insn32 (struct bfd_link_in
 {
   mips_elf_hash_table (info)->insn32 = on;
 }
+
+/* A function that the linker calls to select the IEEE Std 754 compliance
+   mode.  */
+
+void
+_bfd_mips_elf_ieee_relaxed (struct bfd_link_info *info, bfd_boolean relaxed)
+{
+  mips_elf_hash_table (info)->ieee_relaxed = relaxed;
+}
+
+/* A function that the linker calls to request a warning on the IEEE Std
+   754 relaxed compliance mode to be suppressed.  */
+
+void
+_bfd_mips_elf_ieee_nowarn (struct bfd_link_info *info, bfd_boolean nowarn)
+{
+  mips_elf_hash_table (info)->ieee_nowarn = nowarn;
+}
 
 /* Structure for saying that BFD machine EXTENSION extends BASE.  */
 
@@ -14180,6 +14212,8 @@ infer_mips_abiflags (bfd *abfd, Elf_Inte
       && abiflags->isa_level >= 32
       && abiflags->isa_ext != AFL_EXT_LOONGSON_3A)
     abiflags->flags1 |= AFL_FLAGS1_ODDSPREG;
+
+  abiflags->flags1 |= AFL_FLAGS1_IEEE;
 }
 
 /* We need to use a special link routine to handle the .reginfo and
@@ -14864,6 +14898,12 @@ _bfd_mips_elf_final_link (bfd *abfd, str
 	}
     }
 
+  if (htab->ieee_relaxed && !htab->ieee_nowarn
+      && !htab->ieee_relaxed_seen && htab->ieee_warn_seen)
+    (*_bfd_error_handler)
+      (_("%B: warning: Only strict IEEE Std 754 compliance mode objects seen "
+	 "in a relaxed compliance link"), abfd);
+
   return TRUE;
 }
 
@@ -15213,9 +15253,11 @@ mips_elf_merge_obj_attributes (bfd *ibfd
    there are conflicting settings.  */
 
 static bfd_boolean
-mips_elf_merge_obj_abiflags (bfd *ibfd, bfd *obfd)
+mips_elf_merge_obj_abiflags (bfd *ibfd, bfd *obfd,
+			     struct bfd_link_info *info)
 {
   obj_attribute *out_attr = elf_known_obj_attributes (obfd)[OBJ_ATTR_GNU];
+  struct mips_elf_link_hash_table *htab = mips_elf_hash_table (info);
   struct mips_elf_obj_tdata *out_tdata = mips_elf_tdata (obfd);
   struct mips_elf_obj_tdata *in_tdata = mips_elf_tdata (ibfd);
 
@@ -15238,6 +15280,26 @@ mips_elf_merge_obj_abiflags (bfd *ibfd, 
   out_tdata->abiflags.ases |= in_tdata->abiflags.ases;
   out_tdata->abiflags.flags1 |= in_tdata->abiflags.flags1;
 
+  if (in_tdata->abiflags.flags2 & AFL_FLAGS2_RELAXED)
+    {
+      htab->ieee_relaxed_seen = TRUE;
+
+      if (!htab->ieee_relaxed)
+	{
+	  (*_bfd_error_handler)
+	    (_("%B: Relaxed IEEE Std 754 compliance mode object "
+	       "in a strict compliance link"), ibfd);
+	  return FALSE;
+	}
+    }
+
+  if (!(in_tdata->abiflags.flags2 & AFL_FLAGS2_NOWARN))
+    htab->ieee_warn_seen = TRUE;
+  if (htab->ieee_warn_seen || !bfd_link_relocatable (info))
+    out_tdata->abiflags.flags2 &= ~AFL_FLAGS2_NOWARN;
+  else
+    out_tdata->abiflags.flags2 |= AFL_FLAGS2_NOWARN;
+
   return TRUE;
 }
 
@@ -15246,9 +15308,9 @@ mips_elf_merge_obj_abiflags (bfd *ibfd, 
 
 bfd_boolean
 _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd,
-				      struct bfd_link_info *info
-					ATTRIBUTE_UNUSED)
+				      struct bfd_link_info *info)
 {
+  struct mips_elf_link_hash_table *htab;
   struct mips_elf_obj_tdata *out_tdata;
   struct mips_elf_obj_tdata *in_tdata;
   bfd_boolean null_input_bfd = TRUE;
@@ -15267,6 +15329,7 @@ _bfd_mips_elf_merge_private_bfd_data (bf
   if (!is_mips_elf (ibfd) || !is_mips_elf (obfd))
     return TRUE;
 
+  htab = mips_elf_hash_table (info);
   in_tdata = mips_elf_tdata (ibfd);
   out_tdata = mips_elf_tdata (obfd);
 
@@ -15343,7 +15406,7 @@ _bfd_mips_elf_merge_private_bfd_data (bf
 	(*_bfd_error_handler)
 	  (_("%B: warning: Inconsistent ISA extensions between e_flags and "
 	     ".MIPS.abiflags"), ibfd);
-      if (in_abiflags.flags2 != 0)
+      if (in_abiflags.flags2 & ~(AFL_FLAGS2_RELAXED | AFL_FLAGS2_NOWARN))
 	(*_bfd_error_handler)
 	  (_("%B: warning: Unexpected flag in the flags2 field of "
 	     ".MIPS.abiflags (0x%lx)"), ibfd,
@@ -15359,6 +15422,12 @@ _bfd_mips_elf_merge_private_bfd_data (bf
     {
       /* Copy input abiflags if output abiflags are not already valid.  */
       out_tdata->abiflags = in_tdata->abiflags;
+
+      if (htab->ieee_relaxed)
+	out_tdata->abiflags.flags2 |= AFL_FLAGS2_RELAXED;
+      else
+	out_tdata->abiflags.flags2 &= ~AFL_FLAGS2_RELAXED;
+
       out_tdata->abiflags_valid = TRUE;
     }
 
@@ -15389,7 +15458,7 @@ _bfd_mips_elf_merge_private_bfd_data (bf
 
   ok = mips_elf_merge_obj_attributes (ibfd, obfd) && ok;
 
-  ok = mips_elf_merge_obj_abiflags (ibfd, obfd) && ok;
+  ok = mips_elf_merge_obj_abiflags (ibfd, obfd, info) && ok;
 
   if (!ok)
     {
Index: binutils/bfd/elfxx-mips.h
===================================================================
--- binutils.orig/bfd/elfxx-mips.h	2015-11-17 13:09:10.843950526 +0000
+++ binutils/bfd/elfxx-mips.h	2015-11-17 13:09:19.774847568 +0000
@@ -152,6 +152,10 @@ extern void _bfd_mips_elf_use_plts_and_c
   (struct bfd_link_info *);
 extern void _bfd_mips_elf_insn32
   (struct bfd_link_info *, bfd_boolean);
+extern void _bfd_mips_elf_ieee_relaxed
+  (struct bfd_link_info *, bfd_boolean);
+extern void _bfd_mips_elf_ieee_nowarn
+  (struct bfd_link_info *, bfd_boolean);
 extern bfd_boolean _bfd_mips_elf_init_stubs
   (struct bfd_link_info *,
    asection *(*) (const char *, asection *, asection *));
Index: binutils/gas/config/tc-mips.c
===================================================================
--- binutils.orig/gas/config/tc-mips.c	2015-11-17 13:06:58.145113840 +0000
+++ binutils/gas/config/tc-mips.c	2015-11-17 13:09:19.800235429 +0000
@@ -273,6 +273,16 @@ static bfd_boolean file_mips_opts_checke
    options, and the default CPU.  */
 static int mips_nan2008 = -1;
 
+/* IEEE Std 754 compliance mode.  TRUE for relaxed, FALSE for strict.
+   Changed by `.ieee relaxed' and `.ieee strict', and the -mieee=relaxed
+   and -mieee=strict command line options.  */
+static bfd_boolean mips_ieee_relaxed;
+
+/* IEEE Std 754 compliance warning mode.  TRUE for disabled, FALSE for
+   enabled.  Changed by `.ieee warn' and `.ieee nowarn', and the
+   -mieee=warn and -mieee=nowarn command line options.  */
+static bfd_boolean mips_ieee_nowarn;
+
 /* This is the struct we use to hold the module level set of options.
    Note that we must set the isa field to ISA_UNKNOWN and the ASE, gp and
    fp fields to -1 to indicate that they have not been initialized.  */
@@ -1337,6 +1347,7 @@ static void s_ehword (int);
 static void s_cpadd (int);
 static void s_insn (int);
 static void s_nan (int);
+static void s_ieee (int);
 static void s_module (int);
 static void s_mips_ent (int);
 static void s_mips_end (int);
@@ -1480,6 +1491,7 @@ enum options
     OPTION_NO_PDR,
     OPTION_MVXWORKS_PIC,
     OPTION_NAN,
+    OPTION_IEEE,
     OPTION_ODD_SPREG,
     OPTION_NO_ODD_SPREG,
     OPTION_END_OF_ENUM
@@ -1613,6 +1625,7 @@ struct option md_longopts[] =
   {"mno-pdr", no_argument, NULL, OPTION_NO_PDR},
   {"mvxworks-pic", no_argument, NULL, OPTION_MVXWORKS_PIC},
   {"mnan", required_argument, NULL, OPTION_NAN},
+  {"mieee", required_argument, NULL, OPTION_IEEE},
 
   {NULL, no_argument, NULL, 0}
 };
@@ -1761,6 +1774,7 @@ static const pseudo_typeS mips_pseudo_ta
   {"cpadd", s_cpadd, 0},
   {"insn", s_insn, 0},
   {"nan", s_nan, 0},
+  {"ieee", s_ieee, 0},
   {"module", s_module, 0},
 
   /* Relatively generic pseudo-ops that happen to be used on MIPS
@@ -14465,6 +14479,22 @@ md_parse_option (int c, char *arg)
 	}
       break;
 
+    case OPTION_IEEE:
+      if (strcmp (arg, "relaxed") == 0)
+	mips_ieee_relaxed = TRUE;
+      else if (strcmp (arg, "strict") == 0)
+	mips_ieee_relaxed = FALSE;
+      else if (strcmp (arg, "nowarn") == 0)
+	mips_ieee_nowarn = TRUE;
+      else if (strcmp (arg, "warn") == 0)
+	mips_ieee_nowarn = FALSE;
+      else
+	{
+	  as_fatal (_("invalid IEEE setting -mieee=%s"), arg);
+	  return 0;
+	}
+      break;
+
     default:
       return 0;
     }
@@ -16398,6 +16428,38 @@ s_nan (int ignore ATTRIBUTE_UNUSED)
   demand_empty_rest_of_line ();
 }
 
+/* Handle the .ieee pseudo-op.  */
+
+static void
+s_ieee (int ignore ATTRIBUTE_UNUSED)
+{
+  static const char str_relaxed[] = "relaxed";
+  static const char str_strict[] = "strict";
+  static const char str_nowarn[] = "nowarn";
+  static const char str_warn[] = "warn";
+  size_t i;
+
+  for (i = 0; !is_end_of_line[(unsigned char) input_line_pointer[i]]; i++);
+
+  if (i == sizeof (str_relaxed) - 1
+      && memcmp (input_line_pointer, str_relaxed, i) == 0)
+    mips_ieee_relaxed = TRUE;
+  else if (i == sizeof (str_strict) - 1
+	   && memcmp (input_line_pointer, str_strict, i) == 0)
+    mips_ieee_relaxed = FALSE;
+  else if (i == sizeof (str_nowarn) - 1
+	   && memcmp (input_line_pointer, str_nowarn, i) == 0)
+    mips_ieee_nowarn = TRUE;
+  else if (i == sizeof (str_warn) - 1
+      && memcmp (input_line_pointer, str_warn, i) == 0)
+    mips_ieee_nowarn = FALSE;
+  else
+    as_bad (_("bad .ieee directive"));
+
+  input_line_pointer += i;
+  demand_empty_rest_of_line ();
+}
+
 /* Handle a .stab[snd] directive.  Ideally these directives would be
    implemented in a transparent way, so that removing them would not
    have any effect on the generated instructions.  However, s_stab
@@ -18033,7 +18095,12 @@ mips_elf_final_processing (void)
        || file_mips_opts.fp == 64)
       && file_mips_opts.oddspreg)
     flags.flags1 |= AFL_FLAGS1_ODDSPREG;
+  flags.flags1 |= AFL_FLAGS1_IEEE;
   flags.flags2 = 0;
+  if (mips_ieee_relaxed)
+    flags.flags2 |= AFL_FLAGS2_RELAXED;
+  if (mips_ieee_nowarn)
+    flags.flags2 |= AFL_FLAGS2_NOWARN;
 
   bfd_mips_elf_swap_abiflags_v0_out (stdoutput, &flags,
 				     ((Elf_External_ABIFlags_v0 *)
@@ -18981,6 +19048,18 @@ MIPS options:\n\
   fputc ('\n', stream);
 
   fprintf (stream, _("\
+-mieee=MODE		select an IEEE 754 compliance mode, one of:\n"));
+
+  first = 1;
+
+  show (stream, "strict", &column, &first);
+  show (stream, "relaxed", &column, &first);
+  show (stream, "warn", &column, &first);
+  show (stream, "nowarn", &column, &first);
+
+  fputc ('\n', stream);
+
+  fprintf (stream, _("\
 -KPIC, -call_shared	generate SVR4 position independent code\n\
 -call_nonpic		generate non-PIC code that can operate with DSOs\n\
 -mvxworks-pic		generate VxWorks position independent code\n\
Index: binutils/gas/doc/as.texinfo
===================================================================
--- binutils.orig/gas/doc/as.texinfo	2015-11-17 13:06:59.989329378 +0000
+++ binutils/gas/doc/as.texinfo	2015-11-17 13:09:19.819656385 +0000
@@ -412,6 +412,7 @@ gcc(1), ld(1), and the Info entries for 
    [@b{-mips64r3}] [@b{-mips64r5}] [@b{-mips64r6}]
    [@b{-construct-floats}] [@b{-no-construct-floats}]
    [@b{-mnan=@var{encoding}}]
+   [@b{-mieee=@var{mode}}]
    [@b{-trap}] [@b{-no-break}] [@b{-break}] [@b{-no-trap}]
    [@b{-mips16}] [@b{-no-mips16}]
    [@b{-mmicromips}] [@b{-mno-micromips}]
@@ -1482,6 +1483,12 @@ out-of-range branches to produce an erro
 Select between the IEEE 754-2008 (@option{-mnan=2008}) or the legacy
 (@option{-mnan=legacy}) NaN encoding format.  The latter is the default.
 
+@item -mieee=@var{mode}
+Select between the strict (@option{-mieee=strict}, also the default)
+and the relaxed (@option{-mieee=relaxed}) IEEE Std 754 compliance mode.
+Also request (@option{-mieee=warn}, also the default) or suppress
+(@option{-mieee=nowarn}) link-stage IEEE Std 754 compliance warnings.
+
 @cindex emulation
 @item --emulation=@var{name}
 This option was formerly used to switch between ELF and ECOFF output
Index: binutils/gas/doc/c-mips.texi
===================================================================
--- binutils.orig/gas/doc/c-mips.texi	2015-11-17 12:19:49.905072253 +0000
+++ binutils/gas/doc/c-mips.texi	2015-11-17 13:09:19.852572871 +0000
@@ -30,6 +30,8 @@ Assembly Language Programming'' in the s
 * MIPS insn::		Directive to mark data as an instruction
 * MIPS FP ABIs::	Marking which FP ABI is in use
 * MIPS NaN Encodings::	Directives to record which NaN encoding is being used
+* MIPS IEEE Std 754 Compliance Modes:: Directives to record which IEEE Std 754
+  			compliance mode is being used
 * MIPS Option Stack::	Directives to save and restore options
 * MIPS ASE Instruction Generation Overrides:: Directives to control
   			generation of MIPS ASE instructions
@@ -474,6 +476,20 @@ directive to the beginning of the source
 @option{-mnan=legacy} is the default if no @option{-mnan} option or
 @code{.nan} directive is used.
 
+@cindex @option{-mieee=} command line option, MIPS
+@item -mieee=@var{mode}
+This option indicates whether the source code uses the relaxed IEEE Std 754
+compliance mode (@option{-mieee=relaxed}) or the original strict IEEE Std
+754 compliance mode (@option{-mieee=strict}), and also whether the source
+code requests a warning at the link stage to be produced when strict IEEE
+Std 754 code is linked into relaxed IEEE Std 754 code (@option{-mieee=warn})
+or not (@option{-mieee=nowarn}).  It is equivalent to adding a @code{.ieee}
+directive to the beginning of the source file.  @xref{MIPS IEEE Std 754
+Compliance Modes}.
+
+@option{-mieee=strict} and @option{-mieee=warn} are the defaults if no
+@option{-mieee} option or @code{.ieee} directive is used.
+
 @item --trap
 @itemx --no-break
 @c FIXME!  (1) reflect these options (next item too) in option summaries;
@@ -944,6 +960,57 @@ control the setting of the @code{EF_MIPS
 
 Traditional MIPS assemblers do not support these directives.
 
+@node MIPS IEEE Std 754 Compliance Modes
+@section Directives to record which IEEE Std 754 compliance mode is being used
+
+@cindex MIPS IEEE Std 754 compliance mode selection
+@cindex @code{.ieee} directive, MIPS
+Assembly files can use the @code{.ieee} directive to select between two
+IEEE Std 754 compliance modes.  @samp{.ieee relaxed} says that the
+assembly file uses the relaxed IEEE Std 754 compliance mode, where some
+operations for some input data may not produce results exactly how the
+standard mandates.  @samp{.ieee strict} says that the file uses the strict
+IEEE Std 754 compliance mode, where results produced have to follow
+requirements of the standard for all operations and all input data.  If
+several @code{.ieee} directives are given, the final setting is the one
+that is used.
+
+Currently the directive commands whether the semantics of ``signalling''
+NaN and ``quiet'' NaN input data has to be strictly followed as defined
+by IEEE Std 754 or not.  This relates to the two NaN data encodings
+possible that MIPS architecture has defined.  @xref{MIPS NaN Encodings}.
+In the relaxed IEEE Std 754 compliance mode it is in particular possible
+to run software that uses a NaN data encoding different to one supported
+by hardware.
+
+The mode selected is recorded in the @code{.MIPS.abiflags} section and the
+@code{AFL_FLAGS2_RELAXED} flag set accordingly there.  Additionally the
+@code{AFL_FLAGS1_IEEE} flag is always set to denote the object has been
+produced by an assembler that has support for IEEE Std 754 compliance mode
+selection.
+
+The @code{.ieee} directive is also used to control whether a warning needs
+to be issued where strict IEEE Std 754 compliance code is switched to
+the relaxed IEEE Std 754 compliance mode at the link stage.  @samp{.ieee
+warn} says that a warning is requested, and @samp{.ieee nowarn} is the
+opposite.  This setting is recorded in the @code{.MIPS.abiflags} section
+and the @code{AFL_FLAGS2_NOWARN} flag set accordingly there.
+
+The command-line options @option{-mieee=strict}, @option{-mieee=relaxed}
+@option{-mieee=warn} and @option{-mieee=nowarn} can be used instead of
+@samp{.ieee strict}, @samp{.ieee relaxed}, @samp{.ieee warn} and @samp{.ieee
+nowarn} respectively.  However, any @code{.ieee} directive overrides the
+command-line setting.
+
+@samp{.ieee strict} and @samp{.ieee warn} are the defaults if no @code{.ieee}
+directive or @option{-mieee} option is given.
+
+Note that @sc{gnu} @code{@value{AS}} does not produce NaNs itself and
+therefore these directives do not affect code generation.  They simply
+control the setting of the @code{AFL_FLAGS2_RELAXED} flag.
+
+Traditional MIPS assemblers do not support these directives.
+
 @node MIPS Option Stack
 @section Directives to save and restore options
 
Index: binutils/gas/testsuite/gas/mips/attr-gnu-4-6.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/attr-gnu-4-6.d	2015-11-17 12:19:50.626352749 +0000
+++ binutils/gas/testsuite/gas/mips/attr-gnu-4-6.d	2015-11-17 13:09:19.941167011 +0000
@@ -18,6 +18,6 @@ FP ABI: Hard float \(32-bit CPU, 64-bit 
 ISA Extension: .*
 ASEs:
 	.*
-FLAGS 1: 00000001
+FLAGS 1: 00000003
 FLAGS 2: 00000000
 
Index: binutils/gas/testsuite/gas/mips/attr-gnu-4-7.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/attr-gnu-4-7.d	2015-11-17 12:19:51.231358701 +0000
+++ binutils/gas/testsuite/gas/mips/attr-gnu-4-7.d	2015-11-17 13:09:19.968886793 +0000
@@ -18,6 +18,6 @@ FP ABI: Hard float compat \(32-bit CPU, 
 ISA Extension: .*
 ASEs:
 	.*
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
 
Index: binutils/gas/testsuite/gas/mips/attr-none-o32-fp64-nooddspreg.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/attr-none-o32-fp64-nooddspreg.d	2015-11-17 12:19:51.782732251 +0000
+++ binutils/gas/testsuite/gas/mips/attr-none-o32-fp64-nooddspreg.d	2015-11-17 13:09:20.011519990 +0000
@@ -18,6 +18,6 @@ FP ABI: Hard float compat \(32-bit CPU, 
 ISA Extension: .*
 ASEs:
 	.*
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
 
Index: binutils/gas/testsuite/gas/mips/attr-none-o32-fp64.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/attr-none-o32-fp64.d	2015-11-17 12:19:52.377965439 +0000
+++ binutils/gas/testsuite/gas/mips/attr-none-o32-fp64.d	2015-11-17 13:09:20.026704774 +0000
@@ -18,6 +18,6 @@ FP ABI: Hard float \(32-bit CPU, 64-bit 
 ISA Extension: .*
 ASEs:
 	.*
-FLAGS 1: 00000001
+FLAGS 1: 00000003
 FLAGS 2: 00000000
 
Index: binutils/gas/testsuite/gas/mips/call-nonpic-1.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/call-nonpic-1.d	2015-11-17 12:19:52.929345657 +0000
+++ binutils/gas/testsuite/gas/mips/call-nonpic-1.d	2015-11-17 13:09:20.041947466 +0000
@@ -14,7 +14,7 @@ FP ABI: Hard float \(double precision\)
 ISA Extension: None
 ASEs:
 	None
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
 
 
Index: binutils/gas/testsuite/gas/mips/elf_arch_mips1.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/elf_arch_mips1.d	2015-11-17 12:19:55.231819745 +0000
+++ binutils/gas/testsuite/gas/mips/elf_arch_mips1.d	2015-11-17 13:09:20.079825258 +0000
@@ -18,6 +18,6 @@ FP ABI: Hard float \(double precision\)
 ISA Extension: None
 ASEs:
 	None
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
 
Index: binutils/gas/testsuite/gas/mips/elf_arch_mips2.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/elf_arch_mips2.d	2015-11-17 12:19:55.967086476 +0000
+++ binutils/gas/testsuite/gas/mips/elf_arch_mips2.d	2015-11-17 13:09:20.102362505 +0000
@@ -16,6 +16,6 @@ FP ABI: Hard float \(double precision\)
 ISA Extension: None
 ASEs:
 	None
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
 
Index: binutils/gas/testsuite/gas/mips/elf_arch_mips3.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/elf_arch_mips3.d	2015-11-17 12:19:56.647439628 +0000
+++ binutils/gas/testsuite/gas/mips/elf_arch_mips3.d	2015-11-17 13:09:20.136081946 +0000
@@ -16,6 +16,6 @@ FP ABI: Hard float \(double precision\)
 ISA Extension: None
 ASEs:
 	None
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
 
Index: binutils/gas/testsuite/gas/mips/elf_arch_mips4.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/elf_arch_mips4.d	2015-11-17 12:19:57.241514272 +0000
+++ binutils/gas/testsuite/gas/mips/elf_arch_mips4.d	2015-11-17 13:09:20.170851019 +0000
@@ -16,6 +16,6 @@ FP ABI: Hard float \(double precision\)
 ISA Extension: None
 ASEs:
 	None
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
 
Index: binutils/gas/testsuite/gas/mips/elf_arch_mips5.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/elf_arch_mips5.d	2015-11-17 12:19:57.814192620 +0000
+++ binutils/gas/testsuite/gas/mips/elf_arch_mips5.d	2015-11-17 13:09:20.192351651 +0000
@@ -16,6 +16,6 @@ FP ABI: Hard float \(double precision\)
 ISA Extension: None
 ASEs:
 	None
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
 
Index: binutils/gas/testsuite/gas/mips/ieee-error-1.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-error-1.l	2015-11-17 13:09:20.204513361 +0000
@@ -0,0 +1,2 @@
+.*\.s: Assembler messages:
+.*\.s:1: Error: bad .ieee directive
Index: binutils/gas/testsuite/gas/mips/ieee-error-1.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-error-1.s	2015-11-17 13:09:20.220692802 +0000
@@ -0,0 +1 @@
+	.ieee	foo
Index: binutils/gas/testsuite/gas/mips/ieee-error-2.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-error-2.l	2015-11-17 13:09:20.235032215 +0000
@@ -0,0 +1,2 @@
+Assembler messages:
+Fatal error: invalid IEEE setting -mieee=foo
Index: binutils/gas/testsuite/gas/mips/ieee-error-2.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-error-2.s	2015-11-17 13:09:20.249270548 +0000
@@ -0,0 +1 @@
+# No contents necessary.
Index: binutils/gas/testsuite/gas/mips/ieee-nowarn-1.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-nowarn-1.d	2015-11-17 13:09:20.266399102 +0000
@@ -0,0 +1,18 @@
+#name: MIPS nowarn IEEE setting 1
+#source: ieee-nowarn.s
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000001
Index: binutils/gas/testsuite/gas/mips/ieee-nowarn-2.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-nowarn-2.d	2015-11-17 13:09:20.277535380 +0000
@@ -0,0 +1,19 @@
+#name: MIPS nowarn IEEE setting 2
+#source: ieee-nowarn.s
+#objdump: -p
+#as: -mieee=warn
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000001
Index: binutils/gas/testsuite/gas/mips/ieee-nowarn-3.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-nowarn-3.d	2015-11-17 13:09:20.285616049 +0000
@@ -0,0 +1,18 @@
+#name: MIPS nowarn IEEE setting 3
+#source: ieee-nowarn-override.s
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000001
Index: binutils/gas/testsuite/gas/mips/ieee-nowarn-4.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-nowarn-4.d	2015-11-17 13:09:20.288638096 +0000
@@ -0,0 +1,19 @@
+#name: MIPS nowarn IEEE setting 4
+#source: empty.s
+#objdump: -p
+#as: -mieee=nowarn
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000001
Index: binutils/gas/testsuite/gas/mips/ieee-nowarn-override.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-nowarn-override.s	2015-11-17 13:09:20.318932491 +0000
@@ -0,0 +1,2 @@
+	.ieee	warn
+	.ieee	nowarn
Index: binutils/gas/testsuite/gas/mips/ieee-nowarn.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-nowarn.s	2015-11-17 13:09:20.326065597 +0000
@@ -0,0 +1 @@
+	.ieee	nowarn
Index: binutils/gas/testsuite/gas/mips/ieee-relaxed-1.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-relaxed-1.d	2015-11-17 13:09:20.363514986 +0000
@@ -0,0 +1,18 @@
+#name: MIPS relaxed IEEE setting 1
+#source: ieee-relaxed.s
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/gas/testsuite/gas/mips/ieee-relaxed-2.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-relaxed-2.d	2015-11-17 13:09:20.387118379 +0000
@@ -0,0 +1,19 @@
+#name: MIPS relaxed IEEE setting 2
+#source: ieee-relaxed.s
+#objdump: -p
+#as: -mieee=strict
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/gas/testsuite/gas/mips/ieee-relaxed-3.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-relaxed-3.d	2015-11-17 13:09:20.396255138 +0000
@@ -0,0 +1,18 @@
+#name: MIPS relaxed IEEE setting 3
+#source: ieee-relaxed-override.s
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/gas/testsuite/gas/mips/ieee-relaxed-4.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-relaxed-4.d	2015-11-17 13:09:20.442882349 +0000
@@ -0,0 +1,19 @@
+#name: MIPS relaxed IEEE setting 4
+#source: empty.s
+#objdump: -p
+#as: -mieee=relaxed
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/gas/testsuite/gas/mips/ieee-relaxed-5.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-relaxed-5.d	2015-11-17 13:09:20.446932056 +0000
@@ -0,0 +1,18 @@
+#name: MIPS relaxed IEEE setting 5
+#source: ieee-relaxed-nowarn.s
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000003
Index: binutils/gas/testsuite/gas/mips/ieee-relaxed-nowarn.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-relaxed-nowarn.s	2015-11-17 13:09:20.449953648 +0000
@@ -0,0 +1,2 @@
+	.ieee	relaxed
+	.ieee	nowarn
Index: binutils/gas/testsuite/gas/mips/ieee-relaxed-override.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-relaxed-override.s	2015-11-17 13:09:20.461117785 +0000
@@ -0,0 +1,2 @@
+	.ieee	strict
+	.ieee	relaxed
Index: binutils/gas/testsuite/gas/mips/ieee-relaxed.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-relaxed.s	2015-11-17 13:09:20.465157766 +0000
@@ -0,0 +1 @@
+	.ieee	relaxed
Index: binutils/gas/testsuite/gas/mips/ieee-strict-1.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-strict-1.d	2015-11-17 13:09:20.468233534 +0000
@@ -0,0 +1,18 @@
+#name: MIPS strict IEEE setting 1
+#source: ieee-strict.s
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/gas/testsuite/gas/mips/ieee-strict-2.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-strict-2.d	2015-11-17 13:09:20.494683424 +0000
@@ -0,0 +1,19 @@
+#name: MIPS strict IEEE setting 2
+#source: ieee-strict.s
+#objdump: -p
+#as: -mieee=relaxed
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/gas/testsuite/gas/mips/ieee-strict-3.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-strict-3.d	2015-11-17 13:09:20.496743827 +0000
@@ -0,0 +1,18 @@
+#name: MIPS strict IEEE setting 3
+#source: ieee-strict-override.s
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/gas/testsuite/gas/mips/ieee-strict-4.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-strict-4.d	2015-11-17 13:09:20.502842485 +0000
@@ -0,0 +1,19 @@
+#name: MIPS strict IEEE setting 4
+#source: empty.s
+#objdump: -p
+#as: -mieee=strict
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/gas/testsuite/gas/mips/ieee-strict-5.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-strict-5.d	2015-11-17 13:09:20.552650324 +0000
@@ -0,0 +1,18 @@
+#name: MIPS strict IEEE setting 5
+#source: ieee-strict-nowarn.s
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000001
Index: binutils/gas/testsuite/gas/mips/ieee-strict-6.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-strict-6.d	2015-11-17 13:09:20.554668532 +0000
@@ -0,0 +1,18 @@
+#name: MIPS strict IEEE setting 6
+#source: empty.s
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/gas/testsuite/gas/mips/ieee-strict-nowarn.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-strict-nowarn.s	2015-11-17 13:09:20.564852448 +0000
@@ -0,0 +1,2 @@
+	.ieee	strict
+	.ieee	nowarn
Index: binutils/gas/testsuite/gas/mips/ieee-strict-override.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-strict-override.s	2015-11-17 13:09:20.616427829 +0000
@@ -0,0 +1,2 @@
+	.ieee	relaxed
+	.ieee	strict
Index: binutils/gas/testsuite/gas/mips/ieee-strict.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-strict.s	2015-11-17 13:09:20.710486899 +0000
@@ -0,0 +1 @@
+	.ieee	strict
Index: binutils/gas/testsuite/gas/mips/ieee-warn-1.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-warn-1.d	2015-11-17 13:09:20.731794919 +0000
@@ -0,0 +1,18 @@
+#name: MIPS warn IEEE setting 1
+#source: ieee-warn.s
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/gas/testsuite/gas/mips/ieee-warn-2.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-warn-2.d	2015-11-17 13:09:20.764253830 +0000
@@ -0,0 +1,19 @@
+#name: MIPS warn IEEE setting 2
+#source: ieee-warn.s
+#objdump: -p
+#as: -mieee=nowarn
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/gas/testsuite/gas/mips/ieee-warn-3.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-warn-3.d	2015-11-17 13:09:20.841336175 +0000
@@ -0,0 +1,18 @@
+#name: MIPS warn IEEE setting 3
+#source: ieee-warn-override.s
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/gas/testsuite/gas/mips/ieee-warn-4.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-warn-4.d	2015-11-17 13:09:20.871919714 +0000
@@ -0,0 +1,19 @@
+#name: MIPS warn IEEE setting 4
+#source: empty.s
+#objdump: -p
+#as: -mieee=warn
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/gas/testsuite/gas/mips/ieee-warn-5.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-warn-5.d	2015-11-17 13:09:20.873967487 +0000
@@ -0,0 +1,18 @@
+#name: MIPS warn IEEE setting 5
+#source: empty.s
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/gas/testsuite/gas/mips/ieee-warn-override.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-warn-override.s	2015-11-17 13:09:20.882112110 +0000
@@ -0,0 +1,2 @@
+	.ieee	nowarn
+	.ieee	warn
Index: binutils/gas/testsuite/gas/mips/ieee-warn.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/ieee-warn.s	2015-11-17 13:09:20.894433969 +0000
@@ -0,0 +1 @@
+	.ieee	warn
Index: binutils/gas/testsuite/gas/mips/mips.exp
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/mips.exp	2015-11-17 12:20:19.194807226 +0000
+++ binutils/gas/testsuite/gas/mips/mips.exp	2015-11-17 13:09:20.914978531 +0000
@@ -1018,6 +1018,33 @@ if { [istarget mips*-*-vxworks*] } {
     run_list_test "nan-error-1"
     run_list_test "nan-error-2" "-mnan=foo"
 
+    run_dump_test "ieee-warn-1"
+    run_dump_test "ieee-warn-2"
+    run_dump_test "ieee-warn-3"
+    run_dump_test "ieee-warn-4"
+    run_dump_test "ieee-warn-5"
+
+    run_dump_test "ieee-nowarn-1"
+    run_dump_test "ieee-nowarn-2"
+    run_dump_test "ieee-nowarn-3"
+    run_dump_test "ieee-nowarn-4"
+
+    run_dump_test "ieee-strict-1"
+    run_dump_test "ieee-strict-2"
+    run_dump_test "ieee-strict-3"
+    run_dump_test "ieee-strict-4"
+    run_dump_test "ieee-strict-5"
+    run_dump_test "ieee-strict-6"
+
+    run_dump_test "ieee-relaxed-1"
+    run_dump_test "ieee-relaxed-2"
+    run_dump_test "ieee-relaxed-3"
+    run_dump_test "ieee-relaxed-4"
+    run_dump_test "ieee-relaxed-5"
+
+    run_list_test "ieee-error-1"
+    run_list_test "ieee-error-2" "-mieee=foo"
+
     if $has_newabi {
 	run_dump_test "n32-consec"
     }
Index: binutils/gas/testsuite/gas/mips/module-defer-warn1.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/module-defer-warn1.d	2015-11-17 12:20:19.836760167 +0000
+++ binutils/gas/testsuite/gas/mips/module-defer-warn1.d	2015-11-17 13:09:21.086674346 +0000
@@ -16,5 +16,5 @@ FP ABI: Hard float \(double precision\)
 ISA Extension: None
 ASEs:
 	None
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
Index: binutils/gas/testsuite/gas/mips/module-mfpxx.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/module-mfpxx.d	2015-11-17 12:20:20.494549076 +0000
+++ binutils/gas/testsuite/gas/mips/module-mfpxx.d	2015-11-17 13:09:21.434319196 +0000
@@ -16,6 +16,6 @@ FP ABI: Hard float \(32-bit CPU, Any FPU
 ISA Extension: None
 ASEs:
 	None
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
 
Index: binutils/gas/testsuite/gas/mips/module-override.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/module-override.d	2015-11-17 12:19:59.825970934 +0000
+++ binutils/gas/testsuite/gas/mips/module-override.d	2015-11-17 13:09:21.634689798 +0000
@@ -16,5 +16,5 @@ FP ABI: Hard float \(double precision\)
 ISA Extension: None
 ASEs:
 	None
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
Index: binutils/gas/testsuite/gas/mips/no-odd-spreg.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/no-odd-spreg.d	2015-11-17 12:20:21.115122398 +0000
+++ binutils/gas/testsuite/gas/mips/no-odd-spreg.d	2015-11-17 13:09:21.681151250 +0000
@@ -18,5 +18,5 @@ FP ABI: .*
 ISA Extension: .*
 ASEs:
 #...
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
Index: binutils/gas/testsuite/gas/mips/odd-spreg.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/odd-spreg.d	2015-11-17 12:20:22.269358813 +0000
+++ binutils/gas/testsuite/gas/mips/odd-spreg.d	2015-11-17 13:09:21.737062813 +0000
@@ -18,5 +18,5 @@ FP ABI: .*
 ISA Extension: .*
 ASEs:
 #...
-FLAGS 1: 00000001
+FLAGS 1: 00000003
 FLAGS 2: 00000000
Index: binutils/include/elf/mips.h
===================================================================
--- binutils.orig/include/elf/mips.h	2015-11-17 12:20:23.187026872 +0000
+++ binutils/include/elf/mips.h	2015-11-17 13:09:21.767476544 +0000
@@ -1252,7 +1252,15 @@ extern void bfd_mips_elf_swap_abiflags_v
 #define AFL_EXT_OCTEON3      19  /* Cavium Networks Octeon3.  */
 
 /* Masks for the flags1 word of an ABI flags structure.  */
-#define AFL_FLAGS1_ODDSPREG   1	 /* Uses odd single-precision registers.  */
+#define AFL_FLAGS1_ODDSPREG 1 /* Uses odd single-precision registers.  */
+#define AFL_FLAGS1_IEEE     2 /* IEEE Std 754 compliance mode selection
+				 requested.  */
+
+/* Masks for the flags2 word of an ABI flags structure.  */
+#define AFL_FLAGS2_NOWARN   1 /* Do not warn on linking a strict object in
+				 the IEEE Std 754 relaxed compliance mode.  */
+#define AFL_FLAGS2_RELAXED  2 /* IEEE Std 754 relaxed compliance mode
+				 selected.  */
 
 extern unsigned int bfd_mips_isa_ext (bfd *);
 
Index: binutils/ld/emultempl/mipself.em
===================================================================
--- binutils.orig/ld/emultempl/mipself.em	2015-11-17 13:09:07.746675117 +0000
+++ binutils/ld/emultempl/mipself.em	2015-11-17 13:09:21.796051107 +0000
@@ -34,6 +34,8 @@ static lang_input_statement_type *stub_f
 static bfd *stub_bfd;
 
 static bfd_boolean insn32;
+static bfd_boolean mips_ieee_relaxed;
+static bfd_boolean mips_ieee_nowarn;
 
 static void
 mips_after_parse (void)
@@ -202,7 +204,11 @@ mips_create_output_section_statements (v
 
   htab = elf_hash_table (&link_info);
   if (is_elf_hash_table (htab) && is_mips_elf (link_info.output_bfd))
-    _bfd_mips_elf_insn32 (&link_info, insn32);
+    {
+      _bfd_mips_elf_insn32 (&link_info, insn32);
+      _bfd_mips_elf_ieee_relaxed (&link_info, mips_ieee_relaxed);
+      _bfd_mips_elf_ieee_nowarn (&link_info, mips_ieee_nowarn);
+    }
 
   if (is_mips_elf (link_info.output_bfd))
     _bfd_mips_elf_init_stubs (&link_info, mips_add_stub_section);
@@ -253,13 +259,15 @@ PARSE_AND_LIST_PROLOGUE='
 enum
   {
     OPTION_INSN32 = 301,
-    OPTION_NO_INSN32
+    OPTION_NO_INSN32,
+    OPTION_IEEE
   };
 '
 
 PARSE_AND_LIST_LONGOPTS='
   { "insn32", no_argument, NULL, OPTION_INSN32 },
   { "no-insn32", no_argument, NULL, OPTION_NO_INSN32 },
+  { "ieee", required_argument, NULL, OPTION_IEEE },
 '
 
 PARSE_AND_LIST_OPTIONS='
@@ -269,6 +277,9 @@ PARSE_AND_LIST_OPTIONS='
   fprintf (file, _("\
   --no-insn32                 Generate all microMIPS instructions\n"
 		   ));
+  fprintf (file, _("\
+  --ieee=<mode>               Select the IEEE Std 754 compliance mode\n"
+		   ));
 '
 
 PARSE_AND_LIST_ARGS_CASES='
@@ -279,6 +290,20 @@ PARSE_AND_LIST_ARGS_CASES='
     case OPTION_NO_INSN32:
       insn32 = FALSE;
       break;
+
+    case OPTION_IEEE:
+      if (strcmp (optarg, "relaxed") == 0)
+        mips_ieee_relaxed = TRUE;
+      else if (strcmp (optarg, "strict") == 0)
+        mips_ieee_relaxed = FALSE;
+      else if (strcmp (optarg, "nowarn") == 0)
+        mips_ieee_nowarn = TRUE;
+      else if (strcmp (optarg, "warn") == 0)
+        mips_ieee_nowarn = FALSE;
+      else
+        einfo (_("Unrecognized --ieee argument '\''%s'\''.\n"), optarg);
+      break;
+
 '
 
 LDEMUL_AFTER_PARSE=mips_after_parse
Index: binutils/ld/ld.texinfo
===================================================================
--- binutils.orig/ld/ld.texinfo	2015-11-17 13:07:16.300055439 +0000
+++ binutils/ld/ld.texinfo	2015-11-17 13:09:21.828786437 +0000
@@ -2924,7 +2924,9 @@ Info entry for @file{ld}.
 @c man begin OPTIONS
 
 The following options are supported to control microMIPS instruction
-generation when linking for MIPS targets.
+generation and IEEE Std 754 compliance modes when linking for MIPS
+targets.  Options that take values may be separated from their values
+by either a space or an equals sign.
 
 @table @gcctabopt
 
@@ -2939,6 +2941,30 @@ or in relaxation.  If @samp{--insn32} is
 used, all instruction encodings are used, including 16-bit ones where
 possible.
 
+@kindex --ieee
+@item --ieee=@var{mode}
+This option controls the IEEE Std 754 compliance mode, affecting input
+object acceptance and output object annotation.  @var{mode} should be one
+of @samp{strict}, @samp{relaxed}, @samp{warn}, or @samp{nowarn}.
+
+By default or if @samp{--ieee=strict} is used, only input objects marked
+for strict IEEE Std 754 compliance or not marked at all are accepted.
+The presence of any object marked for relaxed compliance among objects
+being linked causes a link error.  The output object produced is marked
+for strict compliance.
+
+If @samp{--ieee=relaxed} is used, any input objects are accepted.  The
+output object produced is marked for relaxed compliance.
+
+By default or if the @samp{--ieee=warn} is used and the output object is
+marked for relaxed compliance, then the absence of any object marked for
+relaxed compliance among objects being linked causes a link warning,
+unless all the objects present in the link have requested to suppress such
+a warning.
+
+If @samp{--ieee=nowarn} is used, then no warning is ever issued regarding
+IEEE Std 754 compliance.
+
 @end table
 
 @c man end
@@ -6898,6 +6924,31 @@ used, then the linker only uses 32-bit i
 or if @samp{--no-insn32} is used, all instruction encodings are used,
 including 16-bit ones where possible.
 
+@cindex MIPS IEEE Std 754 compliance mode selection
+@kindex --ieee
+The @samp{--ieee=@var{mode}} option controls the IEEE Std 754 compliance
+mode, affecting input object acceptance and output object annotation.
+@var{mode} should be one of @samp{strict}, @samp{relaxed}, @samp{warn},
+or @samp{nowarn}.
+
+By default or if @samp{--ieee=strict} is used, only input objects marked
+for strict IEEE Std 754 compliance or not marked at all are accepted.
+The presence of any object marked for relaxed compliance among objects
+being linked causes a link error.  The output object produced is marked
+for strict compliance.
+
+If @samp{--ieee=relaxed} is used, any input objects are accepted.  The
+output object produced is marked for relaxed compliance.
+
+By default or if the @samp{--ieee=warn} is used and the output object is
+marked for relaxed compliance, then the absence of any object marked for
+relaxed compliance among objects being linked causes a link warning,
+unless all the objects present in the link have requested to suppress such
+a warning.
+
+If @samp{--ieee=nowarn} is used, then no warning is ever issued regarding
+IEEE Std 754 compliance.
+
 @ifclear GENERIC
 @lowersections
 @end ifclear
Index: binutils/ld/testsuite/ld-mips-elf/ieee-default-1.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-default-1.d	2015-11-17 13:09:21.850217235 +0000
@@ -0,0 +1,19 @@
+#source: ieee-strict.s
+#source: ieee-strict.s
+#ld: -r
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/ld/testsuite/ld-mips-elf/ieee-default-2.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-default-2.d	2015-11-17 13:09:21.855330204 +0000
@@ -0,0 +1,19 @@
+#source: ieee-strict.s
+#source: ieee-nowarn.s
+#ld: -r
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/ld/testsuite/ld-mips-elf/ieee-default-3.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-default-3.d	2015-11-17 13:09:21.904641626 +0000
@@ -0,0 +1,5 @@
+#source: ieee-strict.s
+#source: ieee-relaxed.s
+#ld: -r
+#error: \A[^\n]*: [^\n]* Relaxed IEEE Std 754 compliance mode object in a strict compliance link\n
+#error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z
Index: binutils/ld/testsuite/ld-mips-elf/ieee-default-4.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-default-4.d	2015-11-17 13:09:22.050400529 +0000
@@ -0,0 +1,19 @@
+#source: ieee-nowarn.s
+#source: ieee-nowarn.s
+#ld: -r
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000001
Index: binutils/ld/testsuite/ld-mips-elf/ieee-default-5.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-default-5.d	2015-11-17 13:09:22.058465067 +0000
@@ -0,0 +1,5 @@
+#source: ieee-nowarn.s
+#source: ieee-relaxed.s
+#ld: -r
+#error: \A[^\n]*: [^\n]* Relaxed IEEE Std 754 compliance mode object in a strict compliance link\n
+#error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z
Index: binutils/ld/testsuite/ld-mips-elf/ieee-default-6.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-default-6.d	2015-11-17 13:09:22.249726510 +0000
@@ -0,0 +1,7 @@
+#source: ieee-relaxed.s
+#source: ieee-relaxed.s
+#ld: -r
+#error: \A[^\n]*: [^\n]* Relaxed IEEE Std 754 compliance mode object in a strict compliance link\n
+#error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\n
+#error:   [^\n]*: [^\n]* Relaxed IEEE Std 754 compliance mode object in a strict compliance link\n
+#error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z
Index: binutils/ld/testsuite/ld-mips-elf/ieee-default-final.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-default-final.d	2015-11-17 13:09:22.282502520 +0000
@@ -0,0 +1,18 @@
+#source: ieee-strict.s
+#ld: -e 0
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/ld/testsuite/ld-mips-elf/ieee-nowarn.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-nowarn.s	2015-11-17 13:09:22.311332468 +0000
@@ -0,0 +1,6 @@
+	.ieee	nowarn
+
+# We need some section contents for the .MIPS.abiflags compatibility check
+# to trigger.
+	.data
+	.byte	0
Index: binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-1.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-1.d	2015-11-17 13:09:22.318511004 +0000
@@ -0,0 +1,20 @@
+#source: ieee-strict.s
+#source: ieee-strict.s
+#ld: -r --ieee=relaxed
+#objdump: -p
+#warning: \A[^\n]*: [^\n]* warning: Only strict IEEE Std 754 compliance mode objects seen in a relaxed compliance link\Z
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-2.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-2.d	2015-11-17 13:09:22.328841223 +0000
@@ -0,0 +1,20 @@
+#source: ieee-strict.s
+#source: ieee-nowarn.s
+#ld: -r --ieee=relaxed
+#objdump: -p
+#warning: \A[^\n]*: [^\n]* warning: Only strict IEEE Std 754 compliance mode objects seen in a relaxed compliance link\Z
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-3.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-3.d	2015-11-17 13:09:22.360545192 +0000
@@ -0,0 +1,19 @@
+#source: ieee-strict.s
+#source: ieee-relaxed.s
+#ld: -r --ieee=relaxed
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-4.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-4.d	2015-11-17 13:09:22.364573097 +0000
@@ -0,0 +1,19 @@
+#source: ieee-nowarn.s
+#source: ieee-nowarn.s
+#ld: -r --ieee=relaxed
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000003
Index: binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-5.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-5.d	2015-11-17 13:09:22.374871895 +0000
@@ -0,0 +1,19 @@
+#source: ieee-nowarn.s
+#source: ieee-relaxed.s
+#ld: -r --ieee=relaxed
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-6.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-6.d	2015-11-17 13:09:22.481881459 +0000
@@ -0,0 +1,19 @@
+#source: ieee-relaxed.s
+#source: ieee-relaxed.s
+#ld: -r --ieee=relaxed
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-final.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-final.d	2015-11-17 13:09:22.522719482 +0000
@@ -0,0 +1,18 @@
+#source: ieee-relaxed.s
+#ld: -e 0 --ieee=relaxed
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-nowarn-1.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-nowarn-1.d	2015-11-17 13:09:22.532957283 +0000
@@ -0,0 +1,19 @@
+#source: ieee-strict.s
+#source: ieee-strict.s
+#ld: -r --ieee=relaxed --ieee=nowarn
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-nowarn-2.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-nowarn-2.d	2015-11-17 13:09:22.542171657 +0000
@@ -0,0 +1,19 @@
+#source: ieee-nowarn.s
+#source: ieee-strict.s
+#ld: -r --ieee=relaxed --ieee=nowarn
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-nowarn-3.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-nowarn-3.d	2015-11-17 13:09:22.556346535 +0000
@@ -0,0 +1,19 @@
+#source: ieee-strict.s
+#source: ieee-relaxed.s
+#ld: -r --ieee=relaxed --ieee=nowarn
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-nowarn-4.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-nowarn-4.d	2015-11-17 13:09:22.570553729 +0000
@@ -0,0 +1,19 @@
+#source: ieee-nowarn.s
+#source: ieee-nowarn.s
+#ld: -r --ieee=relaxed --ieee=nowarn
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000003
Index: binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-nowarn-5.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-nowarn-5.d	2015-11-17 13:09:22.598868826 +0000
@@ -0,0 +1,19 @@
+#source: ieee-nowarn.s
+#source: ieee-relaxed.s
+#ld: -r --ieee=relaxed --ieee=nowarn
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-nowarn-6.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-nowarn-6.d	2015-11-17 13:09:22.604039651 +0000
@@ -0,0 +1,19 @@
+#source: ieee-relaxed.s
+#source: ieee-relaxed.s
+#ld: -r --ieee=relaxed --ieee=nowarn
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-nowarn-final.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-relaxed-nowarn-final.d	2015-11-17 13:09:22.614140296 +0000
@@ -0,0 +1,18 @@
+#source: ieee-nowarn.s
+#ld: -e 0 --ieee=relaxed
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000002
Index: binutils/ld/testsuite/ld-mips-elf/ieee-relaxed.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-relaxed.s	2015-11-17 13:09:22.624239407 +0000
@@ -0,0 +1,6 @@
+	.ieee	relaxed
+
+# We need some section contents for the .MIPS.abiflags compatibility check
+# to trigger.
+	.data
+	.byte	0
Index: binutils/ld/testsuite/ld-mips-elf/ieee-strict-1.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-strict-1.d	2015-11-17 13:09:22.757318069 +0000
@@ -0,0 +1,19 @@
+#source: ieee-strict.s
+#source: ieee-strict.s
+#ld: -r --ieee=strict
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/ld/testsuite/ld-mips-elf/ieee-strict-2.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-strict-2.d	2015-11-17 13:09:22.763362817 +0000
@@ -0,0 +1,19 @@
+#source: ieee-strict.s
+#source: ieee-nowarn.s
+#ld: -r --ieee=strict
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/ld/testsuite/ld-mips-elf/ieee-strict-3.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-strict-3.d	2015-11-17 13:09:22.767426700 +0000
@@ -0,0 +1,5 @@
+#source: ieee-strict.s
+#source: ieee-relaxed.s
+#ld: -r --ieee=strict
+#error: \A[^\n]*: [^\n]* Relaxed IEEE Std 754 compliance mode object in a strict compliance link\n
+#error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z
Index: binutils/ld/testsuite/ld-mips-elf/ieee-strict-4.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-strict-4.d	2015-11-17 13:09:22.771467154 +0000
@@ -0,0 +1,19 @@
+#source: ieee-nowarn.s
+#source: ieee-nowarn.s
+#ld: -r --ieee=strict
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000001
Index: binutils/ld/testsuite/ld-mips-elf/ieee-strict-5.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-strict-5.d	2015-11-17 13:09:22.781662742 +0000
@@ -0,0 +1,5 @@
+#source: ieee-nowarn.s
+#source: ieee-relaxed.s
+#ld: -r --ieee=strict
+#error: \A[^\n]*: [^\n]* Relaxed IEEE Std 754 compliance mode object in a strict compliance link\n
+#error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z
Index: binutils/ld/testsuite/ld-mips-elf/ieee-strict-6.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-strict-6.d	2015-11-17 13:09:22.784688058 +0000
@@ -0,0 +1,7 @@
+#source: ieee-relaxed.s
+#source: ieee-relaxed.s
+#ld: -r --ieee=strict
+#error: \A[^\n]*: [^\n]* Relaxed IEEE Std 754 compliance mode object in a strict compliance link\n
+#error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\n
+#error:   [^\n]*: [^\n]* Relaxed IEEE Std 754 compliance mode object in a strict compliance link\n
+#error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z
Index: binutils/ld/testsuite/ld-mips-elf/ieee-strict-final.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-strict-final.d	2015-11-17 13:09:22.787716752 +0000
@@ -0,0 +1,18 @@
+#source: ieee-strict.s
+#ld: -e 0 --ieee=strict
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/ld/testsuite/ld-mips-elf/ieee-strict-nowarn-1.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-strict-nowarn-1.d	2015-11-17 13:09:22.790742277 +0000
@@ -0,0 +1,19 @@
+#source: ieee-strict.s
+#source: ieee-strict.s
+#ld: -r --ieee=strict --ieee=nowarn
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/ld/testsuite/ld-mips-elf/ieee-strict-nowarn-2.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-strict-nowarn-2.d	2015-11-17 13:09:22.804900098 +0000
@@ -0,0 +1,19 @@
+#source: ieee-strict.s
+#source: ieee-nowarn.s
+#ld: -r --ieee=strict --ieee=nowarn
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/ld/testsuite/ld-mips-elf/ieee-strict-nowarn-3.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-strict-nowarn-3.d	2015-11-17 13:09:22.808930529 +0000
@@ -0,0 +1,5 @@
+#source: ieee-strict.s
+#source: ieee-relaxed.s
+#ld: -r --ieee=strict --ieee=nowarn
+#error: \A[^\n]*: [^\n]* Relaxed IEEE Std 754 compliance mode object in a strict compliance link\n
+#error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z
Index: binutils/ld/testsuite/ld-mips-elf/ieee-strict-nowarn-4.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-strict-nowarn-4.d	2015-11-17 13:09:22.814054042 +0000
@@ -0,0 +1,19 @@
+#source: ieee-nowarn.s
+#source: ieee-nowarn.s
+#ld: -r --ieee=strict --ieee=nowarn
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000001
Index: binutils/ld/testsuite/ld-mips-elf/ieee-strict-nowarn-5.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-strict-nowarn-5.d	2015-11-17 13:09:22.975980127 +0000
@@ -0,0 +1,5 @@
+#source: ieee-nowarn.s
+#source: ieee-relaxed.s
+#ld: -r --ieee=strict --ieee=nowarn
+#error: \A[^\n]*: [^\n]* Relaxed IEEE Std 754 compliance mode object in a strict compliance link\n
+#error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z
Index: binutils/ld/testsuite/ld-mips-elf/ieee-strict-nowarn-6.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-strict-nowarn-6.d	2015-11-17 13:09:22.985094885 +0000
@@ -0,0 +1,7 @@
+#source: ieee-relaxed.s
+#source: ieee-relaxed.s
+#ld: -r --ieee=strict --ieee=nowarn
+#error: \A[^\n]*: [^\n]* Relaxed IEEE Std 754 compliance mode object in a strict compliance link\n
+#error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\n
+#error:   [^\n]*: [^\n]* Relaxed IEEE Std 754 compliance mode object in a strict compliance link\n
+#error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z
Index: binutils/ld/testsuite/ld-mips-elf/ieee-strict-nowarn-final.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-strict-nowarn-final.d	2015-11-17 13:09:22.997432091 +0000
@@ -0,0 +1,18 @@
+#source: ieee-nowarn.s
+#ld: -e 0 --ieee=strict
+#objdump: -p
+
+.*: +file format .*mips.*
+#...
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: .*
+CPR1 size: .*
+CPR2 size: .*
+FP ABI: .*
+ISA Extension: .*
+ASEs:
+	.*
+FLAGS 1: 0000000[23]
+FLAGS 2: 00000000
Index: binutils/ld/testsuite/ld-mips-elf/ieee-strict.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/ieee-strict.s	2015-11-17 13:09:22.999515278 +0000
@@ -0,0 +1,6 @@
+	.ieee	strict
+
+# We need some section contents for the .MIPS.abiflags compatibility check
+# to trigger.
+	.data
+	.byte	0
Index: binutils/ld/testsuite/ld-mips-elf/mips-elf.exp
===================================================================
--- binutils.orig/ld/testsuite/ld-mips-elf/mips-elf.exp	2015-11-17 13:07:18.825344451 +0000
+++ binutils/ld/testsuite/ld-mips-elf/mips-elf.exp	2015-11-17 13:09:23.003585473 +0000
@@ -742,6 +742,38 @@ run_dump_test "nan-2008"
 run_dump_test "nan-mixed-1"
 run_dump_test "nan-mixed-2"
 
+run_dump_test "ieee-default-1"
+run_dump_test "ieee-default-2"
+run_dump_test "ieee-default-3"
+run_dump_test "ieee-default-4"
+run_dump_test "ieee-default-5"
+run_dump_test "ieee-strict-1"
+run_dump_test "ieee-strict-2"
+run_dump_test "ieee-strict-3"
+run_dump_test "ieee-strict-4"
+run_dump_test "ieee-strict-5"
+run_dump_test "ieee-strict-nowarn-1"
+run_dump_test "ieee-strict-nowarn-2"
+run_dump_test "ieee-strict-nowarn-3"
+run_dump_test "ieee-strict-nowarn-4"
+run_dump_test "ieee-strict-nowarn-5"
+run_dump_test "ieee-relaxed-1"
+run_dump_test "ieee-relaxed-2"
+run_dump_test "ieee-relaxed-3"
+run_dump_test "ieee-relaxed-4"
+run_dump_test "ieee-relaxed-5"
+run_dump_test "ieee-relaxed-nowarn-1"
+run_dump_test "ieee-relaxed-nowarn-2"
+run_dump_test "ieee-relaxed-nowarn-3"
+run_dump_test "ieee-relaxed-nowarn-4"
+run_dump_test "ieee-relaxed-nowarn-5"
+
+run_dump_test "ieee-default-final"
+run_dump_test "ieee-strict-final"
+run_dump_test "ieee-strict-nowarn-final"
+run_dump_test "ieee-relaxed-final"
+run_dump_test "ieee-relaxed-nowarn-final"
+
 if { $linux_gnu } {
     run_ld_link_tests {
 	{"GOT and versioning 1"
Index: binutils/ld/testsuite/ld-mips-elf/mips16-pic-1.gd
===================================================================
--- binutils.orig/ld/testsuite/ld-mips-elf/mips16-pic-1.gd	2015-11-17 12:20:37.996899390 +0000
+++ binutils/ld/testsuite/ld-mips-elf/mips16-pic-1.gd	2015-11-17 13:09:23.017935249 +0000
@@ -13,7 +13,7 @@ FP ABI: Hard float \(double precision\)
 ISA Extension: .*
 ASEs:
 	MIPS16 ASE
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
 
 Primary GOT:
Index: binutils/ld/testsuite/ld-mips-elf/mips16-pic-2.gd
===================================================================
--- binutils.orig/ld/testsuite/ld-mips-elf/mips16-pic-2.gd	2015-11-17 12:20:38.593030717 +0000
+++ binutils/ld/testsuite/ld-mips-elf/mips16-pic-2.gd	2015-11-17 13:09:23.054227995 +0000
@@ -13,7 +13,7 @@ FP ABI: Hard float \(double precision\)
 ISA Extension: .*
 ASEs:
 	MIPS16 ASE
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
 
 Primary GOT:
Index: binutils/ld/testsuite/ld-mips-elf/mips16-pic-3.gd
===================================================================
--- binutils.orig/ld/testsuite/ld-mips-elf/mips16-pic-3.gd	2015-11-17 12:20:39.226264806 +0000
+++ binutils/ld/testsuite/ld-mips-elf/mips16-pic-3.gd	2015-11-17 13:09:23.071456947 +0000
@@ -13,7 +13,7 @@ FP ABI: Hard float \(double precision\)
 ISA Extension: .*
 ASEs:
 	MIPS16 ASE
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
 
 Primary GOT:
Index: binutils/ld/testsuite/ld-mips-elf/mips16-pic-4a.gd
===================================================================
--- binutils.orig/ld/testsuite/ld-mips-elf/mips16-pic-4a.gd	2015-11-17 12:20:40.042179039 +0000
+++ binutils/ld/testsuite/ld-mips-elf/mips16-pic-4a.gd	2015-11-17 13:09:23.081702697 +0000
@@ -13,7 +13,7 @@ FP ABI: Hard float \(double precision\)
 ISA Extension: .*
 ASEs:
 	MIPS16 ASE
-FLAGS 1: 00000000
+FLAGS 1: 00000002
 FLAGS 2: 00000000
 
 Primary GOT:



More information about the Binutils mailing list