aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2000-07-16 21:29:32 +0000
committerH.J. Lu <hjl.tools@gmail.com>2000-07-16 21:29:32 +0000
commit08c44e659e4277eedba21b963a6848ef4ae3948f (patch)
tree352acaa34841145ec2b7bb48d7fe2b6df24dc3ad /ld
parent1345a0c087decf73553c7ed8e92ae0e997794eff (diff)
downloadgdb-08c44e659e4277eedba21b963a6848ef4ae3948f.zip
gdb-08c44e659e4277eedba21b963a6848ef4ae3948f.tar.gz
gdb-08c44e659e4277eedba21b963a6848ef4ae3948f.tar.bz2
2000-07-16 H.J. Lu (hjl@gnu.org)
* ld-elfvsb/elfvsb.exp (support_protected): New variable. Check and set to "yes" if the protected visibility is expected to pass. (visibility_run): Set expected to fail for the "protected" and "protected_undef_def" tests only if $support_protected is "no". * ld-elfvsb/main.c (PROTECTED_CHECK): Check for the protected visibility support if defined.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog12
-rw-r--r--ld/testsuite/ld-elfvsb/elfvsb.exp31
-rw-r--r--ld/testsuite/ld-elfvsb/main.c19
3 files changed, 57 insertions, 5 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 58a1124..8f9bb2c 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,15 @@
+2000-07-16 H.J. Lu (hjl@gnu.org)
+
+ * ld-elfvsb/elfvsb.exp (support_protected): New variable. Check
+ and set to "yes" if the protected visibility is expected to
+ pass.
+ (visibility_run): Set expected to fail for the "protected"
+ and "protected_undef_def" tests only if $support_protected is
+ "no".
+
+ * ld-elfvsb/main.c (PROTECTED_CHECK): Check for the protected
+ visibility support if defined.
+
2000-07-15 H.J. Lu (hjl@gnu.org)
* ld-elfvsb/elfvsb.exp (visibility_run): Set expected failure
diff --git a/ld/testsuite/ld-elfvsb/elfvsb.exp b/ld/testsuite/ld-elfvsb/elfvsb.exp
index e3a010e..e437a56 100644
--- a/ld/testsuite/ld-elfvsb/elfvsb.exp
+++ b/ld/testsuite/ld-elfvsb/elfvsb.exp
@@ -74,6 +74,16 @@ if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
close $file
}
+set support_protected "no"
+
+if [istarget *-*-linux*] {
+ if [ld_compile "$CC $CFLAGS -DPROTECTED_CHECK" $srcdir/$subdir/main.c $tmpdir/main.o] {
+ if [ld_link $ld $tmpdir/main "$tmpdir/main.o"] {
+ catch "exec $tmpdir/main" support_protected
+ }
+ }
+}
+
# The test procedure.
proc visibility_test { visibility progname testname main sh1 sh2 dat args } {
global ld
@@ -171,6 +181,7 @@ proc visibility_run {visibility} {
global tmpdir
global picflag
global target_triplet
+ global support_protected
if [ string match $visibility "hidden" ] {
set VSBCFLAG "-DHIDDEN_TEST"
@@ -215,7 +226,9 @@ proc visibility_run {visibility} {
# overriding.
if { [ string match $visibility "protected" ]
|| [ string match $visibility "protected_undef_def" ] } {
- setup_xfail $target_triplet
+ if [ string match $support_protected "no" ] {
+ setup_xfail $target_triplet
+ }
} else {
setup_xfail "*-*-sunos4*"
}
@@ -227,7 +240,9 @@ proc visibility_run {visibility} {
# the load address is not zero (which is the default).
if { [ string match $visibility "protected" ]
|| [ string match $visibility "protected_undef_def" ] } {
- setup_xfail $target_triplet
+ if [ string match $support_protected "no" ] {
+ setup_xfail $target_triplet
+ }
} else {
setup_xfail "*-*-sunos4*"
setup_xfail "*-*-linux*libc1"
@@ -245,7 +260,9 @@ proc visibility_run {visibility} {
} else {
if { [ string match $visibility "protected" ]
|| [ string match $visibility "protected_undef_def" ] } {
- setup_xfail $target_triplet
+ if [ string match $support_protected "no" ] {
+ setup_xfail $target_triplet
+ }
}
# SunOS can not compare function pointers correctly
if [istarget "*-*-sunos4*"] {
@@ -271,7 +288,9 @@ proc visibility_run {visibility} {
# overriding.
if { [ string match $visibility "protected" ]
|| [ string match $visibility "protected_undef_def" ] } {
- setup_xfail $target_triplet
+ if [ string match $support_protected "no" ] {
+ setup_xfail $target_triplet
+ }
} else {
setup_xfail "*-*-sunos4*"
}
@@ -284,7 +303,9 @@ proc visibility_run {visibility} {
if { [file exists $tmpdir/sh1p.o ] && [ file exists $tmpdir/sh2p.o ] } {
if { [ string match $visibility "protected" ]
|| [ string match $visibility "protected_undef_def" ] } {
- setup_xfail $target_triplet
+ if [ string match $support_protected "no" ] {
+ setup_xfail $target_triplet
+ }
}
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
visibility_test $visibility vmpp "visibility ($visibility) (PIC main)" mainp.o sh1p.o sh2p.o xcoff
diff --git a/ld/testsuite/ld-elfvsb/main.c b/ld/testsuite/ld-elfvsb/main.c
index 0aaa835..a00b70f 100644
--- a/ld/testsuite/ld-elfvsb/main.c
+++ b/ld/testsuite/ld-elfvsb/main.c
@@ -1,3 +1,21 @@
+#ifdef PROTECTED_CHECK
+#include <features.h>
+
+int
+main (argc, argv)
+ int argc;
+ char *argv[];
+{
+#if defined (__GLIBC__) && (__GLIBC__ > 2 \
+ || (__GLIBC__ == 2 \
+ && __GLIBC_MINOR__ >= 2))
+ puts ("yes");
+#else
+ puts ("no");
+#endif
+ return 0;
+}
+#else
/* This is the main program for the shared library test. */
#include <stdio.h>
@@ -158,3 +176,4 @@ main ()
main_visibility_checkvar ());
return 0;
}
+#endif