* elf32-tic6x.c (elf32_tic6x_obj_attrs_handle_unknown): New.
(elf32_tic6x_merge_attributes): Use
_bfd_elf_merge_unknown_attribute_low and
_bfd_elf_merge_unknown_attribute_list.
(elf_backend_obj_attrs_handle_unknown): Define.
ld/testsuite:
* ld-tic6x/attr-unknown-1.d, ld-tic6x/attr-unknown-1000-1.s,
ld-tic6x/attr-unknown-1000-2.s, ld-tic6x/attr-unknown-1024-1.s,
ld-tic6x/attr-unknown-2.d, ld-tic6x/attr-unknown-3.d,
ld-tic6x/attr-unknown-4.d, ld-tic6x/attr-unknown-5.d,
ld-tic6x/attr-unknown-54-1.s, ld-tic6x/attr-unknown-55-a.s,
ld-tic6x/attr-unknown-6.d, ld-tic6x/attr-unknown-7.d,
ld-tic6x/attr-unknown-71-a.s, ld-tic6x/attr-unknown-71-b.s: New
tests.
2010-11-05 Joseph Myers <joseph@codesourcery.com>
+ * elf32-tic6x.c (elf32_tic6x_obj_attrs_handle_unknown): New.
+ (elf32_tic6x_merge_attributes): Use
+ _bfd_elf_merge_unknown_attribute_low and
+ _bfd_elf_merge_unknown_attribute_list.
+ (elf_backend_obj_attrs_handle_unknown): Define.
+
+2010-11-05 Joseph Myers <joseph@codesourcery.com>
+
* elf-attrs.c (_bfd_elf_merge_unknown_attribute_low,
_bfd_elf_merge_unknown_attribute_list): Correct test for matching
string attributes.
return num;
}
+static bfd_boolean
+elf32_tic6x_obj_attrs_handle_unknown (bfd *abfd, int tag)
+{
+ if ((tag & 127) < 64)
+ {
+ _bfd_error_handler
+ (_("%B: error: unknown mandatory EABI object attribute %d"),
+ abfd, tag);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+ else
+ {
+ _bfd_error_handler
+ (_("%B: warning: unknown EABI object attribute %d"),
+ abfd, tag);
+ return TRUE;
+ }
+}
+
/* Merge the Tag_ISA attribute values ARCH1 and ARCH2
and return the merged value. At present, all merges succeed, so no
return value for errors is defined. */
out_attr[i].s = NULL;
break;
+ case Tag_ABI_compatibility:
+ /* Merged in _bfd_elf_merge_object_attributes. */
+ break;
+
default:
+ result
+ = result && _bfd_elf_merge_unknown_attribute_low (ibfd, obfd, i);
break;
}
if (!_bfd_elf_merge_object_attributes (ibfd, obfd))
return FALSE;
+ result &= _bfd_elf_merge_unknown_attribute_list (ibfd, obfd);
+
return result;
}
#define elf_backend_may_use_rel_p 1
#define elf_backend_may_use_rela_p 1
#define elf_backend_obj_attrs_arg_type elf32_tic6x_obj_attrs_arg_type
+#define elf_backend_obj_attrs_handle_unknown elf32_tic6x_obj_attrs_handle_unknown
#define elf_backend_obj_attrs_order elf32_tic6x_obj_attrs_order
#define elf_backend_obj_attrs_section ".c6xabi.attributes"
#define elf_backend_obj_attrs_section_type SHT_C6000_ATTRIBUTES
+2010-11-05 Joseph Myers <joseph@codesourcery.com>
+
+ * ld-tic6x/attr-unknown-1.d, ld-tic6x/attr-unknown-1000-1.s,
+ ld-tic6x/attr-unknown-1000-2.s, ld-tic6x/attr-unknown-1024-1.s,
+ ld-tic6x/attr-unknown-2.d, ld-tic6x/attr-unknown-3.d,
+ ld-tic6x/attr-unknown-4.d, ld-tic6x/attr-unknown-5.d,
+ ld-tic6x/attr-unknown-54-1.s, ld-tic6x/attr-unknown-55-a.s,
+ ld-tic6x/attr-unknown-6.d, ld-tic6x/attr-unknown-7.d,
+ ld-tic6x/attr-unknown-71-a.s, ld-tic6x/attr-unknown-71-b.s: New
+ tests.
+
2010-11-05 Dave Korn <dave.korn.cygwin@gmail.com>
* ld-plugin/plugin.exp (testobjfiles): Dont use HOSTING_CRT0.
--- /dev/null
+#name: C6X unknown attribute merging 1
+#as: -mlittle-endian
+#ld: -r -melf32_tic6x_le
+#source: attr-unknown-54-1.s
+#source: attr-unknown-54-1.s
+#error: .*error: unknown mandatory EABI object attribute 54
--- /dev/null
+.c6xabi_attribute 1000, 1
--- /dev/null
+.c6xabi_attribute 1000, 2
--- /dev/null
+.c6xabi_attribute 1024, 1
--- /dev/null
+#name: C6X unknown attribute merging 2
+#as: -mlittle-endian
+#ld: -r -melf32_tic6x_le
+#source: attr-unknown-55-a.s
+#source: attr-unknown-55-a.s
+#error: .*error: unknown mandatory EABI object attribute 55
--- /dev/null
+#name: C6X unknown attribute merging 3
+#as: -mlittle-endian
+#ld: -r -melf32_tic6x_le
+#source: attr-unknown-71-a.s
+#source: attr-unknown-71-a.s
+#warning: .*warning: unknown EABI object attribute 71
+#readelf: -A
+
+Attribute Section: c6xabi
+File Attributes
+ Tag_ISA: C674x
+ Tag_unknown_71: "a"
--- /dev/null
+#name: C6X unknown attribute merging 4
+#as: -mlittle-endian
+#ld: -r -melf32_tic6x_le
+#source: attr-unknown-71-a.s
+#source: attr-unknown-71-b.s
+#warning: .*warning: unknown EABI object attribute 71
+#readelf: -A
+
+Attribute Section: c6xabi
+File Attributes
+ Tag_ISA: C674x
--- /dev/null
+#name: C6X unknown attribute merging 5
+#as: -mlittle-endian
+#ld: -r -melf32_tic6x_le
+#source: attr-unknown-1000-1.s
+#source: attr-unknown-1000-1.s
+#warning: .*warning: unknown EABI object attribute 1000
+#readelf: -A
+
+Attribute Section: c6xabi
+File Attributes
+ Tag_ISA: C674x
+ Tag_unknown_1000: 1 \(0x1\)
--- /dev/null
+.c6xabi_attribute 54, 1
--- /dev/null
+.c6xabi_attribute 55, "a"
--- /dev/null
+#name: C6X unknown attribute merging 6
+#as: -mlittle-endian
+#ld: -r -melf32_tic6x_le
+#source: attr-unknown-1000-1.s
+#source: attr-unknown-1000-2.s
+#warning: .*warning: unknown EABI object attribute 1000
+#readelf: -A
+
+Attribute Section: c6xabi
+File Attributes
+ Tag_ISA: C674x
--- /dev/null
+#name: C6X unknown attribute merging 7
+#as: -mlittle-endian
+#ld: -r -melf32_tic6x_le
+#source: attr-unknown-1024-1.s
+#source: attr-unknown-1024-1.s
+#error: .*error: unknown mandatory EABI object attribute 1024
--- /dev/null
+.c6xabi_attribute 71, "a"
--- /dev/null
+.c6xabi_attribute 71, "b"