aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/lib/ld-lib.exp
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/lib/ld-lib.exp')
-rw-r--r--ld/testsuite/lib/ld-lib.exp7
1 files changed, 6 insertions, 1 deletions
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 {