aboutsummaryrefslogtreecommitdiff
path: root/gold/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gold/testsuite')
-rw-r--r--gold/testsuite/ver_matching_def.cc4
-rwxr-xr-xgold/testsuite/ver_matching_test.sh6
-rw-r--r--gold/testsuite/version_script.map7
3 files changed, 16 insertions, 1 deletions
diff --git a/gold/testsuite/ver_matching_def.cc b/gold/testsuite/ver_matching_def.cc
index 71d8d32..2eba163 100644
--- a/gold/testsuite/ver_matching_def.cc
+++ b/gold/testsuite/ver_matching_def.cc
@@ -28,6 +28,10 @@ void foo1() {} // local
void bar() {} // V1
void bar1() {} // global
+void baz(int*) {} // V1
+void baz(int*, char) {} // global
+void baz(char*, int) {} // global
+
extern "C" {
void bar2() {} // V1
};
diff --git a/gold/testsuite/ver_matching_test.sh b/gold/testsuite/ver_matching_test.sh
index 48dd9a5..2ecdd98 100755
--- a/gold/testsuite/ver_matching_test.sh
+++ b/gold/testsuite/ver_matching_test.sh
@@ -73,6 +73,12 @@ check ver_matching_test.stdout "Base *bla$"
check ver_matching_test.stdout "V2 *blaz$"
check ver_matching_test.stdout "V2 *blazb$"
+# Stuff inside quotes is matched literally, so "baz(int*, char)" should
+# not match the "baz(int *)" entry in the version table.
+check ver_matching_test.stdout "V1 *baz(int\\*)$"
+check_missing ver_matching_test.stdout "V1 *baz(int\\*, char)$"
+check_missing ver_matching_test.stdout "V1 *baz(char\\*, int)$"
+
# TODO: foo1 should be a local symbol and not show up in the .dynsym
# dump, but we haven't figured out how to suppress it yet.
# check_missing ver_matching_test.stdout "foo1"
diff --git a/gold/testsuite/version_script.map b/gold/testsuite/version_script.map
index 2a17523..c7662af 100644
--- a/gold/testsuite/version_script.map
+++ b/gold/testsuite/version_script.map
@@ -3,11 +3,16 @@ V1 {
extern "C++"
{
"bar()";
- myns::*;
+ "baz(int*)";
};
foo;
blaza*;
bar*;
+ # Make sure we parse "extern" when it's not first thing in the section.
+ extern "C++"
+ {
+ myns::*;
+ };
# Would be a keyword in a linker script.
SECTIONS;
sizeof_headers;