This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
PATCH: Add a testcase for copy relocation
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Fri, 28 Mar 2003 12:34:04 -0800
- Subject: PATCH: Add a testcase for copy relocation
This patch adds a testcase for copy relocation and protected
visibility.
H.J.
----
2003-03-28 H.J. Lu <hjl at gnu dot org>
* ld-elfvsb/elfvsb.exp: Add protected_copy.
* ld-elfvsb/sh1.c: Updated.
--- ld/testsuite/ld-elfvsb/elfvsb.exp.copy 2003-02-27 11:27:18.000000000 -0800
+++ ld/testsuite/ld-elfvsb/elfvsb.exp 2003-03-28 12:27:42.000000000 -0800
@@ -207,6 +207,8 @@ proc visibility_run {visibility} {
set VSBCFLAG "-DHIDDEN_WEAK_TEST"
} else { if [ string match $visibility "protected" ] {
set VSBCFLAG "-DPROTECTED_TEST"
+ } else { if [ string match $visibility "protected_copy" ] {
+ set VSBCFLAG "-DPROTECTED_COPY_TEST"
} else { if [ string match $visibility "protected_undef" ] {
set VSBCFLAG "-DPROTECTED_UNDEF_TEST"
} else { if [ string match $visibility "protected_undef_def" ] {
@@ -215,7 +217,7 @@ proc visibility_run {visibility} {
set VSBCFLAG "-DPROTECTED_WEAK_TEST"
} else {
set VSBCFLAG ""
- }}}}}}}}}
+ }}}}}}}}}}
# Compile the main program.
if ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o] {
@@ -237,6 +239,7 @@ proc visibility_run {visibility} {
# SunOS non PIC shared libraries don't permit some cases of
# overriding.
if { [ string match $visibility "protected" ]
+ || [ string match $visibility "protected_copy" ]
|| [ string match $visibility "protected_undef_def" ] } {
if [ string match $support_protected "no" ] {
setup_xfail $target_triplet
@@ -266,6 +269,7 @@ proc visibility_run {visibility} {
# relocations for various targets are broken in the case where
# the load address is not zero (which is the default).
if { [ string match $visibility "protected" ]
+ || [ string match $visibility "protected_copy" ]
|| [ string match $visibility "protected_undef_def" ] } {
if [ string match $support_protected "no" ] {
setup_xfail $target_triplet
@@ -277,6 +281,7 @@ proc visibility_run {visibility} {
if { [ string match $visibility "hidden_normal" ]
|| [ string match $visibility "hidden_weak" ]
|| [ string match $visibility "protected" ]
+ || [ string match $visibility "protected_copy" ]
|| [ string match $visibility "protected_undef_def" ]
|| [ string match $visibility "protected_weak" ]
|| [ string match $visibility "normal" ] } {
@@ -301,6 +306,7 @@ proc visibility_run {visibility} {
unresolved "visibility ($visibility)"
} else {
if { [ string match $visibility "protected" ]
+ || [ string match $visibility "protected_copy" ]
|| [ string match $visibility "protected_undef_def" ] } {
if [ string match $support_protected "no" ] {
setup_xfail $target_triplet
@@ -329,6 +335,7 @@ proc visibility_run {visibility} {
# SunOS non PIC shared libraries don't permit some cases of
# overriding.
if { [ string match $visibility "protected" ]
+ || [ string match $visibility "protected_copy" ]
|| [ string match $visibility "protected_undef_def" ] } {
if [ string match $support_protected "no" ] {
setup_xfail $target_triplet
@@ -354,6 +361,7 @@ proc visibility_run {visibility} {
if { [file exists $tmpdir/sh1p.o ] && [ file exists $tmpdir/sh2p.o ] } {
if { [ string match $visibility "protected" ]
+ || [ string match $visibility "protected_copy" ]
|| [ string match $visibility "protected_undef_def" ] } {
if [ string match $support_protected "no" ] {
setup_xfail $target_triplet
@@ -400,6 +408,7 @@ visibility_run hidden_undef
visibility_run hidden_undef_def
visibility_run hidden_weak
visibility_run protected
+visibility_run protected_copy
visibility_run protected_undef
visibility_run protected_undef_def
visibility_run protected_weak
--- ld/testsuite/ld-elfvsb/sh1.c.copy 2003-03-28 12:30:50.000000000 -0800
+++ ld/testsuite/ld-elfvsb/sh1.c 2003-03-28 12:21:40.000000000 -0800
@@ -318,7 +318,10 @@ visibility_varval ()
asm (".hidden visibility");
asm (".hidden visibility_var");
#else
-#if defined (PROTECTED_TEST) || defined (PROTECTED_UNDEF_TEST) || defined (PROTECTED_WEAK_TEST)
+#if defined (PROTECTED_TEST) \
+ || defined (PROTECTED_COPY_TEST) \
+ || defined (PROTECTED_UNDEF_TEST) \
+ || defined (PROTECTED_WEAK_TEST)
asm (".protected visibility");
asm (".protected visibility_var");
#endif