OSDN Git Service

2010-11-13 Paolo Bonzini <bonzini@gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / exec-tool.in
index f585163..020294e 100644 (file)
@@ -21,6 +21,7 @@
 
 ORIGINAL_AS_FOR_TARGET="@ORIGINAL_AS_FOR_TARGET@"
 ORIGINAL_LD_FOR_TARGET="@ORIGINAL_LD_FOR_TARGET@"
+ORIGINAL_PLUGIN_LD_FOR_TARGET="@ORIGINAL_PLUGIN_LD_FOR_TARGET@"
 ORIGINAL_NM_FOR_TARGET="@ORIGINAL_NM_FOR_TARGET@"
 exeext=@host_exeext@
 fast_install=@enable_fast_install@
@@ -34,7 +35,13 @@ case "$invoked" in
     dir=gas
     ;;
   collect-ld)
-    original=$ORIGINAL_LD_FOR_TARGET
+    # when using a linker plugin, gcc will always pass '-plugin' as the
+    # first or second option to the linker.
+    if test x"$1" = "x-plugin" || test x"$2" = "x-plugin"; then
+      original=$ORIGINAL_PLUGIN_LD_FOR_TARGET
+    else
+      original=$ORIGINAL_LD_FOR_TARGET
+    fi
     prog=ld-new$exeext
     dir=ld
     ;;