summaryrefslogtreecommitdiff
path: root/gcc/exec-tool.in
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/exec-tool.in')
-rw-r--r--gcc/exec-tool.in33
1 files changed, 26 insertions, 7 deletions
diff --git a/gcc/exec-tool.in b/gcc/exec-tool.in
index 6722ce52030..76d0ef65ab1 100644
--- a/gcc/exec-tool.in
+++ b/gcc/exec-tool.in
@@ -21,6 +21,8 @@
ORIGINAL_AS_FOR_TARGET="@ORIGINAL_AS_FOR_TARGET@"
ORIGINAL_LD_FOR_TARGET="@ORIGINAL_LD_FOR_TARGET@"
+ORIGINAL_LD_BFD_FOR_TARGET="@ORIGINAL_LD_BFD_FOR_TARGET@"
+ORIGINAL_LD_GOLD_FOR_TARGET="@ORIGINAL_LD_GOLD_FOR_TARGET@"
ORIGINAL_PLUGIN_LD_FOR_TARGET="@ORIGINAL_PLUGIN_LD_FOR_TARGET@"
ORIGINAL_NM_FOR_TARGET="@ORIGINAL_NM_FOR_TARGET@"
exeext=@host_exeext@
@@ -36,15 +38,32 @@ case "$invoked" in
dir=gas
;;
collect-ld)
- # 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
+ # Check -fuse-ld=bfd and -fuse-ld=gold
+ case " $* " in
+ *\ -fuse-ld=bfd\ *)
+ original=$ORIGINAL_LD_BFD_FOR_TARGET
+ ;;
+ *\ -fuse-ld=gold\ *)
+ original=$ORIGINAL_LD_GOLD_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
+ ;;
+ esac
+ prog=ld-new$exeext
+ if test "$original" = ../gold/ld-new$exeext; then
+ dir=gold
+ # No need to handle relink since gold doesn't use libtool.
+ fast_install=yes
else
- original=$ORIGINAL_LD_FOR_TARGET
+ dir=ld
fi
- prog=ld-new$exeext
- dir=ld
id=ld
;;
nm)