From 5488d830ec018f8528fe806eeeaa39ce5ff7ffb1 Mon Sep 17 00:00:00 2001 From: Matthew Gretton-Dann Date: Tue, 2 Mar 2010 11:40:24 +0000 Subject: [PATCH] * ld/testsuite/ld-arm/arm-merge-incompatible.d: New test. * ld/testsuite/ld-arm/arm-merge-incompatiblea.s: Likewise. * ld/testsuite/ld-arm/arm-merge-incompatibleb.s: Likewise. * ld/testsuite/ld-arm/arm-elf.exp: Run the new test. * bfd/elf32-arm.c (elf32_arm_merge_eabi_attributes): Add a check of the return value from the call to _bfd_elf_merge_object_attributes. --- bfd/ChangeLog | 5 +++++ bfd/elf32-arm.c | 3 ++- ld/testsuite/ChangeLog | 7 +++++++ ld/testsuite/ld-arm/arm-elf.exp | 1 + ld/testsuite/ld-arm/attr-merge-incompatible.d | 5 +++++ ld/testsuite/ld-arm/attr-merge-incompatiblea.s | 1 + ld/testsuite/ld-arm/attr-merge-incompatibleb.s | 1 + 7 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 ld/testsuite/ld-arm/attr-merge-incompatible.d create mode 100644 ld/testsuite/ld-arm/attr-merge-incompatiblea.s create mode 100644 ld/testsuite/ld-arm/attr-merge-incompatibleb.s diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1c080543697..d1ce00c365d 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2010-03-02 Matthew Gretton-Dann + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Add a check of the + return value from the call to _bfd_elf_merge_object_attributes. + 2010-03-02 Christophe Lyon Alan Modra diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index fd4031568d5..29fb29580f3 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -10340,7 +10340,8 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) } /* Merge Tag_compatibility attributes and any common GNU ones. */ - _bfd_elf_merge_object_attributes (ibfd, obfd); + if (!_bfd_elf_merge_object_attributes (ibfd, obfd)) + return FALSE; /* Check for any attributes not known on ARM. */ in_list = elf_other_obj_attributes_proc (ibfd); diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 165261115cf..3ceacd48d0c 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2010-03-02 Matthew Gretton-Dann + + * ld-arm/arm-merge-incompatible.d: New test. + * ld-arm/arm-merge-incompatiblea.s: Likewise. + * ld-arm/arm-merge-incompatibleb.s: Likewise. + * ld-arm/arm-elf.exp: Run the new test. + 2010-03-02 Christophe Lyon Alan Modra diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp index 87ea1875139..26552b9a053 100644 --- a/ld/testsuite/ld-arm/arm-elf.exp +++ b/ld/testsuite/ld-arm/arm-elf.exp @@ -510,3 +510,4 @@ run_dump_test "attr-merge-vfp-4" run_dump_test "attr-merge-vfp-4r" run_dump_test "attr-merge-vfp-5" run_dump_test "attr-merge-vfp-5r" +run_dump_test "attr-merge-incompatible" diff --git a/ld/testsuite/ld-arm/attr-merge-incompatible.d b/ld/testsuite/ld-arm/attr-merge-incompatible.d new file mode 100644 index 00000000000..41711da8e03 --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-incompatible.d @@ -0,0 +1,5 @@ +#source: attr-merge-incompatibleb.s +#source: attr-merge-incompatiblea.s +#as: +#ld: +#error: Object has vendor-specific contents that must be processed by the '.+' toolchain diff --git a/ld/testsuite/ld-arm/attr-merge-incompatiblea.s b/ld/testsuite/ld-arm/attr-merge-incompatiblea.s new file mode 100644 index 00000000000..03e0f7e95a6 --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-incompatiblea.s @@ -0,0 +1 @@ + .eabi_attribute Tag_compatibility, 1, "Random Toolchain Vendor" diff --git a/ld/testsuite/ld-arm/attr-merge-incompatibleb.s b/ld/testsuite/ld-arm/attr-merge-incompatibleb.s new file mode 100644 index 00000000000..583d2537c0f --- /dev/null +++ b/ld/testsuite/ld-arm/attr-merge-incompatibleb.s @@ -0,0 +1 @@ + .eabi_attribute Tag_compatibility, 1, "gnu" -- 2.30.2