From: David McCullough Date: Thu, 7 May 2009 03:33:32 +0000 (+0000) Subject: Often build systems will use -shared when creating shared libraries, so X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=583221112a242102e0d6c19151254110fbb3fbc3;p=elf2flt.git Often build systems will use -shared when creating shared libraries, so don't barf on the flag when we see it. This makes porting efforts easier. As a sanity check, make sure we see the -shared-lib-id flag when creating a shared library. Signed-off-by: Bernd Schmidt Signed-off-by: Mike Frysinger --- diff --git a/ld-elf2flt.in b/ld-elf2flt.in index 3ca0c7b..f3ad80b 100644 --- a/ld-elf2flt.in +++ b/ld-elf2flt.in @@ -22,6 +22,7 @@ OBJDUMP="`expr $OBJCOPY : '\(.*\)objcopy'`objdump" LDSCRIPTPATH="@binutils_ldscript_dir@" # and the scripts SHARED_ID="" NEWLDSCRIPT="" +WANT_SHARED="" # check TOOLDIR from prefix/bin/ or prefix/target-alias/bin/ [ -d "${LDSCRIPTPATH}" ] || LDSCRIPTPATH="${TOOLDIR}/../lib" @@ -56,6 +57,8 @@ then -shared-lib-id) shift; SHARED_ID="$1";; # Shared library ID + -shared|-G) + WANT_SHARED="y";; # Shared library -o) shift; OFILE="$1";; # the final outfile -o*) OFILE="`expr \"$1\" : '-o\(.*\)'`";; @@ -91,6 +94,14 @@ then shift done + if [ "$WANT_SHARED" = "y" ] + then + if [ -z "$SHARED_ID" ] + then + echo "-shared used without passing a shared library ID" + exit 1 + fi + fi if [ "$FINAL" = "yes" ] then [ "$VERBOSE" = "y" ] && set -x