aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2008-10-10 20:55:36 +0000
committerNathan Froyd <froydnj@codesourcery.com>2008-10-10 20:55:36 +0000
commitf82e0623e15e6331a6cb5e7a2c6334cf5ae75ec9 (patch)
tree826b65789b90c112eda67bd4eda2d22d1c6eeb57
parentc764a876984ebfc21f3635693aebeee4e8d9d0f3 (diff)
downloadgdb-f82e0623e15e6331a6cb5e7a2c6334cf5ae75ec9.zip
gdb-f82e0623e15e6331a6cb5e7a2c6334cf5ae75ec9.tar.gz
gdb-f82e0623e15e6331a6cb5e7a2c6334cf5ae75ec9.tar.bz2
include/elf/
* ppc.h: Add Tag_GNU_Power_ABI_Struct_Return. bfd/ * elf32-ppc.c (ppc_elf_merge_obj_attributes): Merge Tag_GNU_Power_ABI_Struct_Return. binutils/ * readelf.c (display_power_gnu_attribute): Decode Tag_GNU_Power_ABI_Struct_Return. ld/testsuite/ * ld-powerpc/gnu-attr-12-1.s: New file. * ld-powerpc/gnu-attr-12-2.s: New file. * ld-powerpc/gnu-attr-12-11.d: New file. * ld-powerpc/gnu-attr-12-21.d: New file. * ld-powerpc/powerpc.exp: Run new dump tests.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-ppc.c27
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/readelf.c23
-rw-r--r--include/elf/ChangeLog4
-rw-r--r--include/elf/ppc.h5
-rw-r--r--ld/testsuite/ChangeLog8
-rw-r--r--ld/testsuite/ld-powerpc/attr-gnu-12-1.s1
-rw-r--r--ld/testsuite/ld-powerpc/attr-gnu-12-11.d10
-rw-r--r--ld/testsuite/ld-powerpc/attr-gnu-12-2.s1
-rw-r--r--ld/testsuite/ld-powerpc/attr-gnu-12-21.d6
-rw-r--r--ld/testsuite/ld-powerpc/powerpc.exp3
12 files changed, 98 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2c5e391..f0080bb 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2008-10-10 Nathan Froyd <froydnj@codesourcery.com>
+
+ * elf32-ppc.c (ppc_elf_merge_obj_attributes): Merge
+ Tag_GNU_Power_ABI_Struct_Return.
+
2008-10-09 Kai Tietz <kai.tietz@onevision.com>
* cofflink.c (_bfd_coff_generic_relocate_section): Dump bfd_vma sized addresses instead of long sized.
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 1d9cabd..83a9274 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 bc97118..a67c2e1 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2008-10-10 Nathan Froyd <froydnj@codesourcery.com>
+
+ * readelf.c (display_power_gnu_attribute): Decode
+ Tag_GNU_Power_ABI_Struct_Return.
+
2008-10-10 Alan Modra <amodra@bigpond.net.au>
* embedspu.sh: Pass -Wa,-noexecstack to $CC.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index c4bdc1d..51f5ffa 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -9063,6 +9063,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 8d8bcdf..964f6cf 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,7 @@
+2008-10-10 Nathan Froyd <froydnj@codesourcery.com>
+
+ * ppc.h: Add Tag_GNU_Power_ABI_Struct_Return.
+
2008-10-04 Hans-Peter Nilsson <hp@axis.com>
* cris.h (R_CRIS_32_GOT_GD, R_CRIS_16_GOT_GD, R_CRIS_32_GD)
diff --git a/include/elf/ppc.h b/include/elf/ppc.h
index 95cccce..a0c16f1 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 a9e1d84..73a3a38 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2008-10-10 Nathan Froyd <froydnj@codesourcery.com>
+
+ * ld-powerpc/gnu-attr-12-1.s: New file.
+ * ld-powerpc/gnu-attr-12-2.s: New file.
+ * ld-powerpc/gnu-attr-12-11.d: New file.
+ * ld-powerpc/gnu-attr-12-21.d: New file.
+ * ld-powerpc/powerpc.exp: Run new dump tests.
+
2008-10-07 Nick Clifton <nickc@redhat.com>
* ld-ia64/tlsbin.rd: Update expected output now that --wide does
diff --git a/ld/testsuite/ld-powerpc/attr-gnu-12-1.s b/ld/testsuite/ld-powerpc/attr-gnu-12-1.s
new file mode 100644
index 0000000..10cbe3b
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/attr-gnu-12-1.s
@@ -0,0 +1 @@
+.gnu_attribute 12,1
diff --git a/ld/testsuite/ld-powerpc/attr-gnu-12-11.d b/ld/testsuite/ld-powerpc/attr-gnu-12-11.d
new file mode 100644
index 0000000..e88c4ba
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/attr-gnu-12-11.d
@@ -0,0 +1,10 @@
+#source: attr-gnu-12-1.s
+#source: attr-gnu-12-1.s
+#as: -a32
+#ld: -r -melf32ppc
+#readelf: -A
+#target: powerpc*-*-*
+
+Attribute Section: gnu
+File Attributes
+ Tag_GNU_Power_ABI_Struct_Return: r3/r4
diff --git a/ld/testsuite/ld-powerpc/attr-gnu-12-2.s b/ld/testsuite/ld-powerpc/attr-gnu-12-2.s
new file mode 100644
index 0000000..c39de66
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/attr-gnu-12-2.s
@@ -0,0 +1 @@
+.gnu_attribute 12,2
diff --git a/ld/testsuite/ld-powerpc/attr-gnu-12-21.d b/ld/testsuite/ld-powerpc/attr-gnu-12-21.d
new file mode 100644
index 0000000..ef14e35
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/attr-gnu-12-21.d
@@ -0,0 +1,6 @@
+#source: attr-gnu-12-2.s
+#source: attr-gnu-12-1.s
+#as: -a32
+#ld: -r -melf32ppc
+#warning: Warning: .* uses r3/r4 for small structure returns, .* uses memory
+#target: powerpc*-*-*
diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp
index 4e03cf6..af812a0 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"