Index: osprey/driver/phases.c
===================================================================
--- osprey/driver/phases.c	(revision 3445)
+++ osprey/driver/phases.c	(working copy)
@@ -1796,9 +1796,16 @@
 		if ((shared != DSO_SHARED) && (shared != RELOCATABLE)
 		    && ! option_was_seen(O_nostartfiles)) 
 		{
-			add_string(args, find_crt_path("crt1.o"));
+			if (option_was_seen(O_pie)  ||
+			    option_was_seen(O_fpie) || option_was_seen(O_fPIE)) {
+			  add_string(args, find_crt_path("Scrt1.o"));
+			  add_string(args, find_crt_path("crtbeginS.o"));
+			}
+			else {
+			  add_string(args, find_crt_path("crt1.o"));
+			  add_string(args, find_crt_path("crtbegin.o"));
+			}
 			add_string(args, find_crt_path("crti.o"));
-			add_string(args, find_crt_path("crtbegin.o"));
 			if (ftz_crt) {
 				add_string(args, find_obj_path("ftz.o"));
 			}
@@ -2246,7 +2253,11 @@
 #else
 	if (ipa == TRUE) {
 	  if (shared != DSO_SHARED && shared != RELOCATABLE) {
-	    add_string(args, find_crt_path("crtend.o"));
+	    if (option_was_seen(O_pie)  ||
+	        option_was_seen(O_fpie) || option_was_seen(O_fPIE))
+	      add_string(args, find_crt_path("crtendS.o"));
+	    else
+	      add_string(args, find_crt_path("crtend.o"));
 #ifndef TARG_SL
 	    add_string(args, find_crt_path("crtn.o"));
 #endif
Index: osprey/ipa/common/ipc_compile.cxx
===================================================================
--- osprey/ipa/common/ipc_compile.cxx	(revision 3445)
+++ osprey/ipa/common/ipc_compile.cxx	(working copy)
@@ -902,9 +902,12 @@
       const char *p;
 #ifndef TARG_SL // jczhang: use slcc specific crt*.o
       if (((p = strstr(*i, "/crt1.o")) && p[7] == '\0') ||
+          ((p = strstr(*i, "/Scrt1.o")) && p[8] == '\0') ||
 	  ((p = strstr(*i, "/crti.o")) && p[7] == '\0') ||
 	  ((p = strstr(*i, "/crtbegin.o")) && p[11] == '\0') ||
+          ((p = strstr(*i, "/crtbeginS.o")) && p[12] == '\0') ||
 	  ((p = strstr(*i, "/crtend.o")) && p[9] == '\0') ||
+          ((p = strstr(*i, "/crtendS.o")) && p[10] == '\0') ||
 	  ((p = strstr(*i, "/crtn.o")) && p[7] == '\0')) {
 	continue;
       }
