diff options
author | Ian Lance Taylor <ian@airs.com> | 2008-07-18 07:03:27 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2008-07-18 07:03:27 +0000 |
commit | a18f591e924ea296bbf8f7fbdff40cbb07e98b21 (patch) | |
tree | dfe2cb1fa941e891d819cb07d57859093fde7159 /gold/testsuite | |
parent | c6e3f6ed8e0a050b7b49c1a82102eae736f595fd (diff) | |
download | gdb-a18f591e924ea296bbf8f7fbdff40cbb07e98b21.zip gdb-a18f591e924ea296bbf8f7fbdff40cbb07e98b21.tar.gz gdb-a18f591e924ea296bbf8f7fbdff40cbb07e98b21.tar.bz2 |
* symtab.cc (Symbol_table::add_from_object): Rewrite the case
where we see NAME/NULL and NAME/VERSION as separate symbols.
* testsuite/ver_test_main.cc (main): Call t4.
(t4, t4_2a): Define.
* testsuite/ver_test_2.cc (t4_2): Define.
* testsuite/ver_test_2.script: Put t4_2a in VER2.
* testsuite/ver_test_4.cc (t4_2a): Define.
* testsuite/ver_test_4.script: Put t4_2a in VER2.
* testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
Diffstat (limited to 'gold/testsuite')
-rw-r--r-- | gold/testsuite/ver_test.h | 3 | ||||
-rw-r--r-- | gold/testsuite/ver_test_2.cc | 10 | ||||
-rw-r--r-- | gold/testsuite/ver_test_2.script | 2 | ||||
-rw-r--r-- | gold/testsuite/ver_test_4.cc | 11 | ||||
-rw-r--r-- | gold/testsuite/ver_test_4.script | 1 | ||||
-rw-r--r-- | gold/testsuite/ver_test_main.cc | 20 |
6 files changed, 46 insertions, 1 deletions
diff --git a/gold/testsuite/ver_test.h b/gold/testsuite/ver_test.h index 48dbf41..0b1aea8 100644 --- a/gold/testsuite/ver_test.h +++ b/gold/testsuite/ver_test.h @@ -30,11 +30,14 @@ extern bool t1(); extern bool t2(); extern bool t3(); +extern bool t4(); extern "C" { extern int t1_2(); extern int t2_2(); extern int t3_2(); +extern int t4_2(); +extern int t4_2a(); } diff --git a/gold/testsuite/ver_test_2.cc b/gold/testsuite/ver_test_2.cc index 1c69264..b81e62e 100644 --- a/gold/testsuite/ver_test_2.cc +++ b/gold/testsuite/ver_test_2.cc @@ -28,3 +28,13 @@ t3_2() TRACE return t1_2(); } + +// Calls a versioned function in ver_test_4.cc which should be +// overridden by an unversioned function in the main program. + +int +t4_2() +{ + TRACE + return t4_2a(); +} diff --git a/gold/testsuite/ver_test_2.script b/gold/testsuite/ver_test_2.script index d1f8314..15329d7 100644 --- a/gold/testsuite/ver_test_2.script +++ b/gold/testsuite/ver_test_2.script @@ -27,5 +27,5 @@ VER2 { global: t1_2; t3_2; + t4_2a; } VER1; - diff --git a/gold/testsuite/ver_test_4.cc b/gold/testsuite/ver_test_4.cc index 38da421..404dfbc 100644 --- a/gold/testsuite/ver_test_4.cc +++ b/gold/testsuite/ver_test_4.cc @@ -51,3 +51,14 @@ t2_2_b() TRACE return 22; } + + +// This function is given a version by the version script, and should +// be overridden by the main program. + +int +t4_2a() +{ + TRACE + return -42; +} diff --git a/gold/testsuite/ver_test_4.script b/gold/testsuite/ver_test_4.script index ebcf1e9..9f7d350 100644 --- a/gold/testsuite/ver_test_4.script +++ b/gold/testsuite/ver_test_4.script @@ -31,5 +31,6 @@ VER2 { global: t1_2; t2_2; + t4_2a; } VER1; diff --git a/gold/testsuite/ver_test_main.cc b/gold/testsuite/ver_test_main.cc index 10649f2..f8a7b75 100644 --- a/gold/testsuite/ver_test_main.cc +++ b/gold/testsuite/ver_test_main.cc @@ -30,6 +30,7 @@ main() assert(t1()); assert(t2()); assert(t3()); + assert(t4()); return 0; } @@ -52,3 +53,22 @@ t3() TRACE return t3_2() == 12; } + +// Call a function in a shared library that calls a function which is +// defined in the main program and defined with a default version in +// the shared library. The symbol in the main program should override +// even though it doesn't have a version. + +bool +t4() +{ + TRACE + return t4_2() == 42; +} + +int +t4_2a() +{ + TRACE + return 42; +} |