aboutsummaryrefslogtreecommitdiff
path: root/gold/testsuite
diff options
context:
space:
mode:
authorCraig Silverstein <csilvers@google.com>2008-11-06 07:23:31 +0000
committerCraig Silverstein <csilvers@google.com>2008-11-06 07:23:31 +0000
commitc82fbeee5970971ab2988ab7fda3439719df09ab (patch)
treee3d01b8663155d445595c3a0a9e410e4d82bc3d2 /gold/testsuite
parente0bb29a5842200725829ebdb21dfa1f3c692b223 (diff)
downloadgdb-c82fbeee5970971ab2988ab7fda3439719df09ab.zip
gdb-c82fbeee5970971ab2988ab7fda3439719df09ab.tar.gz
gdb-c82fbeee5970971ab2988ab7fda3439719df09ab.tar.bz2
* options.cc (General_options::parse_dynamic_list): New function.
* options.h (General_options): New flags dynamic_list, dynamic_list_data, dynamic_list_cpp_new, and dynamic_list_cpp_typeinfo. New variable dynamic_list_. (General_options::in_dynamic_list): New function. * script.cc (Lex::Mode): New enum DYNAMIC_LIST. (Lex::can_start_name): Add support for DYNAMIC_LIST mode. (Lex::can_continue_name): Likewise. (yylex): Likewise. (read_script_file): New parameter script_options. (read_dynamic_list): New function. (Script_options::define_dynamic_list): New function. (dynamic_list_keyword_parsecodes): New variable. (dynamic_list_keywords): New variable. * script.h (Script_options::define_dynamic_list): New function prototype. (read_dynamic_list): New function prototype. * symtab.cc (strprefix): New macro. (Symbol::should_add_dynsym_entry): Support dynamic_list, dynamic_list_data, dynamic_list_cpp_new, and dynamic_list_cpp_typeinfo. * yyscript.y (PARSING_DYNAMIC_LIST): New token. (dynamic_list_expr): New rule. (dynamic_list_nodes): Likewise. (dynamic_list_node): Likewise. * testsuite/Makefile.am (dynamic_list): New test. * testsuite/Makefile.in: Regenerated. * testsuite/dynamic_list.t: New file. * testsuite/dynamic_list.sh: New file.
Diffstat (limited to 'gold/testsuite')
-rw-r--r--gold/testsuite/Makefile.am15
-rw-r--r--gold/testsuite/Makefile.in23
-rwxr-xr-xgold/testsuite/dynamic_list.sh50
-rw-r--r--gold/testsuite/dynamic_list.t11
4 files changed, 94 insertions, 5 deletions
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
index 57d96cd..dcb8bad 100644
--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -903,6 +903,21 @@ script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t
script_test_4.stdout: script_test_4
$(TEST_READELF) -SlW script_test_4 > script_test_4.stdout
+# Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new,
+# and --dynamic-list-cpp-typeinfo
+
+check_SCRIPTS += dynamic_list.sh
+check_DATA += dynamic_list.stdout
+MOSTLYCLEANFILES += dynamic_list.stdout
+dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t
+ $(CXXLINK) -Bgcctestdir/ basic_test.o \
+ -Wl,--dynamic-list $(srcdir)/dynamic_list.t \
+ -Wl,--dynamic-list-data \
+ -Wl,--dynamic-list-cpp-new \
+ -Wl,--dynamic-list-cpp-typeinfo
+dynamic_list.stdout: dynamic_list
+ $(TEST_READELF) -DWs dynamic_list > dynamic_list.stdout
+
check_PROGRAMS += thin_archive_test_1
thin_archive_test_1_SOURCES = thin_archive_main.cc
thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a
diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in
index 54b2364..7271bb0 100644
--- a/gold/testsuite/Makefile.in
+++ b/gold/testsuite/Makefile.in
@@ -162,13 +162,16 @@ check_PROGRAMS = object_unittest$(EXEEXT) binary_unittest$(EXEEXT) \
# Test --detect-odr-violations
# Similar to --detect-odr-violations: check for undefined symbols in .so's
+
+# Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new,
+# and --dynamic-list-cpp-typeinfo
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_6 = weak_plt.sh debug_msg.sh \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ undef_symbol.sh ver_test_2.sh \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_4.sh ver_test_5.sh \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_7.sh ver_test_10.sh \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_matching_test.sh \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_3.sh \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_4.sh
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_4.sh dynamic_list.sh
# Create the data files that debug_msg.sh analyzes.
@@ -184,7 +187,8 @@ check_PROGRAMS = object_unittest$(EXEEXT) binary_unittest$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_7.syms ver_test_10.syms \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_matching_test.stdout \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_3.stdout \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_4.stdout
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_4.stdout \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ dynamic_list.stdout
@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am__append_8 = tls_test \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_pic_test \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_shared_test \
@@ -229,7 +233,8 @@ check_PROGRAMS = object_unittest$(EXEEXT) binary_unittest$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ undef_symbol.err \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_matching_test.stdout \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_3.stdout \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_4.stdout
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_4.stdout \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ dynamic_list.stdout
# Test -o when emitting to a special file (such as something in /dev).
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_17 = flagstest_o_specialfile
@@ -1458,9 +1463,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign testsuite/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu testsuite/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign testsuite/Makefile
+ $(AUTOMAKE) --gnu testsuite/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -2418,6 +2423,14 @@ uninstall-am: uninstall-info-am
@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_4.t
@GCC_TRUE@@NATIVE_LINKER_TRUE@script_test_4.stdout: script_test_4
@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout
+@GCC_TRUE@@NATIVE_LINKER_TRUE@dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ basic_test.o \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ -Wl,--dynamic-list $(srcdir)/dynamic_list.t \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ -Wl,--dynamic-list-data \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ -Wl,--dynamic-list-cpp-new \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ -Wl,--dynamic-list-cpp-typeinfo
+@GCC_TRUE@@NATIVE_LINKER_TRUE@dynamic_list.stdout: dynamic_list
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -DWs dynamic_list > dynamic_list.stdout
@GCC_TRUE@@NATIVE_LINKER_TRUE@libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o
@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f $@
diff --git a/gold/testsuite/dynamic_list.sh b/gold/testsuite/dynamic_list.sh
new file mode 100755
index 0000000..dfd9f0f
--- /dev/null
+++ b/gold/testsuite/dynamic_list.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# dynamic_list.sh -- test --dynamic-list and --dynamic-list-*
+
+# Copyright 2008 Free Software Foundation, Inc.
+# Written by Ian Lance Taylor <iant@google.com>.
+
+# This file is part of gold.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+# This file goes with dynamic_list.t, which is a dynamic-list script.
+
+check()
+{
+ if ! grep -qw "$2" "$1"
+ then
+ echo "Did not find expected text in $1:"
+ echo " $2"
+ echo ""
+ echo "Actual output below:"
+ cat "$1"
+ exit 1
+ fi
+}
+
+check dynamic_list.stdout "main" # comes via --dynamic-list
+check dynamic_list.stdout "_ZdlPv" # "operator delete(void*)"
+check dynamic_list.stdout "_Z4t1_6v" # t1_6()
+check dynamic_list.stdout "_ZN4t16aC2Ev" # t16a:t16a()
+check dynamic_list.stdout "_ZN4t16aD1Ev" # t16a:~t16a()
+check dynamic_list.stdout "_ZN4t16a1tEv" # t16a:t()
+check dynamic_list.stdout "_ZTI4t16a" # typeinfo for t16a
+check dynamic_list.stdout "_ZTI4t16b" # typeinfo for t16b
+check dynamic_list.stdout "_ZTS4t16a" # typeinfo name for t16a
+check dynamic_list.stdout "_ZTS4t16b" # typeinfo name for t16b
+check dynamic_list.stdout "t20v" # comes via --dynamic-list-data
diff --git a/gold/testsuite/dynamic_list.t b/gold/testsuite/dynamic_list.t
new file mode 100644
index 0000000..6457173
--- /dev/null
+++ b/gold/testsuite/dynamic_list.t
@@ -0,0 +1,11 @@
+{
+ main;
+ not_a_symbol;
+ global;
+ extern "C++" { t1_6* };
+};
+{
+ extern "C++" { t16a* };
+ local;
+ extern;
+};