]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PowerPC .gnu.attributes
authorAlan Modra <amodra@gmail.com>
Mon, 26 Sep 2016 08:34:57 +0000 (18:04 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 9 Mar 2017 08:41:15 +0000 (19:11 +1030)
This patch extends Tag_GNU_Power_ABI_FP to cover long double ABIs,
makes the assembler warn about undefined tag values, and removes
similar warnings from the linker.  I think it is better to not
warn in the linker about undefined tag values as future extensions to
the tags then won't result in likely bogus warnings.  This is
consistent with the fact that an older linker won't warn on an
entirely new tag.

include/
* elf/ppc.h (Tag_GNU_Power_ABI_FP): Comment.
bfd/
* elf-bfd.h (_bfd_elf_ppc_merge_fp_attributes): Declare.
* elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): New function.
(ppc_elf_merge_obj_attributes): Use it.  Don't copy first file
attributes, merge them.  Don't warn about undefined tag bits,
or copy unknown values to output.
* elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Call
_bfd_elf_ppc_merge_fp_attributes.
binutils/
* readelf.c (display_power_gnu_attribute): Catch truncated section
for all powerpc attributes.  Display long double ABI.  Don't
capitalize words, except for names.  Show known bits of tag values
when some unknown bits are present.  Whitespace fixes.
gas/
* config/tc-ppc.c (ppc_elf_gnu_attribute): New function.
(md_pseudo_table <ELF>): Handle "gnu_attribute".
ld/
* testsuite/ld-powerpc/attr-gnu-4-4.s: Delete.
* testsuite/ld-powerpc/attr-gnu-4-14.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-24.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-34.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-41.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-32.d: Adjust expected warning.
* testsuite/ld-powerpc/attr-gnu-8-23.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-01.d: Adjust expected output.
* testsuite/ld-powerpc/attr-gnu-4-02.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-03.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-10.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-11.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-20.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-22.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-33.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-8-11.d: Likewise.
* testsuite/ld-powerpc/powerpc.exp: Don't run deleted tests.

28 files changed:
bfd/ChangeLog
bfd/elf-bfd.h
bfd/elf32-ppc.c
bfd/elf64-ppc.c
binutils/ChangeLog
binutils/readelf.c
gas/ChangeLog
gas/config/tc-ppc.c
include/ChangeLog
include/elf/ppc.h
ld/ChangeLog
ld/testsuite/ld-powerpc/attr-gnu-4-01.d
ld/testsuite/ld-powerpc/attr-gnu-4-02.d
ld/testsuite/ld-powerpc/attr-gnu-4-03.d
ld/testsuite/ld-powerpc/attr-gnu-4-10.d
ld/testsuite/ld-powerpc/attr-gnu-4-11.d
ld/testsuite/ld-powerpc/attr-gnu-4-14.d [deleted file]
ld/testsuite/ld-powerpc/attr-gnu-4-20.d
ld/testsuite/ld-powerpc/attr-gnu-4-22.d
ld/testsuite/ld-powerpc/attr-gnu-4-24.d [deleted file]
ld/testsuite/ld-powerpc/attr-gnu-4-32.d
ld/testsuite/ld-powerpc/attr-gnu-4-33.d
ld/testsuite/ld-powerpc/attr-gnu-4-34.d [deleted file]
ld/testsuite/ld-powerpc/attr-gnu-4-4.s [deleted file]
ld/testsuite/ld-powerpc/attr-gnu-4-41.d [deleted file]
ld/testsuite/ld-powerpc/attr-gnu-8-11.d
ld/testsuite/ld-powerpc/attr-gnu-8-23.d
ld/testsuite/ld-powerpc/powerpc.exp

index d8e4e99f1c35124f96e39357e884b9b7e231873c..b161a20e922d7f98331f29eab543f86abb2c98c4 100644 (file)
@@ -1,3 +1,15 @@
+2017-03-09  Alan Modra  <amodra@gmail.com>
+
+       Apply from master
+       2016-09-26  Alan Modra  <amodra@gmail.com>
+       * elf-bfd.h (_bfd_elf_ppc_merge_fp_attributes): Declare.
+       * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): New function.
+       (ppc_elf_merge_obj_attributes): Use it.  Don't copy first file
+       attributes, merge them.  Don't warn about undefined tag bits,
+       or copy unknown values to output.
+       * elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Call
+       _bfd_elf_ppc_merge_fp_attributes.
+
 2017-02-22  Alan Modra  <amodra@gmail.com>
 
        * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
index 163ef35fadcc41987dd234c56d818be606a10cfe..9b870372f2dc20ed26f5b85b3fe35c35962cc0bb 100644 (file)
@@ -2376,6 +2376,8 @@ extern unsigned int _bfd_elf_ppc_at_tprel_transform
   (unsigned int, unsigned int);
 /* PowerPC elf_object_p tweak.  */
 extern bfd_boolean _bfd_elf_ppc_set_arch (bfd *);
+/* PowerPC .gnu.attributes handling common to both 32-bit and 64-bit.  */
+extern void _bfd_elf_ppc_merge_fp_attributes (bfd *, bfd *);
 
 /* Exported interface for writing elf corefile notes. */
 extern char *elfcore_write_note
index 8b191056cfe4fd71f57f2e363303528e3c5abcb9..d42e2cda5ba69283bab4ab7ab005d9806ec4f859 100644 (file)
@@ -4647,68 +4647,87 @@ ppc_elf_check_relocs (bfd *abfd,
   return TRUE;
 }
 \f
-
-/* Merge object attributes from IBFD into OBFD.  Raise an error if
-   there are conflicting attributes.  */
-static bfd_boolean
-ppc_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd)
+/* Warn for conflicting Tag_GNU_Power_ABI_FP attributes between IBFD
+   and OBFD, and merge non-conflicting ones.  */
+void
+_bfd_elf_ppc_merge_fp_attributes (bfd *ibfd, bfd *obfd)
 {
   obj_attribute *in_attr, *in_attrs;
   obj_attribute *out_attr, *out_attrs;
 
-  if (!elf_known_obj_attributes_proc (obfd)[0].i)
-    {
-      /* This is the first object.  Copy the attributes.  */
-      _bfd_elf_copy_obj_attributes (ibfd, obfd);
-
-      /* Use the Tag_null value to indicate the attributes have been
-        initialized.  */
-      elf_known_obj_attributes_proc (obfd)[0].i = 1;
-
-      return TRUE;
-    }
-
   in_attrs = elf_known_obj_attributes (ibfd)[OBJ_ATTR_GNU];
   out_attrs = elf_known_obj_attributes (obfd)[OBJ_ATTR_GNU];
 
-  /* Check for conflicting Tag_GNU_Power_ABI_FP attributes and merge
-     non-conflicting ones.  */
   in_attr = &in_attrs[Tag_GNU_Power_ABI_FP];
   out_attr = &out_attrs[Tag_GNU_Power_ABI_FP];
+
   if (in_attr->i != out_attr->i)
     {
-      out_attr->type = 1;
-      if (out_attr->i == 0)
-       out_attr->i = in_attr->i;
-      else if (in_attr->i == 0)
+      int in_fp = in_attr->i & 3;
+      int out_fp = out_attr->i & 3;
+
+      if (in_fp == 0)
        ;
-      else if (out_attr->i == 1 && in_attr->i == 2)
+      else if (out_fp == 0)
+       {
+         out_attr->type = 1;
+         out_attr->i ^= in_fp;
+       }
+      else if (out_fp != 2 && in_fp == 2)
        _bfd_error_handler
          (_("Warning: %B uses hard float, %B uses soft float"), obfd, ibfd);
-      else if (out_attr->i == 1 && in_attr->i == 3)
+      else if (out_fp == 2 && in_fp != 2)
        _bfd_error_handler
-         (_("Warning: %B uses double-precision hard float, %B uses single-precision hard float"),
-         obfd, ibfd);
-      else if (out_attr->i == 3 && in_attr->i == 1)
+         (_("Warning: %B uses hard float, %B uses soft float"), ibfd, obfd);
+      else if (out_fp == 1 && in_fp == 3)
        _bfd_error_handler
-         (_("Warning: %B uses double-precision hard float, %B uses single-precision hard float"),
-         ibfd, obfd);
-      else if (out_attr->i == 3 && in_attr->i == 2)
+         (_("Warning: %B uses double-precision hard float, "
+            "%B uses single-precision hard float"), obfd, ibfd);
+      else if (out_fp == 3 && in_fp == 1)
        _bfd_error_handler
-         (_("Warning: %B uses soft float, %B uses single-precision hard float"),
-         ibfd, obfd);
-      else if (out_attr->i == 2 && (in_attr->i == 1 || in_attr->i == 3))
+         (_("Warning: %B uses double-precision hard float, "
+            "%B uses single-precision hard float"), ibfd, obfd);
+
+      in_fp = in_attr->i & 0xc;
+      out_fp = out_attr->i & 0xc;
+      if (in_fp == 0)
+       ;
+      else if (out_fp == 0)
+       {
+         out_attr->type = 1;
+         out_attr->i ^= in_fp;
+       }
+      else if (out_fp != 2 * 4 && in_fp == 2 * 4)
        _bfd_error_handler
-         (_("Warning: %B uses hard float, %B uses soft float"), ibfd, obfd);
-      else if (in_attr->i > 3)
+         (_("Warning: %B uses 64-bit long double, "
+            "%B uses 128-bit long double"), ibfd, obfd);
+      else if (in_fp != 2 * 4 && out_fp == 2 * 4)
        _bfd_error_handler
-         (_("Warning: %B uses unknown floating point ABI %d"), ibfd,
-          in_attr->i);
-      else
+         (_("Warning: %B uses 64-bit long double, "
+            "%B uses 128-bit long double"), obfd, ibfd);
+      else if (out_fp == 1 * 4 && in_fp == 3 * 4)
+       _bfd_error_handler
+         (_("Warning: %B uses IBM long double, "
+            "%B uses IEEE long double"), ibfd, obfd);
+      else if (out_fp == 3 * 4 && in_fp == 1 * 4)
        _bfd_error_handler
-         (_("Warning: %B uses unknown floating point ABI %d"), obfd,
-          out_attr->i);
+         (_("Warning: %B uses IBM long double, "
+            "%B uses IEEE long double"), obfd, ibfd);
     }
+}
+
+/* Merge object attributes from IBFD into OBFD.  Warn if
+   there are conflicting attributes.  */
+static bfd_boolean
+ppc_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd)
+{
+  obj_attribute *in_attr, *in_attrs;
+  obj_attribute *out_attr, *out_attrs;
+
+  _bfd_elf_ppc_merge_fp_attributes (ibfd, obfd);
+
+  in_attrs = elf_known_obj_attributes (ibfd)[OBJ_ATTR_GNU];
+  out_attrs = elf_known_obj_attributes (obfd)[OBJ_ATTR_GNU];
 
   /* Check for conflicting Tag_GNU_Power_ABI_Vector attributes and
      merge non-conflicting ones.  */
@@ -4716,48 +4735,36 @@ ppc_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd)
   out_attr = &out_attrs[Tag_GNU_Power_ABI_Vector];
   if (in_attr->i != out_attr->i)
     {
-      const char *in_abi = NULL, *out_abi = NULL;
-
-      switch (in_attr->i)
-       {
-       case 1: in_abi = "generic"; break;
-       case 2: in_abi = "AltiVec"; break;
-       case 3: in_abi = "SPE"; break;
-       }
+      int in_vec = in_attr->i & 3;
+      int out_vec = out_attr->i & 3;
 
-      switch (out_attr->i)
+      if (in_vec == 0)
+       ;
+      else if (out_vec == 0)
        {
-       case 1: out_abi = "generic"; break;
-       case 2: out_abi = "AltiVec"; break;
-       case 3: out_abi = "SPE"; break;
+         out_attr->type = 1;
+         out_attr->i = in_vec;
        }
-
-      out_attr->type = 1;
-      if (out_attr->i == 0)
-       out_attr->i = in_attr->i;
-      else if (in_attr->i == 0)
-       ;
       /* For now, allow generic to transition to AltiVec or SPE
         without a warning.  If GCC marked files with their stack
         alignment and used don't-care markings for files which are
         not affected by the vector ABI, we could warn about this
         case too.  */
-      else if (out_attr->i == 1)
-       out_attr->i = in_attr->i;
-      else if (in_attr->i == 1)
+      else if (in_vec == 1)
        ;
-      else if (in_abi == NULL)
-       _bfd_error_handler
-         (_("Warning: %B uses unknown vector ABI %d"), ibfd,
-          in_attr->i);
-      else if (out_abi == NULL)
+      else if (out_vec == 1)
+       {
+         out_attr->type = 1;
+         out_attr->i = in_vec;
+       }
+      else if (out_vec < in_vec)
        _bfd_error_handler
-         (_("Warning: %B uses unknown vector ABI %d"), obfd,
-          in_attr->i);
-      else
+         (_("Warning: %B uses AltiVec vector ABI, %B uses SPE vector ABI"),
+          obfd, ibfd);
+      else if (out_vec > in_vec)
        _bfd_error_handler
-         (_("Warning: %B uses vector ABI \"%s\", %B uses \"%s\""),
-          ibfd, obfd, in_abi, out_abi);
+         (_("Warning: %B uses AltiVec vector ABI, %B uses SPE vector ABI"),
+          ibfd, obfd);
     }
 
   /* Check for conflicting Tag_GNU_Power_ABI_Struct_Return attributes
@@ -4766,25 +4773,24 @@ ppc_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd)
   out_attr = &out_attrs[Tag_GNU_Power_ABI_Struct_Return];
   if (in_attr->i != out_attr->i)
     {
-      out_attr->type = 1;
-      if (out_attr->i == 0)
-       out_attr->i = in_attr->i;
-      else if (in_attr->i == 0)
+      int in_struct = in_attr->i & 3;
+      int out_struct = out_attr->i & 3;
+
+      if (in_struct == 0 || in_struct == 3)
        ;
-      else if (out_attr->i == 1 && in_attr->i == 2)
-       _bfd_error_handler
-         (_("Warning: %B uses r3/r4 for small structure returns, %B uses memory"), obfd, ibfd);
-      else if (out_attr->i == 2 && in_attr->i == 1)
-       _bfd_error_handler
-         (_("Warning: %B uses r3/r4 for small structure returns, %B uses memory"), ibfd, obfd);
-      else if (in_attr->i > 2)
-       _bfd_error_handler
-         (_("Warning: %B uses unknown small structure return convention %d"), ibfd,
-          in_attr->i);
-      else
-       _bfd_error_handler
-         (_("Warning: %B uses unknown small structure return convention %d"), obfd,
-          out_attr->i);
+      else if (out_struct == 0)
+       {
+         out_attr->type = 1;
+         out_attr->i = in_struct;
+       }
+      else if (out_struct < in_struct)
+       _bfd_error_handler
+         (_("Warning: %B uses r3/r4 for small structure returns, "
+            "%B uses memory"), obfd, ibfd);
+      else if (out_struct > in_struct)
+       _bfd_error_handler
+         (_("Warning: %B uses r3/r4 for small structure returns, "
+            "%B uses memory"), ibfd, obfd);
     }
 
   /* Merge Tag_compatibility attributes and any common GNU ones.  */
index 0b7f1d7d1eb5d1456eeae45a6c0639cbf6ad3031..ee3c3b2c5f79aec4770ed26795d03b2a3e74a1c4 100644 (file)
@@ -5998,6 +5998,8 @@ ppc64_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
       return FALSE;
     }
 
+  _bfd_elf_ppc_merge_fp_attributes (ibfd, obfd);
+
   /* Merge Tag_compatibility attributes and any common GNU ones.  */
   _bfd_elf_merge_object_attributes (ibfd, obfd);
 
index a70bdb7a7b6c56a6ae35c07e483cfb878170f4b4..c9b813072734a1894d27df2f7904fa2f15eead4a 100644 (file)
@@ -1,3 +1,12 @@
+2017-03-09  Alan Modra  <amodra@gmail.com>
+
+       Apply from master
+       2016-09-26  Alan Modra  <amodra@gmail.com>
+       * readelf.c (display_power_gnu_attribute): Catch truncated section
+       for all powerpc attributes.  Display long double ABI.  Don't
+       capitalize words, except for names.  Show known bits of tag values
+       when some unknown bits are present.  Whitespace fixes.
+
 2016-08-03  Tristan Gingold  <gingold@adacore.com>
 
        * configure: Regenerate.
index 274ddd17266aef6e4ad1f67af8a13a21500ff2af..98fc1961edffa5585c1419afb99addce51c1afe0 100644 (file)
@@ -13237,47 +13237,77 @@ display_power_gnu_attribute (unsigned char * p,
                             const unsigned char * const end)
 {
   unsigned int len;
-  int val;
+  unsigned int val;
 
   if (tag == Tag_GNU_Power_ABI_FP)
     {
       val = read_uleb128 (p, &len, end);
       p += len;
       printf ("  Tag_GNU_Power_ABI_FP: ");
+      if (len == 0)
+       {
+         printf (_("<corrupt>\n"));
+         return p;
+       }
 
-      switch (val)
+      if (val > 15)
+       printf ("(%#x), ", val);
+
+      switch (val & 3)
        {
        case 0:
-         printf (_("Hard or soft float\n"));
+         printf (_("unspecified hard/soft float, "));
          break;
        case 1:
-         printf (_("Hard float\n"));
+         printf (_("hard float, "));
          break;
        case 2:
-         printf (_("Soft float\n"));
+         printf (_("soft float, "));
          break;
        case 3:
-         printf (_("Single-precision hard float\n"));
+         printf (_("single-precision hard float, "));
          break;
-       default:
-         printf ("??? (%d)\n", val);
+       }
+
+      switch (val & 0xC)
+       {
+       case 0:
+         printf (_("unspecified long double\n"));
+         break;
+       case 4:
+         printf (_("128-bit IBM long double\n"));
+         break;
+       case 8:
+         printf (_("64-bit long double\n"));
+         break;
+       case 12:
+         printf (_("128-bit IEEE long double\n"));
          break;
        }
       return p;
-   }
+    }
 
   if (tag == Tag_GNU_Power_ABI_Vector)
     {
       val = read_uleb128 (p, &len, end);
       p += len;
       printf ("  Tag_GNU_Power_ABI_Vector: ");
-      switch (val)
+      if (len == 0)
+       {
+         printf (_("<corrupt>\n"));
+         return p;
+       }
+
+      if (val > 3)
+       printf ("(%#x), ", val);
+
+      switch (val & 3)
        {
        case 0:
-         printf (_("Any\n"));
+         printf (_("unspecified\n"));
          break;
        case 1:
-         printf (_("Generic\n"));
+         printf (_("generic\n"));
          break;
        case 2:
          printf ("AltiVec\n");
@@ -13285,39 +13315,39 @@ display_power_gnu_attribute (unsigned char * p,
        case 3:
          printf ("SPE\n");
          break;
-       default:
-         printf ("??? (%d)\n", val);
-         break;
        }
       return p;
-   }
+    }
 
   if (tag == Tag_GNU_Power_ABI_Struct_Return)
     {
-      if (p == end)
+      val = read_uleb128 (p, &len, end);
+      p += len;
+      printf ("  Tag_GNU_Power_ABI_Struct_Return: ");
+      if (len == 0)
        {
-         warn (_("corrupt Tag_GNU_Power_ABI_Struct_Return\n"));
+         printf (_("<corrupt>\n"));
          return p;
        }
 
-      val = read_uleb128 (p, &len, end);
-      p += len;
-      printf ("  Tag_GNU_Power_ABI_Struct_Return: ");
-      switch (val)
-       {
-       case 0:
-         printf (_("Any\n"));
-         break;
-       case 1:
-         printf ("r3/r4\n");
-         break;
-       case 2:
-         printf (_("Memory\n"));
-         break;
-       default:
-         printf ("??? (%d)\n", val);
-         break;
-       }
+      if (val > 2)
+       printf ("(%#x), ", val);
+
+      switch (val & 3)
+       {
+       case 0:
+         printf (_("unspecified\n"));
+         break;
+       case 1:
+         printf ("r3/r4\n");
+         break;
+       case 2:
+         printf (_("memory\n"));
+         break;
+       case 3:
+         printf ("???\n");
+         break;
+       }
       return p;
     }
 
index fa49c5b2661147909294180413824f87a7547bc5..9ee859838d809d3971acdbe3361b2addbfd2f82f 100644 (file)
@@ -1,3 +1,10 @@
+2017-03-09  Alan Modra  <amodra@gmail.com>
+
+       Apply from master
+       2016-09-26  Alan Modra  <amodra@gmail.com>
+       * config/tc-ppc.c (ppc_elf_gnu_attribute): New function.
+       (md_pseudo_table <ELF>): Handle "gnu_attribute".
+
 2017-03-08  Peter Bergner  <bergner@vnet.ibm.com>
 
        Apply from master.
index fc2a0458288d5228ad0598cd3e6ae7b8e1826293..975e8eb59743a37015ca71873812d3abdb3a6530 100644 (file)
@@ -133,6 +133,7 @@ static void ppc_elf_rdata (int);
 static void ppc_elf_lcomm (int);
 static void ppc_elf_localentry (int);
 static void ppc_elf_abiversion (int);
+static void ppc_elf_gnu_attribute (int);
 #endif
 
 #ifdef TE_PE
@@ -270,6 +271,7 @@ const pseudo_typeS md_pseudo_table[] =
   { "lcomm",   ppc_elf_lcomm,  0 },
   { "localentry", ppc_elf_localentry,  0 },
   { "abiversion", ppc_elf_abiversion,  0 },
+  { "gnu_attribute", ppc_elf_gnu_attribute, 0},
 #endif
 
 #ifdef TE_PE
@@ -2314,6 +2316,28 @@ ppc_elf_abiversion (int ignore ATTRIBUTE_UNUSED)
   demand_empty_rest_of_line ();
 }
 
+/* Parse a .gnu_attribute directive.  */
+static void
+ppc_elf_gnu_attribute (int ignored ATTRIBUTE_UNUSED)
+{
+  int tag = obj_elf_vendor_attribute (OBJ_ATTR_GNU);
+
+  /* Check validity of defined powerpc tags.  */
+  if (tag == Tag_GNU_Power_ABI_FP
+      || tag == Tag_GNU_Power_ABI_Vector
+      || tag == Tag_GNU_Power_ABI_Struct_Return)
+    {
+      unsigned int val;
+
+      val = bfd_elf_get_obj_attr_int (stdoutput, OBJ_ATTR_GNU, tag);
+
+      if ((tag == Tag_GNU_Power_ABI_FP && val > 15)
+         || (tag == Tag_GNU_Power_ABI_Vector && val > 3)
+         || (tag == Tag_GNU_Power_ABI_Struct_Return && val > 2))
+       as_warn (_("unknown .gnu_attribute value"));
+    }
+}
+
 /* Set ABI version in output file.  */
 void
 ppc_elf_end (void)
index a766ecf9dc3246d69456fef5a7cd4adb3d64c96a..c3d9db7aea0bc8248a1ebea88ca85208282219ab 100644 (file)
@@ -1,3 +1,9 @@
+2017-03-09  Alan Modra  <amodra@gmail.com>
+
+       Apply from master
+       2016-09-26  Alan Modra  <amodra@gmail.com>
+       * elf/ppc.h (Tag_GNU_Power_ABI_FP): Comment on new values.
+
 2016-06-30  Matthew Wahab  <matthew.wahab@arm.com>
 
        * opcode/arm.h (ARM_ARCH_V8_2a): Add FPU_NEON_EXT_RDMA to the set
index f4a6bbd6725eeb3666f28d896fb46458dd3fdd44..5f94a34d4e8bbb3dc62a8a909a03e492100bb4d1 100644 (file)
@@ -219,11 +219,18 @@ END_RELOC_NUMBERS (R_PPC_max)
 enum
 {
   /* 0-3 are generic.  */
-  Tag_GNU_Power_ABI_FP = 4, /* Value 1 for hard-float, 2 for
-                              soft-float, 3 for single=precision 
-                              hard-float; 0 for not tagged or not
-                              using any ABIs affected by the
-                              differences.  */
+
+  /* FP ABI, low 2 bits:
+     1 for double precision hard-float,
+     2 for soft-float,
+     3 for single precision hard-float.
+     0 for not tagged or not using any ABIs affected by the differences.
+     Next 2 bits:
+     1 for ibm long double
+     2 for 64-bit long double
+     3 for IEEE long double.
+     0 for not tagged or not using any ABIs affected by the differences.  */
+  Tag_GNU_Power_ABI_FP = 4,
 
   /* Value 1 for general purpose registers only, 2 for AltiVec
      registers, 3 for SPE registers; 0 for not tagged or not using any
index 6c9fc01fae9e279a9e4d0541c834e23fa1c6f74e..9ecd8c185835d66df4993b608024904e02219a37 100644 (file)
@@ -1,3 +1,25 @@
+2017-03-09  Alan Modra  <amodra@gmail.com>
+
+       Apply from master
+       2016-09-26  Alan Modra  <amodra@gmail.com>
+       * testsuite/ld-powerpc/attr-gnu-4-4.s: Delete.
+       * testsuite/ld-powerpc/attr-gnu-4-14.d: Delete.
+       * testsuite/ld-powerpc/attr-gnu-4-24.d: Delete.
+       * testsuite/ld-powerpc/attr-gnu-4-34.d: Delete.
+       * testsuite/ld-powerpc/attr-gnu-4-41.d: Delete.
+       * testsuite/ld-powerpc/attr-gnu-4-32.d: Adjust expected warning.
+       * testsuite/ld-powerpc/attr-gnu-8-23.d: Likewise.
+       * testsuite/ld-powerpc/attr-gnu-4-01.d: Adjust expected output.
+       * testsuite/ld-powerpc/attr-gnu-4-02.d: Likewise.
+       * testsuite/ld-powerpc/attr-gnu-4-03.d: Likewise.
+       * testsuite/ld-powerpc/attr-gnu-4-10.d: Likewise.
+       * testsuite/ld-powerpc/attr-gnu-4-11.d: Likewise.
+       * testsuite/ld-powerpc/attr-gnu-4-20.d: Likewise.
+       * testsuite/ld-powerpc/attr-gnu-4-22.d: Likewise.
+       * testsuite/ld-powerpc/attr-gnu-4-33.d: Likewise.
+       * testsuite/ld-powerpc/attr-gnu-8-11.d: Likewise.
+       * testsuite/ld-powerpc/powerpc.exp: Don't run deleted tests.
+
 2017-02-21  Alan Modra  <amodra@gmail.com>
 
        Apply from master
index 212e0c46f0cb3185481809fda88448e06d57d8c7..62dbec0ec060dcd5d568637c0ba1faee56587c03 100644 (file)
@@ -7,4 +7,4 @@
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_Power_ABI_FP: Hard float
+  Tag_GNU_Power_ABI_FP: hard float, unspecified long double
index 9bd42b59ba692764a7fab5d6265b0eefc6aa9ce0..ae270f1a04b33341c2a6fa376423d1980a448c60 100644 (file)
@@ -7,4 +7,4 @@
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_Power_ABI_FP: Soft float
+  Tag_GNU_Power_ABI_FP: soft float, unspecified long double
index 03b0c3c76e24c267198afb4c8076dd24a91eab44..d79febfd31d091d19e79a4fcd9b54372a002d9cc 100644 (file)
@@ -7,4 +7,4 @@
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_Power_ABI_FP: Single-precision hard float
+  Tag_GNU_Power_ABI_FP: single-precision hard float, unspecified long double
index 93297c20f1f4b8bbaf5317cb8db4f7c8a28e323e..1e015494d23fcc6ddb6eea9080c1b6a22f2673f9 100644 (file)
@@ -7,4 +7,4 @@
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_Power_ABI_FP: Hard float
+  Tag_GNU_Power_ABI_FP: hard float, unspecified long double
index fb2b76e95713b5dac3c0b425171217d157b55afd..5027b78c06aeede93cf8b65390b0f553a2e273cb 100644 (file)
@@ -7,4 +7,4 @@
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_Power_ABI_FP: Hard float
+  Tag_GNU_Power_ABI_FP: hard float, unspecified long double
diff --git a/ld/testsuite/ld-powerpc/attr-gnu-4-14.d b/ld/testsuite/ld-powerpc/attr-gnu-4-14.d
deleted file mode 100644 (file)
index 3bb6661..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#source: attr-gnu-4-1.s
-#source: attr-gnu-4-4.s
-#as: -a32
-#ld: -r -melf32ppc
-#warning: Warning: .* uses unknown floating point ABI 4
-#target: powerpc*-*-*
index 3d838938020f2c187a61b2f14b5e87623d7e0362..fca9de66d76a472eabd99b98ee12ebe3c3fcf105 100644 (file)
@@ -7,4 +7,4 @@
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_Power_ABI_FP: Soft float
+  Tag_GNU_Power_ABI_FP: soft float, unspecified long double
index f6bd198efdf68367b2ae967dddacdfb4689c86d7..80a209cfc355782b0aa4f69aabfc1fc3a187d831 100644 (file)
@@ -7,4 +7,4 @@
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_Power_ABI_FP: Soft float
+  Tag_GNU_Power_ABI_FP: soft float, unspecified long double
diff --git a/ld/testsuite/ld-powerpc/attr-gnu-4-24.d b/ld/testsuite/ld-powerpc/attr-gnu-4-24.d
deleted file mode 100644 (file)
index fc17f91..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#source: attr-gnu-4-2.s
-#source: attr-gnu-4-4.s
-#as: -a32
-#ld: -r -melf32ppc
-#warning: Warning: .* uses unknown floating point ABI 4
-#target: powerpc*-*-*
index 3b7cb2919bd24f5fbb69d4463c43145570c9c776..924a3af0b17afbbcbe95661197ae92134fe5b01a 100644 (file)
@@ -2,5 +2,5 @@
 #source: attr-gnu-4-2.s
 #as: -a32
 #ld: -r -melf32ppc
-#warning: Warning: .* uses soft float, .* uses single-precision hard float
+#warning: Warning: .* uses hard float, .* uses soft float
 #target: powerpc*-*-*
index 88367aef6871bf8f27a4fc33e7408610364918c4..6951b4276488c2d48368c1251bf7f260c976d293 100644 (file)
@@ -7,4 +7,4 @@
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_Power_ABI_FP: Single-precision hard float
+  Tag_GNU_Power_ABI_FP: single-precision hard float, unspecified long double
diff --git a/ld/testsuite/ld-powerpc/attr-gnu-4-34.d b/ld/testsuite/ld-powerpc/attr-gnu-4-34.d
deleted file mode 100644 (file)
index 6f6e1fe..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#source: attr-gnu-4-3.s
-#source: attr-gnu-4-4.s
-#as: -a32
-#ld: -r -melf32ppc
-#warning: Warning: .* uses unknown floating point ABI 4
-#target: powerpc*-*-*
diff --git a/ld/testsuite/ld-powerpc/attr-gnu-4-4.s b/ld/testsuite/ld-powerpc/attr-gnu-4-4.s
deleted file mode 100644 (file)
index 3ff129a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.gnu_attribute 4,4
diff --git a/ld/testsuite/ld-powerpc/attr-gnu-4-41.d b/ld/testsuite/ld-powerpc/attr-gnu-4-41.d
deleted file mode 100644 (file)
index b909476..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#source: attr-gnu-4-4.s
-#source: attr-gnu-4-1.s
-#as: -a32
-#ld: -r -melf32ppc
-#warning: Warning: .* uses unknown floating point ABI 4
-#target: powerpc*-*-*
index 7e49d4a7ef70306b7aeec80e6c995e8ea3665a61..06d7e889117127c550d41501a9557d24cddbcd19 100644 (file)
@@ -7,4 +7,4 @@
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_Power_ABI_Vector: Generic
+  Tag_GNU_Power_ABI_Vector: generic
index b22e4bda3de3cec09af0f0d87c8a505593afd0d9..b442884e721de7e9074d2b7b3cf5387beaa58d4e 100644 (file)
@@ -2,5 +2,5 @@
 #source: attr-gnu-8-3.s
 #as: -a32
 #ld: -r -melf32ppc
-#warning: Warning: .* uses vector ABI "SPE", .* uses "AltiVec"
+#warning: Warning: .* uses AltiVec vector ABI, .* uses SPE vector ABI
 #target: powerpc*-*-*
index f5298bac01574b51c8e8ab8518bdfc12436ea4a1..8cb4b09ac44110d7ef3b497191e6e483db05040f 100644 (file)
@@ -323,17 +323,13 @@ run_dump_test "attr-gnu-4-10"
 run_dump_test "attr-gnu-4-11"
 run_dump_test "attr-gnu-4-12"
 run_dump_test "attr-gnu-4-13"
-run_dump_test "attr-gnu-4-14"
 run_dump_test "attr-gnu-4-20"
 run_dump_test "attr-gnu-4-21"
 run_dump_test "attr-gnu-4-22"
 run_dump_test "attr-gnu-4-23"
-run_dump_test "attr-gnu-4-24"
 run_dump_test "attr-gnu-4-31"
 run_dump_test "attr-gnu-4-32"
 run_dump_test "attr-gnu-4-33"
-run_dump_test "attr-gnu-4-34"
-run_dump_test "attr-gnu-4-41"
 
 run_dump_test "attr-gnu-8-11"
 run_dump_test "attr-gnu-8-23"