From 3cbd1c0665a545ae6627ed4242c2939cd98f390d Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 29 Oct 2010 16:47:55 +0000 Subject: [PATCH] bfd: * elf32-tic6x.c (elf32_tic6x_obj_attrs_arg_type): Check Tag_ABI_compatibility not Tag_compatibility. (elf32_tic6x_merge_attributes): Update compatibility attribute name in comment. Return FALSE if merging common attributes fails. binutils: * readelf.c (display_tic6x_attribute): Use Tag_ABI_compatibility not hardcoded 32. Display name of this attribute. gas: * doc/c-tic6x.texi (TIC6X Directives): Mention Tag_ABI_compatibility. gas/testsuite: * gas/tic6x/attr-compatibility-directive-1.d, gas/tic6x/attr-compatibility-directive-1.s, gas/tic6x/attr-compatibility-directive-2.d, gas/tic6x/attr-compatibility-directive-2.s: New tests. include/elf: * tic6x-attrs.h (Tag_ABI_compatibility): Define. ld/testsuite: * ld-tic6x/attr-compatibility-gnu-gnu.d, ld-tic6x/attr-compatibility-gnu-other.d, ld-tic6x/attr-compatibility-gnu.s, ld-tic6x/attr-compatibility-other-gnu.d, ld-tic6x/attr-compatibility-other-other.d, ld-tic6x/attr-compatibility-other.s: New tests. --- bfd/ChangeLog | 7 +++++++ bfd/elf32-tic6x.c | 7 ++++--- binutils/ChangeLog | 5 +++++ binutils/readelf.c | 5 ++--- gas/ChangeLog | 5 +++++ gas/doc/c-tic6x.texi | 2 +- gas/testsuite/ChangeLog | 7 +++++++ .../gas/tic6x/attr-compatibility-directive-1.d | 9 +++++++++ .../gas/tic6x/attr-compatibility-directive-1.s | 1 + .../gas/tic6x/attr-compatibility-directive-2.d | 9 +++++++++ .../gas/tic6x/attr-compatibility-directive-2.s | 1 + include/elf/ChangeLog | 4 ++++ include/elf/tic6x-attrs.h | 1 + ld/testsuite/ChangeLog | 9 +++++++++ ld/testsuite/ld-tic6x/attr-compatibility-gnu-gnu.d | 11 +++++++++++ ld/testsuite/ld-tic6x/attr-compatibility-gnu-other.d | 6 ++++++ ld/testsuite/ld-tic6x/attr-compatibility-gnu.s | 1 + ld/testsuite/ld-tic6x/attr-compatibility-other-gnu.d | 6 ++++++ .../ld-tic6x/attr-compatibility-other-other.d | 6 ++++++ ld/testsuite/ld-tic6x/attr-compatibility-other.s | 1 + 20 files changed, 96 insertions(+), 7 deletions(-) create mode 100644 gas/testsuite/gas/tic6x/attr-compatibility-directive-1.d create mode 100644 gas/testsuite/gas/tic6x/attr-compatibility-directive-1.s create mode 100644 gas/testsuite/gas/tic6x/attr-compatibility-directive-2.d create mode 100644 gas/testsuite/gas/tic6x/attr-compatibility-directive-2.s create mode 100644 ld/testsuite/ld-tic6x/attr-compatibility-gnu-gnu.d create mode 100644 ld/testsuite/ld-tic6x/attr-compatibility-gnu-other.d create mode 100644 ld/testsuite/ld-tic6x/attr-compatibility-gnu.s create mode 100644 ld/testsuite/ld-tic6x/attr-compatibility-other-gnu.d create mode 100644 ld/testsuite/ld-tic6x/attr-compatibility-other-other.d create mode 100644 ld/testsuite/ld-tic6x/attr-compatibility-other.s diff --git a/bfd/ChangeLog b/bfd/ChangeLog index faccc5ff6fb..430ead3616a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2010-10-29 Joseph Myers + + * elf32-tic6x.c (elf32_tic6x_obj_attrs_arg_type): Check + Tag_ABI_compatibility not Tag_compatibility. + (elf32_tic6x_merge_attributes): Update compatibility attribute + name in comment. Return FALSE if merging common attributes fails. + 2010-10-29 Nick Clifton PR bintils/6962 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c index 219e73dd5a6..3e8564a4335 100644 --- a/bfd/elf32-tic6x.c +++ b/bfd/elf32-tic6x.c @@ -1661,7 +1661,7 @@ elf32_tic6x_relocate_section (bfd *output_bfd, static int elf32_tic6x_obj_attrs_arg_type (int tag) { - if (tag == Tag_compatibility) + if (tag == Tag_ABI_compatibility) return ATTR_TYPE_FLAG_INT_VAL | ATTR_TYPE_FLAG_STR_VAL; else /* Correct for known attributes, arbitrary for others. */ @@ -1729,8 +1729,9 @@ elf32_tic6x_merge_attributes (bfd *ibfd, bfd *obfd) (_("warning: %B and %B differ in whether code is compiled for DSBT"), obfd, ibfd); } - /* Merge Tag_compatibility attributes and any common GNU ones. */ - _bfd_elf_merge_object_attributes (ibfd, obfd); + /* Merge Tag_ABI_compatibility attributes and any common GNU ones. */ + if (!_bfd_elf_merge_object_attributes (ibfd, obfd)) + return FALSE; return TRUE; } diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 428d68e957d..8faa24207d5 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2010-10-29 Joseph Myers + + * readelf.c (display_tic6x_attribute): Use Tag_ABI_compatibility + not hardcoded 32. Display name of this attribute. + 2010-10-29 H.J. Lu * addr2line.c (process_file): Set BFD_DECOMPRESS. diff --git a/binutils/readelf.c b/binutils/readelf.c index 3c8c020c7e2..44feac42f48 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -10822,11 +10822,10 @@ display_tic6x_attribute (unsigned char * p) } return p; - case 32: - /* Tag_compatibility - treated as generic by binutils for now - although not currently specified for C6X. */ + case Tag_ABI_compatibility: val = read_uleb128 (p, &len); p += len; + printf (" Tag_ABI_compatibility: "); printf (_("flag = %d, vendor = %s\n"), val, p); p += strlen ((char *) p) + 1; return p; diff --git a/gas/ChangeLog b/gas/ChangeLog index efd7d60490c..c4500195cfc 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2010-10-29 Joseph Myers + + * doc/c-tic6x.texi (TIC6X Directives): Mention + Tag_ABI_compatibility. + 2010-10-29 H.J. Lu * write.c (compress_debug): Optimize section flags check. diff --git a/gas/doc/c-tic6x.texi b/gas/doc/c-tic6x.texi index e729cac7636..cd8be230217 100644 --- a/gas/doc/c-tic6x.texi +++ b/gas/doc/c-tic6x.texi @@ -125,7 +125,7 @@ These have the same effects as @option{-matomic} and Set the C6000 EABI build attribute @var{tag} to @var{value}. The @var{tag} is either an attribute number or one of -@code{Tag_ISA} or @code{Tag_ABI_DSBT}. The +@code{Tag_ISA}, @code{Tag_ABI_DSBT} and @code{Tag_ABI_compatibility}. The @var{value} is either a @code{number}, @code{"string"}, or @code{number, "string"} depending on the tag. diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index cc101785f2f..72e26339253 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2010-10-29 Joseph Myers + + * gas/tic6x/attr-compatibility-directive-1.d, + gas/tic6x/attr-compatibility-directive-1.s, + gas/tic6x/attr-compatibility-directive-2.d, + gas/tic6x/attr-compatibility-directive-2.s: New tests. + 2010-10-29 H.J. Lu * elf/dwarf2-1.s: Replace .zdebug_abbrev section with diff --git a/gas/testsuite/gas/tic6x/attr-compatibility-directive-1.d b/gas/testsuite/gas/tic6x/attr-compatibility-directive-1.d new file mode 100644 index 00000000000..73f6bead74e --- /dev/null +++ b/gas/testsuite/gas/tic6x/attr-compatibility-directive-1.d @@ -0,0 +1,9 @@ +#readelf: -A +#name: C6X compatibility attribute, directives 1 +#as: +#source: attr-compatibility-directive-1.s + +Attribute Section: c6xabi +File Attributes + Tag_ISA: C674x + Tag_ABI_compatibility: flag = 1, vendor = gnu diff --git a/gas/testsuite/gas/tic6x/attr-compatibility-directive-1.s b/gas/testsuite/gas/tic6x/attr-compatibility-directive-1.s new file mode 100644 index 00000000000..b0130587b3c --- /dev/null +++ b/gas/testsuite/gas/tic6x/attr-compatibility-directive-1.s @@ -0,0 +1 @@ +.c6xabi_attribute Tag_ABI_compatibility, 1, "gnu" diff --git a/gas/testsuite/gas/tic6x/attr-compatibility-directive-2.d b/gas/testsuite/gas/tic6x/attr-compatibility-directive-2.d new file mode 100644 index 00000000000..fc8c39ecc5c --- /dev/null +++ b/gas/testsuite/gas/tic6x/attr-compatibility-directive-2.d @@ -0,0 +1,9 @@ +#readelf: -A +#name: C6X compatibility attribute, directives 2 +#as: +#source: attr-compatibility-directive-2.s + +Attribute Section: c6xabi +File Attributes + Tag_ISA: C674x + Tag_ABI_compatibility: flag = 1, vendor = gnu diff --git a/gas/testsuite/gas/tic6x/attr-compatibility-directive-2.s b/gas/testsuite/gas/tic6x/attr-compatibility-directive-2.s new file mode 100644 index 00000000000..4367b7a050d --- /dev/null +++ b/gas/testsuite/gas/tic6x/attr-compatibility-directive-2.s @@ -0,0 +1 @@ +.c6xabi_attribute 32, 1, "gnu" diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index a8e25fd5a23..de57262e9f7 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,3 +1,7 @@ +2010-10-29 Joseph Myers + + * tic6x-attrs.h (Tag_ABI_compatibility): Define. + 2010-10-29 Bernd Schmidt Joseph Myers diff --git a/include/elf/tic6x-attrs.h b/include/elf/tic6x-attrs.h index f131cffd15b..c8d8332d6ed 100644 --- a/include/elf/tic6x-attrs.h +++ b/include/elf/tic6x-attrs.h @@ -24,3 +24,4 @@ TAG(Tag_ISA, 4) TAG(Tag_ABI_DSBT, 12) +TAG(Tag_ABI_compatibility, 32) diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 18533d6f7c6..0f80eb3ba08 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2010-10-29 Joseph Myers + + * ld-tic6x/attr-compatibility-gnu-gnu.d, + ld-tic6x/attr-compatibility-gnu-other.d, + ld-tic6x/attr-compatibility-gnu.s, + ld-tic6x/attr-compatibility-other-gnu.d, + ld-tic6x/attr-compatibility-other-other.d, + ld-tic6x/attr-compatibility-other.s: New tests. + 2010-10-29 H.J. Lu * ld-elf/compress1c.d: Only run for Linux targets. diff --git a/ld/testsuite/ld-tic6x/attr-compatibility-gnu-gnu.d b/ld/testsuite/ld-tic6x/attr-compatibility-gnu-gnu.d new file mode 100644 index 00000000000..4cba64ef263 --- /dev/null +++ b/ld/testsuite/ld-tic6x/attr-compatibility-gnu-gnu.d @@ -0,0 +1,11 @@ +#name: C6X compatibility attribute merging, gnu gnu +#as: -mlittle-endian +#ld: -r -melf32_tic6x_le +#source: attr-compatibility-gnu.s +#source: attr-compatibility-gnu.s +#readelf: -A + +Attribute Section: c6xabi +File Attributes + Tag_ISA: C674x + Tag_ABI_compatibility: flag = 1, vendor = gnu diff --git a/ld/testsuite/ld-tic6x/attr-compatibility-gnu-other.d b/ld/testsuite/ld-tic6x/attr-compatibility-gnu-other.d new file mode 100644 index 00000000000..423ab075164 --- /dev/null +++ b/ld/testsuite/ld-tic6x/attr-compatibility-gnu-other.d @@ -0,0 +1,6 @@ +#name: C6X compatibility attribute merging, gnu other +#as: -mlittle-endian +#ld: -r -melf32_tic6x_le +#source: attr-compatibility-gnu.s +#source: attr-compatibility-other.s +#error: .*Object has vendor-specific contents that must be processed by the 'other' toolchain diff --git a/ld/testsuite/ld-tic6x/attr-compatibility-gnu.s b/ld/testsuite/ld-tic6x/attr-compatibility-gnu.s new file mode 100644 index 00000000000..b0130587b3c --- /dev/null +++ b/ld/testsuite/ld-tic6x/attr-compatibility-gnu.s @@ -0,0 +1 @@ +.c6xabi_attribute Tag_ABI_compatibility, 1, "gnu" diff --git a/ld/testsuite/ld-tic6x/attr-compatibility-other-gnu.d b/ld/testsuite/ld-tic6x/attr-compatibility-other-gnu.d new file mode 100644 index 00000000000..80d73e50fa4 --- /dev/null +++ b/ld/testsuite/ld-tic6x/attr-compatibility-other-gnu.d @@ -0,0 +1,6 @@ +#name: C6X compatibility attribute merging, other gnu +#as: -mlittle-endian +#ld: -r -melf32_tic6x_le +#source: attr-compatibility-other.s +#source: attr-compatibility-gnu.s +#error: .*Object tag '1, gnu' is incompatible with tag '1, other' diff --git a/ld/testsuite/ld-tic6x/attr-compatibility-other-other.d b/ld/testsuite/ld-tic6x/attr-compatibility-other-other.d new file mode 100644 index 00000000000..0ebd99be9c6 --- /dev/null +++ b/ld/testsuite/ld-tic6x/attr-compatibility-other-other.d @@ -0,0 +1,6 @@ +#name: C6X compatibility attribute merging, other other +#as: -mlittle-endian +#ld: -r -melf32_tic6x_le +#source: attr-compatibility-other.s +#source: attr-compatibility-other.s +#error: .*Object has vendor-specific contents that must be processed by the 'other' toolchain diff --git a/ld/testsuite/ld-tic6x/attr-compatibility-other.s b/ld/testsuite/ld-tic6x/attr-compatibility-other.s new file mode 100644 index 00000000000..38a605a4b0b --- /dev/null +++ b/ld/testsuite/ld-tic6x/attr-compatibility-other.s @@ -0,0 +1 @@ +.c6xabi_attribute Tag_ABI_compatibility, 1, "other" -- 2.30.2