diff options
author | Alan Modra <amodra@gmail.com> | 2020-05-01 15:23:17 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-05-01 15:32:36 +0930 |
commit | a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba (patch) | |
tree | dc423444c9904c1b3b24565174b690cff8e7486e | |
parent | 6b728d3286a6e073e8cbdb63600e421de4f32dad (diff) | |
download | gdb-a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.zip gdb-a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.tar.gz gdb-a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.tar.bz2 |
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.
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf32-tic6x.c | 3 | ||||
-rw-r--r-- | ld/ChangeLog | 6 | ||||
-rw-r--r-- | ld/ldlang.c | 9 |
4 files changed, 20 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index fc1aca2..15c77be 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,6 +1,12 @@ 2020-05-01 Alan Modra <amodra@gmail.com> PR 25882 + * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer + Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output. + +2020-05-01 Alan Modra <amodra@gmail.com> + + PR 25882 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME. * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise. * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise. 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; diff --git a/ld/ChangeLog b/ld/ChangeLog index d185af4..323a956 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,11 @@ 2020-05-01 Alan Modra <amodra@gmail.com> + PR 25882 + * ldlang.c (lang_check): Call bfd_merge_private_bfd_data for + shared libraries. + +2020-05-01 Alan Modra <amodra@gmail.com> + * po/BLD-POTFILES.in: Regenerate. 2020-04-30 Alex Coplan <alex.coplan@arm.com> diff --git a/ld/ldlang.c b/ld/ldlang.c index 2ef234f..b2cdb36 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -6938,11 +6938,12 @@ lang_check (void) bfd_printable_name (input_bfd), input_bfd, bfd_printable_name (link_info.output_bfd)); } - else if (bfd_count_sections (input_bfd)) - { - /* If the input bfd has no contents, it shouldn't set the - private data of the output bfd. */ + /* If the input bfd has no contents, it shouldn't set the + private data of the output bfd. */ + else if ((input_bfd->flags & DYNAMIC) != 0 + || bfd_count_sections (input_bfd) != 0) + { bfd_error_handler_type pfn = NULL; /* If we aren't supposed to warn about mismatched input |