Pass $NOPIE_CFLAGS to ELF visibility tests
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 22 Jun 2017 19:53:39 +0000 (12:53 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 22 Jun 2017 19:53:39 +0000 (12:53 -0700)
PR ld/21090
* testsuite/ld-elfvsb/elfvsb.exp (visibility_run): Pass
$NOPIE_CFLAGS if non-PIE is required.

ld/ChangeLog
ld/testsuite/ld-elfvsb/elfvsb.exp

index a8ca46b5b64af740c8fbb2aa0acdf0d4a5cf4fa3..2dfc0a49481278fa0dc7d7a9740823547b6e4133 100644 (file)
@@ -1,3 +1,9 @@
+2017-06-22  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/21090
+       * testsuite/ld-elfvsb/elfvsb.exp (visibility_run): Pass
+       $NOPIE_CFLAGS if non-PIE is required.
+
 2017-06-22  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/21090
index a2c3ef79c33f84d961406d020685f0b1c3534f6b..7552f7a1bbd2822b56c5d07f27d015e695af02d7 100644 (file)
@@ -236,6 +236,7 @@ proc visibility_run {visibility} {
     global support_protected
     global shared_needs_pic
     global PLT_CFLAGS
+    global NOPIE_CFLAGS
     global COMPRESS_LDFLAG
 
     if [ string match $visibility "hidden" ] {
@@ -285,8 +286,8 @@ proc visibility_run {visibility} {
        # will need to do more relocation work.  However, note that not
        # using -fpic will cause some of the tests to return different
        # 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] } {
+       if { ![ld_compile "$CC -g $NOPIE_CFLAGS $PLT_CFLAGS $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o]
+            || ![ld_compile "$CC -g $NOPIE_CFLAGS $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