PR ld/15428: MIPS/LD/testsuite: Un-KFAIL `__ehdr_start' test 2
[deliverable/binutils-gdb.git] / ld / testsuite / ld-elfvsb / elfvsb.exp
index 58bc8f2dca57c5b115d948e1a59b76d649712f62..e20cd766a6121e9629ee86fe340e61fbe07587d3 100644 (file)
@@ -1,6 +1,5 @@
 # Expect script for ld-visibility tests
-#   Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010
-#   Free Software Foundation, Inc.
+#   Copyright (C) 2000-2016 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -31,6 +30,7 @@ if { ![istarget hppa*64*-*-hpux*] \
      && ![istarget hppa*-*-linux*] \
      && ![istarget i?86-*-linux*] \
      && ![istarget i?86-*-gnu*] \
+     && ![istarget *-*-nacl*] \
      && ![istarget ia64-*-linux*] \
      && ![istarget m68k-*-linux*] \
      && ![istarget mips*-*-linux*] \
@@ -62,6 +62,7 @@ if ![isnative] then {return}
 set tmpdir tmpdir
 set SHCFLAG ""
 set shared_needs_pic "no"
+set COMPRESS_LDFLAG "-Wl,--compress-debug-sections=zlib-gabi"
 
 if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
 
@@ -95,16 +96,16 @@ if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
 
 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 
+    # 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 
+    # 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 
+    # 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] {
+    # 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
@@ -117,6 +118,7 @@ if [istarget arm*-*-linux*] {
 set support_protected "no"
 
 if { [istarget *-*-linux*]
+     || [istarget *-*-nacl*]
      || [istarget *-*-gnu*] } {
     if [ld_compile "$CC -g $CFLAGS -DPROTECTED_CHECK" $srcdir/$subdir/main.c $tmpdir/main.o] {
       if [ld_simple_link $CC $tmpdir/main "$tmpdir/main.o"] {
@@ -226,6 +228,8 @@ proc visibility_run {visibility} {
     global target_triplet
     global support_protected
     global shared_needs_pic
+    global PLT_CFLAGS
+    global COMPRESS_LDFLAG
 
     if [ string match $visibility "hidden" ] {
        set VSBCFLAG "-DHIDDEN_TEST"
@@ -258,8 +262,9 @@ proc visibility_run {visibility} {
        # functions and variables not being overridable.  Newer versions
        # of gcc are more likely to do this.
     } else {
-    # Compile the main program.
-    if ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o] {
+    # Compile the main program.  Make sure that PLT is used since PLT
+    # is expected.
+    if ![ld_compile "$CC -g $PLT_CFLAGS $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o] {
        unresolved "visibility ($visibility) (non PIC)"
        unresolved "visibility ($visibility)"
     } else {
@@ -268,9 +273,9 @@ proc visibility_run {visibility} {
        # although it will be less efficient because the dynamic linker
        # will need to do more relocation work.  However, note that not
        # using -fpic will cause some of the tests to return different
-       # results.
-       if { ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o]
-            || ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } {
+       # results.  Make sure that PLT is used since PLT is expected.
+       if { ![ld_compile "$CC -g $PLT_CFLAGS $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o]
+            || ![ld_compile "$CC -g $PLT_CFLAGS $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } {
            unresolved "visibility ($visibility) (non PIC)"
        } else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
            visibility_test $visibility vnp "visibility ($visibility) (non PIC)" mainnp.o sh1np.o sh2np.o xcoff
@@ -306,6 +311,7 @@ proc visibility_run {visibility} {
            if { [is_elf64 $tmpdir/mainnp.o] } {
                setup_xfail "x86_64-*-linux*"
            }
+           setup_xfail "x86_64-*-linux-gnux32"
            if { ![istarget hppa*64*-*-linux*] } {
                setup_xfail "hppa*-*-linux*"
            }
@@ -349,6 +355,7 @@ proc visibility_run {visibility} {
            if { [is_elf64 $tmpdir/mainnp.o] } {
                setup_xfail "x86_64-*-linux*"
            }
+           setup_xfail "x86_64-*-linux-gnux32"
            if { ![istarget hppa*64*-*-linux*] } {
                setup_xfail "hppa*-*-linux*"
            }
@@ -363,7 +370,7 @@ proc visibility_run {visibility} {
 
        # Now compile the code using -fpic.
 
-       if { ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG -DSHARED $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o] 
+       if { ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG -DSHARED $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o]
            || ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG -DSHARED $picflag" $srcdir/$subdir/sh2.c $tmpdir/sh2p.o] } {
            unresolved "visibility ($visibility)"
        } else {
@@ -379,7 +386,7 @@ proc visibility_run {visibility} {
            } else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
                visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o xcoff
            } else {
-               visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o elfvsb
+               visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o elfvsb $COMPRESS_LDFLAG
            } }
        }
     }}
@@ -423,6 +430,7 @@ proc visibility_run {visibility} {
                if { [is_elf64 $tmpdir/mainp.o] } {
                    setup_xfail "x86_64-*-linux*"
                }
+               setup_xfail "x86_64-*-linux-gnux32"
                if { ![istarget hppa*64*-*-linux*] } {
                    setup_xfail "hppa*-*-linux*"
                }
This page took 0.025647 seconds and 4 git commands to generate.