From d400d2a669400b37d481d43e771e7cd01f897bc2 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 19 Mar 2004 17:02:31 +0000 Subject: [PATCH] 2004-03-19 H.J. Lu * ld-elfvers/vers.exp: Add new tests for versioned weak definition. * ld-elfvers/vers28a.c: New file. * ld-elfvers/vers28a.dsym: Likewise. * ld-elfvers/vers28a.ver: Likewise. * ld-elfvers/vers28b.c: Likewise. * ld-elfvers/vers28b.dsym: Likewise. * ld-elfvers/vers28b.map: Likewise. * ld-elfvers/vers28b.ver: Likewise. * ld-elfvers/vers28c.c: Likewise. * ld-elfvers/vers28c.dsym: Likewise. * ld-elfvers/vers28c.ver: Likewise. --- ld/testsuite/ChangeLog | 16 ++++++++++++++++ ld/testsuite/ld-elfvers/vers.exp | 6 ++++++ ld/testsuite/ld-elfvers/vers28a.c | 1 + ld/testsuite/ld-elfvers/vers28a.dsym | 1 + ld/testsuite/ld-elfvers/vers28a.ver | 1 + ld/testsuite/ld-elfvers/vers28b.c | 3 +++ ld/testsuite/ld-elfvers/vers28b.dsym | 2 ++ ld/testsuite/ld-elfvers/vers28b.map | 5 +++++ ld/testsuite/ld-elfvers/vers28b.ver | 4 ++++ ld/testsuite/ld-elfvers/vers28c.c | 7 +++++++ ld/testsuite/ld-elfvers/vers28c.dsym | 1 + ld/testsuite/ld-elfvers/vers28c.ver | 4 ++++ 12 files changed, 51 insertions(+) create mode 100644 ld/testsuite/ld-elfvers/vers28a.c create mode 100644 ld/testsuite/ld-elfvers/vers28a.dsym create mode 100644 ld/testsuite/ld-elfvers/vers28a.ver create mode 100644 ld/testsuite/ld-elfvers/vers28b.c create mode 100644 ld/testsuite/ld-elfvers/vers28b.dsym create mode 100644 ld/testsuite/ld-elfvers/vers28b.map create mode 100644 ld/testsuite/ld-elfvers/vers28b.ver create mode 100644 ld/testsuite/ld-elfvers/vers28c.c create mode 100644 ld/testsuite/ld-elfvers/vers28c.dsym create mode 100644 ld/testsuite/ld-elfvers/vers28c.ver diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index a41e6ae60e0..eb1a897e063 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,19 @@ +2004-03-19 H.J. Lu + + * ld-elfvers/vers.exp: Add new tests for versioned weak + definition. + + * ld-elfvers/vers28a.c: New file. + * ld-elfvers/vers28a.dsym: Likewise. + * ld-elfvers/vers28a.ver: Likewise. + * ld-elfvers/vers28b.c: Likewise. + * ld-elfvers/vers28b.dsym: Likewise. + * ld-elfvers/vers28b.map: Likewise. + * ld-elfvers/vers28b.ver: Likewise. + * ld-elfvers/vers28c.c: Likewise. + * ld-elfvers/vers28c.dsym: Likewise. + * ld-elfvers/vers28c.ver: Likewise. + 2004-03-19 Alan Modra * ld-scripts/provide-2.d: Ignore random symbols. diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp index 47be40ef8ec..a9b37787009 100644 --- a/ld/testsuite/ld-elfvers/vers.exp +++ b/ld/testsuite/ld-elfvers/vers.exp @@ -938,3 +938,9 @@ build_vers_lib_pic "vers27d2" vers27d2.c vers27d2 "" "" vers27b.ver vers27b.dsym build_executable "vers27d3" vers27d3.c vers27d3 "vers27b.o vers27d2.so vers27d1.so" "" vers27b.ver vers27b.dsym "" build_vers_lib_pic "vers27d4" vers27d2.c vers27d4 "vers27a.so" "" vers27d4.ver vers27d4.dsym "" build_executable "vers27d5" vers27d3.c vers27d5 "vers27d4.so vers27b.o vers27a.so" "" vers27b.ver vers27b.dsym "" + +# Test weak versioned definition vs. strong definition in different +# files. +build_vers_lib_pic "vers28a" vers28a.c vers28a "" "" vers28a.ver vers28a.dsym "" +build_vers_lib_pic "vers28b" vers28b.c vers28b "" vers28b.map vers28b.ver vers28b.dsym "" +build_vers_lib_pic "vers28c" vers28c.c vers28c "vers28b.so vers28a.so" "" vers28c.ver vers28c.dsym "" diff --git a/ld/testsuite/ld-elfvers/vers28a.c b/ld/testsuite/ld-elfvers/vers28a.c new file mode 100644 index 00000000000..f5be3717f06 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers28a.c @@ -0,0 +1 @@ +void foo () {} diff --git a/ld/testsuite/ld-elfvers/vers28a.dsym b/ld/testsuite/ld-elfvers/vers28a.dsym new file mode 100644 index 00000000000..932b79829cf --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers28a.dsym @@ -0,0 +1 @@ +# Empty file diff --git a/ld/testsuite/ld-elfvers/vers28a.ver b/ld/testsuite/ld-elfvers/vers28a.ver new file mode 100644 index 00000000000..932b79829cf --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers28a.ver @@ -0,0 +1 @@ +# Empty file diff --git a/ld/testsuite/ld-elfvers/vers28b.c b/ld/testsuite/ld-elfvers/vers28b.c new file mode 100644 index 00000000000..8186782c4e9 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers28b.c @@ -0,0 +1,3 @@ +#pragma weak foo + +void foo () {} diff --git a/ld/testsuite/ld-elfvers/vers28b.dsym b/ld/testsuite/ld-elfvers/vers28b.dsym new file mode 100644 index 00000000000..e174c91e8bc --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers28b.dsym @@ -0,0 +1,2 @@ +[0]*[ ]+g[ ]+DO[ ]+\*ABS\*[ ]+[0]*[ ]+VERS.0[ ]+VERS.0 +[0-9a-f]*[ ]+w[ ]+DF[ ]+.text[ ]+[0-9a-f]*[ ]+VERS.0[ ]+(0x[0-9a-f]*|)[ ]*foo diff --git a/ld/testsuite/ld-elfvers/vers28b.map b/ld/testsuite/ld-elfvers/vers28b.map new file mode 100644 index 00000000000..31bfc763637 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers28b.map @@ -0,0 +1,5 @@ +VERS.0 { + global: + foo; + local: *; +}; diff --git a/ld/testsuite/ld-elfvers/vers28b.ver b/ld/testsuite/ld-elfvers/vers28b.ver new file mode 100644 index 00000000000..ab99615100a --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers28b.ver @@ -0,0 +1,4 @@ +Version definitions: +1 0x01 0x0659990f vers28b.so +2 0x00 0x05aa7610 VERS.0 + diff --git a/ld/testsuite/ld-elfvers/vers28c.c b/ld/testsuite/ld-elfvers/vers28c.c new file mode 100644 index 00000000000..55afb6c5dee --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers28c.c @@ -0,0 +1,7 @@ +extern void foo (); + +void +bar () +{ + foo (); +} diff --git a/ld/testsuite/ld-elfvers/vers28c.dsym b/ld/testsuite/ld-elfvers/vers28c.dsym new file mode 100644 index 00000000000..37a1c4374ec --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers28c.dsym @@ -0,0 +1 @@ +[0-9a-f]*[ ]+DF[ ]+\*UND\*[ ]+[0-9a-f]*[ ]+VERS.0[ ]+(0x[0-9a-f]*|)[ ]*foo diff --git a/ld/testsuite/ld-elfvers/vers28c.ver b/ld/testsuite/ld-elfvers/vers28c.ver new file mode 100644 index 00000000000..1462686fcbb --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers28c.ver @@ -0,0 +1,4 @@ +Version References: + required from tmpdir/vers28b.so: + 0x05aa7610 0x00 02 VERS.0 + -- 2.30.2