aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-scripts
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-07-27 05:16:38 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-07-27 05:16:38 -0700
commit379d3f1ffc3fab112a0f388a1565c6be2f74f5c3 (patch)
treece5250f4008f93e0b8aead165dd10c861b7d24d8 /ld/testsuite/ld-scripts
parentea9fb8b3e9f9624262984ad402f2aac34c65534d (diff)
downloadgdb-379d3f1ffc3fab112a0f388a1565c6be2f74f5c3.zip
gdb-379d3f1ffc3fab112a0f388a1565c6be2f74f5c3.tar.gz
gdb-379d3f1ffc3fab112a0f388a1565c6be2f74f5c3.tar.bz2
Append $PLT_CFLAGS to CC for NOCROSSREFS tests
NOCROSSREFS tests don't work with -fno-plt. This path appends $PLT_CFLAGS to CC for NOCROSSREFS tests. * ld-scripts/crossref.exp (CC): Save and restore. Append $PLT_CFLAGS.
Diffstat (limited to 'ld/testsuite/ld-scripts')
-rw-r--r--ld/testsuite/ld-scripts/crossref.exp10
1 files changed, 10 insertions, 0 deletions
diff --git a/ld/testsuite/ld-scripts/crossref.exp b/ld/testsuite/ld-scripts/crossref.exp
index 1b6a4bb..293b2a3 100644
--- a/ld/testsuite/ld-scripts/crossref.exp
+++ b/ld/testsuite/ld-scripts/crossref.exp
@@ -33,6 +33,11 @@ if { ![is_remote host] && [which $CC] == 0 } {
global CFLAGS
set old_CFLAGS "$CFLAGS"
+# Pass -fplt to CC since -fno-plt doesn't work with NOCROSSREFS tests.
+global PLT_CFLAGS
+set old_CC "$CC"
+set CC "$CC $PLT_CFLAGS"
+
# Xtensa targets currently default to putting literal values in a separate
# section and that requires linker script support, so put literals in text.
if [istarget xtensa*-*-*] {
@@ -63,6 +68,7 @@ if { ![ld_compile $CC "$srcdir/$subdir/cross1.c" tmpdir/cross1.o] \
unresolved $test1
unresolved $test2
set CFLAGS "$old_CFLAGS"
+ set CC "$old_CC"
return
}
@@ -98,6 +104,7 @@ if [string match "" $exec_output] then {
if { ![ld_compile $CC "$srcdir/$subdir/cross3.c" tmpdir/cross3.o] } {
unresolved $test2
set CFLAGS "$old_CFLAGS"
+ set CC "$old_CC"
return
}
@@ -122,12 +129,14 @@ if [string match "" $exec_output] then {
if { ![ld_compile $CC "$srcdir/$subdir/cross4.c" tmpdir/cross4.o] } {
unresolved $test3
set CFLAGS "$old_CFLAGS"
+ set CC "$old_CC"
return
}
if ![ld_relocate $ld tmpdir/cross3-partial.o "tmpdir/cross1.o tmpdir/cross4.o"] {
unresolved $test3
set CFLAGS "$old_CFLAGS"
+ set CC "$old_CC"
return
}
@@ -145,3 +154,4 @@ if [string match "" $exec_output] then {
}
set CFLAGS "$old_CFLAGS"
+set CC "$old_CC"