aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2007-01-16 14:56:32 +0000
committerH.J. Lu <hjl.tools@gmail.com>2007-01-16 14:56:32 +0000
commit40b36307e31ea3e3606a1698f35d0b9769405615 (patch)
tree2cb0fb15024ffb5549aaaf04d9cf2ada1d738d3a /ld/ldlang.c
parentb20d8971adc2a4b07c6d777716948da8e902c379 (diff)
downloadgdb-40b36307e31ea3e3606a1698f35d0b9769405615.zip
gdb-40b36307e31ea3e3606a1698f35d0b9769405615.tar.gz
gdb-40b36307e31ea3e3606a1698f35d0b9769405615.tar.bz2
bfd/
2007-01-16 H.J. Lu <hongjiu.lu@intel.com> PR ld/3831 * elf-bfd.h (bfd_elf_link_mark_dynamic_symbol): Add an argument, Elf_Internal_Sym *. * elflink.c (bfd_elf_link_mark_dynamic_symbol): Mark a data symbol dynamic if info->dynamic_data is TRUE. (bfd_elf_record_link_assignment): Updated call to bfd_elf_record_link_assignment. (_bfd_elf_merge_symbol): Likewise. Always call bfd_elf_link_mark_dynamic_symbol. include/ 2007-01-16 H.J. Lu <hongjiu.lu@intel.com> PR ld/3831 * bfdlink.h (bfd_link_info): Rename dynamic to dynamic_list. Add dynamic and dynamic_data. ld/ 2007-01-16 H.J. Lu <hongjiu.lu@intel.com> PR ld/3831 * NEWS: Mention -Bsymbolic-functions, --dynamic-list-data and --dynamic-list-cpp-new. * ld.texinfo: Document -Bsymbolic-functions, --dynamic-list-data and --dynamic-list-cpp-new. * ldlang.c (lang_append_dynamic_list_cpp_new): New. (lang_process): Change link_info.dynamic to link_info.dynamic_list. (lang_append_dynamic_list): Likewise. * ldmain.c (main): Likewise. Initialize link_info.dynamic and link_info.dynamic_data to FALSE. * ldlang.h (lang_append_dynamic_list_cpp_new): New. * lexsup.c (option_values): Add OPTION_DYNAMIC_LIST_DATA and OPTION_DYNAMIC_LIST_CPP_NEW. (ld_options): Add entries for -Bsymbolic-functions, --dynamic-list-data and --dynamic-list-cpp-new. Make -Bsymbolic-functions an alias of --dynamic-list-data. (parse_args): Change link_info.dynamic to link_info.dynamic_list. Set link_info.dynamic to TRUE for --dynamic-list and --dynamic-list-cpp-typeinfo. Handle --dynamic-list-data and --dynamic-list-cpp-new. ld/testsuite/ 2007-01-16 H.J. Lu <hongjiu.lu@intel.com> PR ld/3831 * ld-elf/del.cc: New. * ld-elf/dl5.cc: Likewise. * ld-elf/dl5.out: Likewise. * ld-elf/new.cc: Likewise. * ld-elf/shared.exp: Add tests for --dynamic-list-data and --dynamic-list-cpp-new.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 5c5cb35..030887d 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -5634,8 +5634,8 @@ void
lang_process (void)
{
/* Finalize dynamic list. */
- if (link_info.dynamic)
- lang_finalize_version_expr_head (&link_info.dynamic->head);
+ if (link_info.dynamic_list)
+ lang_finalize_version_expr_head (&link_info.dynamic_list->head);
current_target = default_target;
@@ -6945,13 +6945,13 @@ lang_add_unique (const char *name)
void
lang_append_dynamic_list (struct bfd_elf_version_expr *dynamic)
{
- if (link_info.dynamic)
+ if (link_info.dynamic_list)
{
struct bfd_elf_version_expr *tail;
for (tail = dynamic; tail->next != NULL; tail = tail->next)
;
- tail->next = link_info.dynamic->head.list;
- link_info.dynamic->head.list = dynamic;
+ tail->next = link_info.dynamic_list->head.list;
+ link_info.dynamic_list->head.list = dynamic;
}
else
{
@@ -6960,7 +6960,7 @@ lang_append_dynamic_list (struct bfd_elf_version_expr *dynamic)
d = xcalloc (1, sizeof *d);
d->head.list = dynamic;
d->match = lang_vers_match;
- link_info.dynamic = d;
+ link_info.dynamic_list = d;
}
}
@@ -6984,3 +6984,24 @@ lang_append_dynamic_list_cpp_typeinfo (void)
lang_append_dynamic_list (dynamic);
}
+
+/* Append the list of C++ operator new and delete dynamic symbols to the
+ existing one. */
+
+void
+lang_append_dynamic_list_cpp_new (void)
+{
+ const char * symbols [] =
+ {
+ "operator new*",
+ "operator delete*"
+ };
+ struct bfd_elf_version_expr *dynamic = NULL;
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE (symbols); i++)
+ dynamic = lang_new_vers_pattern (dynamic, symbols [i], "C++",
+ FALSE);
+
+ lang_append_dynamic_list (dynamic);
+}