aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-07-27 05:15:01 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-07-27 05:15:01 -0700
commitfaebca0390ceef085f383d42423e14079dcd0a48 (patch)
tree6db001ef2378691e4c91bc184f21f16aca0a5ec3 /ld
parentc4972ed6029abb1a56eeafe144000031d902f074 (diff)
downloadgdb-faebca0390ceef085f383d42423e14079dcd0a48.zip
gdb-faebca0390ceef085f383d42423e14079dcd0a48.tar.gz
gdb-faebca0390ceef085f383d42423e14079dcd0a48.tar.bz2
Pass $PLT_CFLAGS to ld_compile
Some linker visibility tests without PIC expect PLT. This patch passes $PLT_CFLAGS to ld_compile. * ld-elfvsb/elfvsb.exp (visibility_run): Pass $PLT_CFLAGS to ld_compile.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog5
-rw-r--r--ld/testsuite/ld-elfvsb/elfvsb.exp12
2 files changed, 12 insertions, 5 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index b2e85ed..bac9172 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
+ * ld-elfvsb/elfvsb.exp (visibility_run): Pass $PLT_CFLAGS to
+ ld_compile.
+
+2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
+
* ld-elfvers/vers.exp (build_vers_lib_no_pic): Pass $PLT_CFLAGS
to build_binary.
diff --git a/ld/testsuite/ld-elfvsb/elfvsb.exp b/ld/testsuite/ld-elfvsb/elfvsb.exp
index 8ae8c3d..e02d4fa 100644
--- a/ld/testsuite/ld-elfvsb/elfvsb.exp
+++ b/ld/testsuite/ld-elfvsb/elfvsb.exp
@@ -227,6 +227,7 @@ proc visibility_run {visibility} {
global target_triplet
global support_protected
global shared_needs_pic
+ global PLT_CFLAGS
if [ string match $visibility "hidden" ] {
set VSBCFLAG "-DHIDDEN_TEST"
@@ -259,8 +260,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 {
@@ -269,9 +271,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