]> git.wh0rd.org Git - elf2flt.git/commitdiff
Often build systems will use -shared when creating shared libraries, so
authorDavid McCullough <davidm@snapgear.com>
Thu, 7 May 2009 03:33:32 +0000 (03:33 +0000)
committerDavid McCullough <davidm@snapgear.com>
Thu, 7 May 2009 03:33:32 +0000 (03:33 +0000)
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 <bernds_cb1@t-online.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
ld-elf2flt.in

index 3ca0c7b02d659ef4f2d5e60a0a92889e49687ae7..f3ad80b63f9ca843991e254b50892d969259a9c3 100644 (file)
@@ -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