aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elfvsb
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-02-09 10:46:27 +0000
committerNick Clifton <nickc@redhat.com>2010-02-09 10:46:27 +0000
commita9f844b10796cac2bf25b92512385a09ce805c59 (patch)
tree3b63350dbcf847325c312209b5c78f52c4ceb188 /ld/testsuite/ld-elfvsb
parentcb1be87e23111486165d9351b787ad73605176eb (diff)
downloadgdb-a9f844b10796cac2bf25b92512385a09ce805c59.zip
gdb-a9f844b10796cac2bf25b92512385a09ce805c59.tar.gz
gdb-a9f844b10796cac2bf25b92512385a09ce805c59.tar.bz2
* ld-elfvsb/elfvsb.exp: Fix tests for arm*-*-linux*.
* ld-shared/shared.exp: Likewise.
Diffstat (limited to 'ld/testsuite/ld-elfvsb')
-rw-r--r--ld/testsuite/ld-elfvsb/elfvsb.exp32
1 files changed, 32 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elfvsb/elfvsb.exp b/ld/testsuite/ld-elfvsb/elfvsb.exp
index fe146bf..1a18822 100644
--- a/ld/testsuite/ld-elfvsb/elfvsb.exp
+++ b/ld/testsuite/ld-elfvsb/elfvsb.exp
@@ -60,6 +60,7 @@ if ![isnative] then {return}
set tmpdir tmpdir
set SHCFLAG ""
+set shared_needs_pic "no"
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
@@ -91,6 +92,27 @@ if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
close $file
}
+if [istarget arm*-*-linux*] {
+ # On ARM section anchors can change the symbol pre-emptability for
+ # non-PIC shared libraries, causing these tests to fail. Turn section
+ # anchors off.
+ set SHCFLAG "-fno-section-anchors"
+
+ # On targets that have MOVW the compiler will emit relocations which
+ # the linker doesn't support when compiling -shared without -fpic. The
+ # test to find out whether we want to XFAIL the non-PIC tests requires
+ # a compile - so we pre-calculate it here. We also note that this can
+ # only affect arm*-*-*eabi targets as the old ABI doesn't support v7.
+ if [istarget arm*-*-*eabi] {
+ set file [open $tmpdir/movw-detect.c w]
+ puts $file "void foo(void) { __asm (\"movw r0, #0\"); }"
+ close $file
+ if [run_host_cmd_yesno "$CC" "$CFLAGS -c $tmpdir/movw-detect.c -o $tmpdir/movw-detect.o"] {
+ set shared_needs_pic "yes"
+ }
+ }
+}
+
set support_protected "no"
if [istarget *-*-linux*] {
@@ -201,6 +223,7 @@ proc visibility_run {visibility} {
global picflag
global target_triplet
global support_protected
+ global shared_needs_pic
if [ string match $visibility "hidden" ] {
set VSBCFLAG "-DHIDDEN_TEST"
@@ -273,6 +296,9 @@ proc visibility_run {visibility} {
if { ![istarget hppa*64*-*-linux*] } {
setup_xfail "hppa*-*-linux*"
}
+ if [ string match $shared_needs_pic "yes" ] {
+ setup_xfail "arm*-*-linux*"
+ }
visibility_test $visibility vnp "visibility ($visibility) (non PIC)" mainnp.o sh1np.o sh2np.o elfvsb
@@ -311,6 +337,9 @@ proc visibility_run {visibility} {
if { ![istarget hppa*64*-*-linux*] } {
setup_xfail "hppa*-*-linux*"
}
+ if [ string match $shared_needs_pic "yes" ] {
+ setup_xfail "arm*-*-linux*"
+ }
visibility_test $visibility vnp "visibility ($visibility) (non PIC, load offset)" \
mainnp.o sh1np.o sh2np.o elfvsb \
@@ -377,6 +406,9 @@ proc visibility_run {visibility} {
if { ![istarget hppa*64*-*-linux*] } {
setup_xfail "hppa*-*-linux*"
}
+ if [ string match $shared_needs_pic "yes" ] {
+ setup_xfail "arm*-*-linux*"
+ }
visibility_test $visibility vmpnp "visibility ($visibility) (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o elfvsb
}