From: Alan Modra Date: Mon, 2 Mar 2009 13:35:25 +0000 (+0000) Subject: backport 2008-10-10 Nathan Froyd X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8d53a42a16eaf2c69b796301fc6299d1ec85c4af;p=thirdparty%2Fbinutils-gdb.git backport 2008-10-10 Nathan Froyd --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c25d0eca7cc..1f6f1fe66e5 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,9 @@ 2009-03-02 Alan Modra + 2008-10-10 Nathan Froyd + * elf32-ppc.c (ppc_elf_merge_obj_attributes): Merge + Tag_GNU_Power_ABI_Struct_Return. + 2008-10-03 Alan Modra * elf.c (bfd_elf_set_group_contents): Assign sh_info for ld -r when the signature symbol is global. diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 3caf66a910c..55348aefa39 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -3964,6 +3964,33 @@ ppc_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd) ibfd, obfd, in_abi, out_abi); } + /* Check for conflicting Tag_GNU_Power_ABI_Struct_Return attributes + and merge non-conflicting ones. */ + in_attr = &in_attrs[Tag_GNU_Power_ABI_Struct_Return]; + 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) + ; + 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); + } + /* Merge Tag_compatibility attributes and any common GNU ones. */ _bfd_elf_merge_object_attributes (ibfd, obfd); diff --git a/binutils/ChangeLog b/binutils/ChangeLog index a458bbd5b9e..23d697af6bc 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,5 +1,9 @@ 2009-03-02 Alan Modra + 2008-10-10 Nathan Froyd + * readelf.c (display_power_gnu_attribute): Decode + Tag_GNU_Power_ABI_Struct_Return. + 2008-09-28 Alan Modra * objcopy.c (setup_section): Set elf_group_id. diff --git a/binutils/readelf.c b/binutils/readelf.c index 2d356a69626..b7740ecad01 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -9062,6 +9062,29 @@ display_power_gnu_attribute (unsigned char *p, int tag) return p; } + if (tag == Tag_GNU_Power_ABI_Struct_Return) + { + val = read_uleb128 (p, &len); + 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; + } + return p; + } + if (tag & 1) type = 1; /* String. */ else diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index ae259dcbc3c..ba5645fbafa 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,3 +1,8 @@ +2009-03-02 Alan Modra + + 2008-10-10 Nathan Froyd + * ppc.h: Add Tag_GNU_Power_ABI_Struct_Return. + 2008-08-20 Bob Wilson * xtensa.h (R_XTENSA_TLSDESC_FN, R_XTENSA_TLSDESC_ARG) diff --git a/include/elf/ppc.h b/include/elf/ppc.h index 95cccce2481..a0c16f1a7c8 100644 --- a/include/elf/ppc.h +++ b/include/elf/ppc.h @@ -186,6 +186,11 @@ enum registers, 3 for SPE registers; 0 for not tagged or not using any ABIs affected by the differences. */ Tag_GNU_Power_ABI_Vector = 8, + + /* Value 1 for ABIs using r3/r4 for returning structures <= 8 bytes, + 2 for ABIs using memory; 0 for not tagged or not using any ABIs + affected by the differences. */ + Tag_GNU_Power_ABI_Struct_Return = 12 }; #endif /* _ELF_PPC_H */ diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index f67cfbd0556..3060d3f9ebf 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2009-03-02 Alan Modra + + 2008-10-10 Nathan Froyd + * ld-powerpc/attr-gnu-12-1.s: New file. + * ld-powerpc/attr-gnu-12-2.s: New file. + * ld-powerpc/attr-gnu-12-11.d: New file. + * ld-powerpc/attr-gnu-12-21.d: New file. + * ld-powerpc/powerpc.exp: Run new dump tests. + 2009-01-14 Joseph Myers * ld-arm/thumb2-bl-undefweak.d, ld-arm/thumb2-bl-undefweak.s: New. diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp index 4e03cf6fb3c..af812a042c1 100644 --- a/ld/testsuite/ld-powerpc/powerpc.exp +++ b/ld/testsuite/ld-powerpc/powerpc.exp @@ -177,3 +177,6 @@ run_dump_test "attr-gnu-4-41" run_dump_test "attr-gnu-8-11" run_dump_test "attr-gnu-8-23" run_dump_test "attr-gnu-8-31" + +run_dump_test "attr-gnu-12-11" +run_dump_test "attr-gnu-12-21"