From: H.J. Lu Date: Tue, 16 Jul 2002 00:15:57 +0000 (+0000) Subject: 2002-07-15 H.J. Lu X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b42d80615e5394c8c79704b26178bca15f047bd6;p=binutils-gdb.git 2002-07-15 H.J. Lu * ld-elfvers/vers.exp: Add vers21. * ld-elfvers/vers21.c: New. * ld-elfvers/vers21.dsym: New. * ld-elfvers/vers21.map: New. * ld-elfvers/vers21.sym: New. * ld-elfvers/vers21.ver: New. --- diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index ff64b7919f0..44763c4fac8 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2002-07-15 H.J. Lu + + * ld-elfvers/vers.exp: Add vers21. + + * ld-elfvers/vers21.c: New. + * ld-elfvers/vers21.dsym: New. + * ld-elfvers/vers21.map: New. + * ld-elfvers/vers21.sym: New. + * ld-elfvers/vers21.ver: New. + 2002-07-12 Hans-Peter Nilsson * ld-cris/nodyn4.d, ld-cris/expdyn4.d, ld-cris/comref1.s, diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp index 48ba4ca5d68..6381ea50847 100644 --- a/ld/testsuite/ld-elfvers/vers.exp +++ b/ld/testsuite/ld-elfvers/vers.exp @@ -821,3 +821,6 @@ build_exec "vers19" vers19.c vers19 "-rpath ." vers18.so vers19.ver vers19.dsym build_vers_lib "vers20a" vers20.c vers20a "" vers20.map vers20a.ver vers20.dsym "" exec cp $tmpdir/vers20a.so $tmpdir/vers20b.so build_vers_lib "vers20" vers20.c vers20 "vers20a.so vers20b.so" vers20.map vers20.ver vers20.dsym "" + +# Test .symver override. +build_vers_lib "vers21" vers21.c vers21 "" vers21.map vers21.ver vers21.dsym vers21.sym diff --git a/ld/testsuite/ld-elfvers/vers21.c b/ld/testsuite/ld-elfvers/vers21.c new file mode 100644 index 00000000000..23382af1509 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers21.c @@ -0,0 +1,32 @@ +__asm__(".symver _old_foo,foo@VERS.0"); +__asm__(".symver _old_bar,bar@VERS.0"); +__asm__(".symver _old_foobar,foobar@VERS.0"); +__asm__(".weak _old_bar"); + +int +bar () +{ + return 1; +} + +int +_old_bar () +{ + return bar (); +} + +int +foo () +{ + return 2; +} + +int +_old_foo () +{ + return foo (); +} + +int _old_foobar = 0; + +int foobar = 1; diff --git a/ld/testsuite/ld-elfvers/vers21.dsym b/ld/testsuite/ld-elfvers/vers21.dsym new file mode 100644 index 00000000000..2096b5d9887 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers21.dsym @@ -0,0 +1,4 @@ +[0]*[ ]+g[ ]+DO[ ]+\*ABS\*[ ]+[0]*[ ]+VERS.0[ ]+VERS.0 +[0-9a-f]*[ ]+w[ ]+DF[ ]+.text[ ]+[0-9a-f]*[ ]+\(VERS.0\)[ ]+(0x[0-9a-f]*|)[ ]*bar +[0-9a-f]*[ ]+g[ ]+DF[ ]+.text[ ]+[0-9a-f]*[ ]+\(VERS.0\)[ ]+(0x[0-9a-f]*|)[ ]*foo +[0-9a-f]*[ ]+g[ ]+DO[ ]+.s?data[ ]+[0-9a-f]*[ ]+\(VERS.0\)[ ]+foobar diff --git a/ld/testsuite/ld-elfvers/vers21.map b/ld/testsuite/ld-elfvers/vers21.map new file mode 100644 index 00000000000..08f748a80a4 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers21.map @@ -0,0 +1,8 @@ +VERS.0 { + global: + bar; + foo; + foobar; + local: + *; +}; diff --git a/ld/testsuite/ld-elfvers/vers21.sym b/ld/testsuite/ld-elfvers/vers21.sym new file mode 100644 index 00000000000..bcb635981e1 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers21.sym @@ -0,0 +1,3 @@ +[0-9a-f]*[ ]+g[ ]+O[ ]+.s?data[ ]+[0-9a-f]* (0x[0-9a-f][0-9a-f] )?foobar@VERS.0 +[0-9a-f]*[ ]+w[ ]+F[ ]+.text[ ]+[0-9a-f]* (0x[0-9a-f][0-9a-f] )?bar@VERS.0 +[0-9a-f]*[ ]+g[ ]+F[ ]+.text[ ]+[0-9a-f]* (0x[0-9a-f][0-9a-f] )?foo@VERS.0 diff --git a/ld/testsuite/ld-elfvers/vers21.ver b/ld/testsuite/ld-elfvers/vers21.ver new file mode 100644 index 00000000000..3ba24d80172 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers21.ver @@ -0,0 +1,4 @@ +Version definitions: +1 0x01 0x0965595f vers21.so +2 0x00 0x05aa7610 VERS.0 +