aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-07-03 14:50:38 +0930
committerAlan Modra <amodra@gmail.com>2018-07-03 16:46:54 +0930
commit8d2c8c3d17926826864f4b739362f66af547428f (patch)
tree1878b3e0bc092c6c79bff4516878e1905efb45b4 /bfd/elf64-ppc.c
parentaf0bfb9c4283ce80fe37ad6360d12cae8ec38696 (diff)
downloadgdb-8d2c8c3d17926826864f4b739362f66af547428f.zip
gdb-8d2c8c3d17926826864f4b739362f66af547428f.tar.gz
gdb-8d2c8c3d17926826864f4b739362f66af547428f.tar.bz2
GNU attribute output on errors
.gnu.attributes entries from linker input files are merged to the output file, the output having the union of compatible input attributes. Incompatible attributes generally cause a linker error and no output. However in some cases only a warning is emitted, and one of the incompatible input attributes is passed on to the output. PowerPC tends to emit warnings rather than errors, and the output takes the first input attribute. For example, if we have two input files with Tag_GNU_Power_ABI_FP, the first with a value signifying "double-precision hard float, IBM long double", the second with a value signifying "double-precision hard float, IEEE long double", we'll get a warning about incompatible long double types and the output will say "double-precision hard float, IBM long double". The output attribute of course isn't correct. It would be correct to specify "IBM and IEEE long double", but we don't have a way to represent that currently. While it would be possible to extend the encoding, there isn't much gain in doing so. A shared library providing support for both long double types should link against objects using either long double type without warning or error. That is what you'd get if such a shared library had no Tag_GNU_Power_ABI_FP attribute. So this patch provides a way for the backend to omit .gnu.attributes tags from the output. * elf-bfd.h (ATTR_TYPE_FLAG_ERROR, ATTR_TYPE_HAS_ERROR): Define. * elf-attrs.c (is_default_attr): Handle ATTR_TYPE_HAS_ERROR. * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Use ATTR_TYPE_FLAG_INT_VAL. Set ATTR_TYPE_HAS_ERROR on finding incompatible attribute. (ppc_elf_merge_obj_attributes): Likewise. Return _bfd_elf_merge_object_attributes result. * elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Return _bfd_elf_merge_object_attributes result.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 16199fb..894a3b7 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -6180,9 +6180,7 @@ ppc64_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
_bfd_elf_ppc_merge_fp_attributes (ibfd, info);
/* Merge Tag_compatibility attributes and any common GNU ones. */
- _bfd_elf_merge_object_attributes (ibfd, info);
-
- return TRUE;
+ return _bfd_elf_merge_object_attributes (ibfd, info);
}
static bfd_boolean