diff options
author | Ian Lance Taylor <ian@airs.com> | 1999-07-07 15:36:29 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1999-07-07 15:36:29 +0000 |
commit | f04894943e847e4c9dec6a7a73b9e03a3c0aa90a (patch) | |
tree | 8a3bed9724537bc7269568613437e857a4734295 /ld/testsuite | |
parent | b4536acd1f4486d65cedf50e2d8f64227869acbc (diff) | |
download | gdb-f04894943e847e4c9dec6a7a73b9e03a3c0aa90a.zip gdb-f04894943e847e4c9dec6a7a73b9e03a3c0aa90a.tar.gz gdb-f04894943e847e4c9dec6a7a73b9e03a3c0aa90a.tar.bz2 |
* ld-elfvers/vers.exp: Add new tests vers17 to vers19.
* ld/elfvers/{vers17.*, vers18.*, vers19.*}: New files.
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-elfvers/vers.exp | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-elfvers/vers17.c | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-elfvers/vers17.dsym | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-elfvers/vers17.map | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-elfvers/vers17.ver | 3 | ||||
-rw-r--r-- | ld/testsuite/ld-elfvers/vers18.c | 42 | ||||
-rw-r--r-- | ld/testsuite/ld-elfvers/vers18.dsym | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-elfvers/vers18.map | 15 | ||||
-rw-r--r-- | ld/testsuite/ld-elfvers/vers18.sym | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-elfvers/vers18.ver | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-elfvers/vers19.c | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elfvers/vers19.dsym | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-elfvers/vers19.ver | 3 |
14 files changed, 114 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 3581965..c7e255b 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +1999-07-07 Ian Lance Taylor <ian@zembu.com> + + * ld-elfvers/vers.exp: Add new tests vers17 to vers19. + * ld/elfvers/{vers17.*, vers18.*, vers19.*}: New files. + 1999-06-13 Ian Lance Taylor <ian@zembu.com> * ld-checks/asm.s: Use a symbol name for .lcomm. diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp index 5dfaa93..6a02d69 100644 --- a/ld/testsuite/ld-elfvers/vers.exp +++ b/ld/testsuite/ld-elfvers/vers.exp @@ -806,3 +806,8 @@ build_exec "vers15" vers15.c vers15 "" vers1.so vers15.ver vers15.dsym vers15.sy # build_vers_lib "vers16a" vers16a.c vers16a "" vers16.map vers16a.ver vers16a.dsym "" build_exec "vers16" vers16.c vers16 "" vers16a.so "" vers16.dsym "" + +# Test a weak versioned symbol. +build_vers_lib "vers17" vers17.c vers17 "" vers17.map vers17.ver vers17.dsym "" +build_vers_lib "vers18" vers18.c vers18 vers17.so vers18.map vers18.ver vers18.dsym vers18.sym +build_exec "vers19" vers19.c vers19 "" vers18.so vers19.ver vers19.dsym "" diff --git a/ld/testsuite/ld-elfvers/vers17.c b/ld/testsuite/ld-elfvers/vers17.c new file mode 100644 index 0000000..3bcd647 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers17.c @@ -0,0 +1,5 @@ +int +show_foo () +{ + return 99; +} diff --git a/ld/testsuite/ld-elfvers/vers17.dsym b/ld/testsuite/ld-elfvers/vers17.dsym new file mode 100644 index 0000000..8decc0a --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers17.dsym @@ -0,0 +1,2 @@ +[0]* g DO \*ABS\* [0]* VERS_2.0 VERS_2.0 +[0-9a-f]* g DF (.text|\*ABS\*) [0-9a-f]* VERS_2.0 (0x[0-9a-f][0-9a-f] )?show_foo diff --git a/ld/testsuite/ld-elfvers/vers17.map b/ld/testsuite/ld-elfvers/vers17.map new file mode 100644 index 0000000..a5c9cf6 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers17.map @@ -0,0 +1,4 @@ +VERS_2.0 { + global: + show_foo; +}; diff --git a/ld/testsuite/ld-elfvers/vers17.ver b/ld/testsuite/ld-elfvers/vers17.ver new file mode 100644 index 0000000..e78d59c --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers17.ver @@ -0,0 +1,3 @@ +Version definitions: +1 0x01 0x02605d3f tmpdir/vers17.so +2 0x00 0x0a7922b0 VERS_2.0 diff --git a/ld/testsuite/ld-elfvers/vers18.c b/ld/testsuite/ld-elfvers/vers18.c new file mode 100644 index 0000000..25dcc25 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers18.c @@ -0,0 +1,42 @@ +int +bar () +{ + return 3; +} + +#pragma weak hide_original_foo + +int +hide_original_foo () +{ + return 1 + bar (); +} + +#pragma weak hide_old_foo + +int +hide_old_foo () +{ + return 10 + bar(); +} + +#pragma weak hide_old_foo1 + +int +hide_old_foo1 () +{ + return 100 + bar (); +} + +#pragma weak hide_new_foo + +int +hide_new_foo () +{ + return 1000 + bar (); +} + +__asm__(".symver hide_original_foo,show_foo@"); +__asm__(".symver hide_old_foo,show_foo@VERS_1.1"); +__asm__(".symver hide_old_foo1,show_foo@VERS_1.2"); +__asm__(".symver hide_new_foo,show_foo@@VERS_2.0"); diff --git a/ld/testsuite/ld-elfvers/vers18.dsym b/ld/testsuite/ld-elfvers/vers18.dsym new file mode 100644 index 0000000..dc3ad7b --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers18.dsym @@ -0,0 +1,7 @@ +[0-9a-f]* w DF (\*UND\*) [0-9a-f]* VERS_2.0 (0x[0-9a-f][0-9a-f] )?show_foo +[0]* g DO \*ABS\* [0]* VERS_1.1 VERS_1.1 +[0]* g DO \*ABS\* [0]* VERS_1.2 VERS_1.2 +[0]* g DO \*ABS\* [0]* VERS_2.0 VERS_2.0 +[0-9a-f]* w DF (.text|\*ABS\*) [0-9a-f]* \(Base\) (0x[0-9a-f][0-9a-f] )?show_foo +[0-9a-f]* w DF (.text|\*ABS\*) [0-9a-f]* \(VERS_1.1\) (0x[0-9a-f][0-9a-f] )?show_foo +[0-9a-f]* w DF (.text|\*ABS\*) [0-9a-f]* \(VERS_1.2\) (0x[0-9a-f][0-9a-f] )?show_foo diff --git a/ld/testsuite/ld-elfvers/vers18.map b/ld/testsuite/ld-elfvers/vers18.map new file mode 100644 index 0000000..eac2b0e --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers18.map @@ -0,0 +1,15 @@ +VERS_1.1 { + global: + foo1; + local: + hide_old*; + hide_original*; + hide_new*; +}; + +VERS_1.2 { + foo2; +} VERS_1.1; + +VERS_2.0 { +} VERS_1.2; diff --git a/ld/testsuite/ld-elfvers/vers18.sym b/ld/testsuite/ld-elfvers/vers18.sym new file mode 100644 index 0000000..f9cefdf --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers18.sym @@ -0,0 +1,4 @@ +[0-9a-f]* w F .text [0-9a-f]* (0x[0-9a-f][0-9a-f] )?show_foo@ +[0-9a-f]* w F .text [0-9a-f]* (0x[0-9a-f][0-9a-f] )?show_foo@VERS_1.1 +[0-9a-f]* w F .text [0-9a-f]* (0x[0-9a-f][0-9a-f] )?show_foo@VERS_1.2 +[0-9a-f]* w F .text [0-9a-f]* (0x[0-9a-f][0-9a-f] )?show_foo@@VERS_2.0 diff --git a/ld/testsuite/ld-elfvers/vers18.ver b/ld/testsuite/ld-elfvers/vers18.ver new file mode 100644 index 0000000..d252996 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers18.ver @@ -0,0 +1,12 @@ +Version definitions: +1 0x01 0x02608d3f tmpdir/vers18.so +2 0x00 0x0a7927b1 VERS_1.1 +3 0x00 0x0a7927b2 VERS_1.2 + VERS_1.1 +4 0x02 0x0a7922b0 VERS_2.0 + VERS_1.2 + +Version References: + required from tmpdir/vers17.so: + 0x0a7922b0 0x00 05 VERS_2.0 + diff --git a/ld/testsuite/ld-elfvers/vers19.c b/ld/testsuite/ld-elfvers/vers19.c new file mode 100644 index 0000000..bc2d83c --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers19.c @@ -0,0 +1,6 @@ +int +main () +{ + printf ("%d\n", show_foo ()); + return 0; +} diff --git a/ld/testsuite/ld-elfvers/vers19.dsym b/ld/testsuite/ld-elfvers/vers19.dsym new file mode 100644 index 0000000..c9c2642 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers19.dsym @@ -0,0 +1 @@ +[0-9a-f]* DF \*UND\* [0-9a-f]* VERS_2.0 (0x[0-9a-f][0-9a-f] )?show_foo diff --git a/ld/testsuite/ld-elfvers/vers19.ver b/ld/testsuite/ld-elfvers/vers19.ver new file mode 100644 index 0000000..ccbdc88 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers19.ver @@ -0,0 +1,3 @@ +Version References: + required from *tmpdir/vers17.so: + 0x0a7922b0 0x00 02 VERS_2.0 |