From a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 1 May 2020 15:23:17 +0930 Subject: PR25882, .gnu.attributes are not checked for shared libraries This allows backend merge_private_bfd_data to examine shared library e_flags and/or .gnu.attributes. ARM and PowerPC have done so when using ld.gold for a long time. (The tic6x change below is dead code due to the earlier FIXME, but this is probably one of the changes needed there.) PR 25882 bfd/ * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output. ld/ * ldlang.c (lang_check): Call bfd_merge_private_bfd_data for shared libraries. --- bfd/elf32-tic6x.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bfd/elf32-tic6x.c') diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c index d07902f..20e4324 100644 --- a/bfd/elf32-tic6x.c +++ b/bfd/elf32-tic6x.c @@ -3866,6 +3866,9 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info) case Tag_ABI_PIC: case Tag_ABI_PID: + /* Don't transfer these tags from dynamic objects. */ + if ((ibfd->flags & DYNAMIC) != 0) + continue; if (out_attr[i].i > in_attr[i].i) out_attr[i].i = in_attr[i].i; break; -- cgit v1.1