diff options
author | Alan Modra <amodra@gmail.com> | 2014-11-27 15:16:49 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-11-30 13:40:11 +1030 |
commit | bdaf8f8eb88bfbd434a016bbdc9869d7d5d29a82 (patch) | |
tree | a3f755f3051563c51d57e4f16aa3a2f7062b9b48 /bfd | |
parent | 012d8ebc4bd1a1afb95d902604007b04762207f0 (diff) | |
download | binutils-bdaf8f8eb88bfbd434a016bbdc9869d7d5d29a82.tar.gz binutils-bdaf8f8eb88bfbd434a016bbdc9869d7d5d29a82.tar.bz2 binutils-bdaf8f8eb88bfbd434a016bbdc9869d7d5d29a82.zip |
Don't output symbol version definitions for non-DT_NEEDED libs
PR 16452, 16457
* elflink.c (_bfd_elf_link_find_version_dependencies): Exclude
symbols from libraries that won't be listed in DT_NEEDED.
(elf_link_output_extsym): Don't output verdefs for such symbols.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elflink.c | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f0edb69e1e9..c35c5227f00 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2014-11-30 Alan Modra <amodra@gmail.com> + + PR 16452, 16457 + * elflink.c (_bfd_elf_link_find_version_dependencies): Exclude + symbols from libraries that won't be listed in DT_NEEDED. + (elf_link_output_extsym): Don't output verdefs for such symbols. + 2014-11-24 Tejas Belagod <tejas.belagod@arm.com> * elfnn-aarch64.c (elf_aarch64_compare_mapping): New. diff --git a/bfd/elflink.c b/bfd/elflink.c index c8068c0118c..c964a98021c 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -1832,7 +1832,9 @@ _bfd_elf_link_find_version_dependencies (struct elf_link_hash_entry *h, if (!h->def_dynamic || h->def_regular || h->dynindx == -1 - || h->verinfo.verdef == NULL) + || h->verinfo.verdef == NULL + || (elf_dyn_lib_class (h->verinfo.verdef->vd_bfd) + & (DYN_AS_NEEDED | DYN_DT_NEEDED | DYN_NO_NEEDED))) return TRUE; /* See if we already know about this version. */ @@ -9050,7 +9052,9 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data) if (!h->def_regular) { - if (h->verinfo.verdef == NULL) + if (h->verinfo.verdef == NULL + || (elf_dyn_lib_class (h->verinfo.verdef->vd_bfd) + & (DYN_AS_NEEDED | DYN_DT_NEEDED | DYN_NO_NEEDED))) iversym.vs_vers = 0; else iversym.vs_vers = h->verinfo.verdef->vd_exp_refno + 1; |