Make the linker return an error status if it fails to merge ARM binaries with
authorTerry Guo <terry.guo@arm.com>
Tue, 16 Sep 2014 12:08:22 +0000 (13:08 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 16 Sep 2014 12:08:22 +0000 (13:08 +0100)
commit70e99720f9d558263756a482ae750b263ffd92ba
tree893354caf187ada3cfa61d98392b320a99d324ea
parent428b16bd5a3947e3a608f0c6751a8be7dbd88959
Make the linker return an error status if it fails to merge ARM binaries with
different architecture tags.  Add a test case to make sure that this works,
and update readelf so that it will not seg-fault when trying to display the
attributes of binaries with invalid architecture tags.

* elf32-arm.c (elf32_arm_merge_eabi_attributes): Return false if
failed to merge.

* ld-arm/attr-merge-arch-2.d: New test case.
* ld-arm/attr-merge-arch-2a.s: New test case source file.
* ld-arm/attr-merge-arch-2b.s: Likewise.
* ld-arm/arm-elf.exp: Run new test case.

* readelf.c (display_arm_attribute): Use unsigned int type for
tag, val and type variables.
bfd/ChangeLog
bfd/elf32-arm.c
binutils/ChangeLog
binutils/readelf.c
ld/testsuite/ChangeLog
ld/testsuite/ld-arm/arm-elf.exp
ld/testsuite/ld-arm/attr-merge-arch-2.d [new file with mode: 0644]
ld/testsuite/ld-arm/attr-merge-arch-2a.s [new file with mode: 0644]
ld/testsuite/ld-arm/attr-merge-arch-2b.s [new file with mode: 0644]