aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2013-01-19 19:36:37 +0000
committerH.J. Lu <hjl.tools@gmail.com>2013-01-19 19:36:37 +0000
commit6738cadcc7b0e5ada20372765a72771dd99efe43 (patch)
treee505794ada35899f1579a6c0498ff2bd97bfa0b0 /ld/testsuite
parent44fc9657c5168eb2e6c116eef7cc709972fcdc0f (diff)
downloadbinutils-6738cadcc7b0e5ada20372765a72771dd99efe43.zip
binutils-6738cadcc7b0e5ada20372765a72771dd99efe43.tar.gz
binutils-6738cadcc7b0e5ada20372765a72771dd99efe43.tar.bz2
Add HOSTING_SCRT0 for PIE test
ld/ * Makefile.am (HOSTING_SCRT0): New. * configure.host (HOSTING_SCRT0): New. Used for PIE. * configure.in (HOSTING_SCRT0): New AC_SUBST. * Makefile.in: Regenerated. * configure: Likewise. ld/testsuite/ * config/default.exp (get_target_emul): Also set HOSTING_SCRT0. * lib/ld-lib.exp (default_ld_link): Use HOSTING_SCRT0 for -pie.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog6
-rw-r--r--ld/testsuite/config/default.exp4
-rw-r--r--ld/testsuite/lib/ld-lib.exp7
3 files changed, 14 insertions, 3 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 70aa059..ee98aaa 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2013-01-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/default.exp (get_target_emul): Also set HOSTING_SCRT0.
+
+ * lib/ld-lib.exp (default_ld_link): Use HOSTING_SCRT0 for -pie.
+
2013-01-18 H.J. Lu <hongjiu.lu@intel.com>
* ld-size/size-10.rd: Updated.
diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp
index bba48d7..d540f19 100644
--- a/ld/testsuite/config/default.exp
+++ b/ld/testsuite/config/default.exp
@@ -139,11 +139,11 @@ proc get_target_emul {} {
}
if [isnative] {
- foreach x {HOSTING_CRT0 HOSTING_LIBS} {
+ foreach x {HOSTING_CRT0 HOSTING_SCRT0 HOSTING_LIBS} {
get_link_files $x
}
} else {
- foreach x {HOSTING_CRT0 HOSTING_LIBS} { set $x "" }
+ foreach x {HOSTING_CRT0 HOSTING_SCRT0 HOSTING_LIBS} { set $x "" }
}
if ![info exists HOSTING_EMU] { set HOSTING_EMU "-m [get_target_emul]" }
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index a3ff2e3..0b156a1 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -179,13 +179,18 @@ proc big_or_little_endian {} {
proc default_ld_link { ld target objects } {
global HOSTING_EMU
global HOSTING_CRT0
+ global HOSTING_SCRT0
global HOSTING_LIBS
global LIBS
global host_triplet
global link_output
global exec_output
- set objs "$HOSTING_CRT0 $objects"
+ if { [ string match "* -pie *" $objects ] } {
+ set objs "$HOSTING_SCRT0 $objects"
+ } else {
+ set objs "$HOSTING_CRT0 $objects"
+ }
set libs "$LIBS $HOSTING_LIBS"
if [is_endian_output_format $objects] then {