summaryrefslogtreecommitdiffstats
path: root/binutils-2.25/ld/genscripts.sh
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-12-09 17:57:18 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2014-12-09 19:50:14 +0800
commit5e8c1cf25beccac1d22d10dc866912394f42771b (patch)
treeee16b70f804484dc8e434e647e699ab50da2620f /binutils-2.25/ld/genscripts.sh
parent8eebd7953384e6662ca926b003f2cdda8ccd3ee5 (diff)
downloadtoolchain_binutils-5e8c1cf25beccac1d22d10dc866912394f42771b.tar.gz
toolchain_binutils-5e8c1cf25beccac1d22d10dc866912394f42771b.tar.bz2
toolchain_binutils-5e8c1cf25beccac1d22d10dc866912394f42771b.zip
[2.25] sync to a30720e3e633f275250e26f85ccae5dbdddfb6c6
local patches will be re-applied later commit a30720e3e633f275250e26f85ccae5dbdddfb6c6 Author: Alan Modra <amodra@gmail.com> Date: Wed Nov 19 10:30:16 2014 +1030 daily update Change-Id: Ieb2a3f4dd2ecb289ac5305ff08d428b2847494ab
Diffstat (limited to 'binutils-2.25/ld/genscripts.sh')
-rwxr-xr-xbinutils-2.25/ld/genscripts.sh51
1 files changed, 26 insertions, 25 deletions
diff --git a/binutils-2.25/ld/genscripts.sh b/binutils-2.25/ld/genscripts.sh
index f9e7d4ef..499607ab 100755
--- a/binutils-2.25/ld/genscripts.sh
+++ b/binutils-2.25/ld/genscripts.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# genscripts.sh - generate the ld-emulation-target specific files
-# Copyright 2004, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
#
# This file is part of the Gnu Linker.
#
@@ -33,8 +33,7 @@
# enable_initfini_array \
# this_emulation \
# optional:
-# tool_dir \
-# customizer_script
+# tool_dir
#
# Sample usage:
#
@@ -93,14 +92,9 @@ use_sysroot=$1
ENABLE_INITFINI_ARRAY=$2
EMULATION_NAME=$3
TOOL_LIB=$4
-CUSTOMIZER_SCRIPT=$5
-
-if [ "x${CUSTOMIZER_SCRIPT}" = "x" ] ; then
- CUSTOMIZER_SCRIPT=${EMULATION_NAME}
-fi
-CUSTOMIZER_SCRIPT="${srcdir}/emulparams/${CUSTOMIZER_SCRIPT}.sh"
# Include the emulation-specific parameters:
+CUSTOMIZER_SCRIPT="${srcdir}/emulparams/${EMULATION_NAME}.sh"
. ${CUSTOMIZER_SCRIPT}
if test -d ldscripts; then
@@ -160,6 +154,7 @@ append_to_lib_path()
if [ "x${use_sysroot}" = "xyes" ] ; then
lib="=${lib}"
fi
+ skip_lib=no
if test -n "${LIBPATH_SUFFIX}"; then
case "${lib}" in
*${LIBPATH_SUFFIX})
@@ -169,18 +164,27 @@ append_to_lib_path()
*) lib_path1=${lib_path1}:${lib} ;;
esac ;;
*)
- case :${lib_path1}: in
- *:${lib}${LIBPATH_SUFFIX}:*) ;;
- ::) lib_path1=${lib}${LIBPATH_SUFFIX} ;;
- *) lib_path1=${lib_path1}:${lib}${LIBPATH_SUFFIX} ;;
- esac ;;
+ if test -n "${LIBPATH_SUFFIX_SKIP}"; then
+ case "${lib}" in
+ *${LIBPATH_SUFFIX_SKIP}) skip_lib=yes ;;
+ esac
+ fi
+ if test "${skip_lib}" = "no"; then
+ case :${lib_path1}: in
+ *:${lib}${LIBPATH_SUFFIX}:*) ;;
+ ::) lib_path1=${lib}${LIBPATH_SUFFIX} ;;
+ *) lib_path1=${lib_path1}:${lib}${LIBPATH_SUFFIX} ;;
+ esac
+ fi ;;
+ esac
+ fi
+ if test "${skip_lib}" = "no"; then
+ case :${lib_path1}:${lib_path2}: in
+ *:${lib}:*) ;;
+ *::) lib_path2=${lib} ;;
+ *) lib_path2=${lib_path2}:${lib} ;;
esac
fi
- case :${lib_path1}:${lib_path2}: in
- *:${lib}:*) ;;
- *::) lib_path2=${lib} ;;
- *) lib_path2=${lib_path2}:${lib} ;;
- esac
done
fi
}
@@ -224,8 +228,7 @@ case :${lib_path1}:${lib_path2}: in
*) LIB_PATH=${lib_path1}:${lib_path2} ;;
esac
-# For Android, comment out LIB_SEARCH_DIRS.
-#LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'`
+LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'`
# We need it for testsuite.
set $EMULATION_LIBPATH
@@ -291,7 +294,6 @@ LD_FLAG=
DATA_ALIGNMENT=${DATA_ALIGNMENT_}
RELOCATING=" "
( echo "/* Default linker script, for normal executables */"
- echo "/* Modified for Android. */"
. ${CUSTOMIZER_SCRIPT}
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.x
@@ -345,7 +347,6 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then
DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}}
COMBRELOC=ldscripts/${EMULATION_NAME}.xsc.tmp
( echo "/* Script for --shared -z combreloc: shared library, combine & sort relocs */"
- echo "/* Modified for Android. */"
. ${CUSTOMIZER_SCRIPT}
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsc
@@ -406,8 +407,8 @@ if test -n "$GENERATE_AUTO_IMPORT_SCRIPT"; then
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xa
fi
-case " $EMULATION_LIBPATH " in
- *" ${EMULATION_NAME} "*) COMPILE_IN=true;;
+case "$COMPILE_IN: $EMULATION_LIBPATH " in
+ :*" ${EMULATION_NAME} "*) COMPILE_IN=yes;;
esac
# PR ld/5652: