diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2001-06-18 18:57:06 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2001-06-18 18:57:06 +0000 |
commit | bc2b6df7ca0e0e1917694db8254b5d81359fd566 (patch) | |
tree | de6cd02052bba6898f8eb455b80a5c300cfd8355 | |
parent | 7f3b047364374db2dddbade072311052349202b3 (diff) | |
download | gdb-bc2b6df7ca0e0e1917694db8254b5d81359fd566.zip gdb-bc2b6df7ca0e0e1917694db8254b5d81359fd566.tar.gz gdb-bc2b6df7ca0e0e1917694db8254b5d81359fd566.tar.bz2 |
2001-06-18 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_info_failed): Add a new field, verdefs.
(NAME(bfd_elf,size_dynamic_sections): Pass verdefs to
elf_export_symbol.
(elf_export_symbol): Check eif->verdefs to decide if a symbol
should be exported.
-rw-r--r-- | bfd/ChangeLog | 8 | ||||
-rw-r--r-- | bfd/elflink.h | 36 |
2 files changed, 41 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 01a9dab..86f9844 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2001-06-18 H.J. Lu <hjl@gnu.org> + + * elflink.h (elf_info_failed): Add a new field, verdefs. + (NAME(bfd_elf,size_dynamic_sections): Pass verdefs to + elf_export_symbol. + (elf_export_symbol): Check eif->verdefs to decide if a symbol + should be exported. + 2001-06-17 H.J. Lu <hjl@gnu.org> * elf32-mips.c (mips_elf_link_hash_entry): Add a new field, diff --git a/bfd/elflink.h b/bfd/elflink.h index fca132d..21a5041 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -27,6 +27,7 @@ struct elf_info_failed { boolean failed; struct bfd_link_info *info; + struct bfd_elf_version_tree *verdefs; }; static boolean elf_link_add_object_symbols @@ -2967,6 +2968,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, } eif.info = info; + eif.verdefs = verdefs; eif.failed = false; /* If we are supposed to export all symbols into the dynamic symbol @@ -3705,11 +3707,39 @@ elf_export_symbol (h, data) && (h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_REGULAR | ELF_LINK_HASH_REF_REGULAR)) != 0) { - if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h)) + struct bfd_elf_version_tree *t; + struct bfd_elf_version_expr *d; + + for (t = eif->verdefs; t != NULL; t = t->next) { - eif->failed = true; - return false; + if (t->globals != NULL) + { + for (d = t->globals; d != NULL; d = d->next) + { + if ((*d->match) (d, h->root.root.string)) + goto doit; + } + } + + if (t->locals != NULL) + { + for (d = t->locals ; d != NULL; d = d->next) + { + if ((*d->match) (d, h->root.root.string)) + return true; + } + } } + + if (!eif->verdefs) + { +doit: + if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h)) + { + eif->failed = true; + return false; + } + } } return true; |