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"
-move-rodata)
MOVDAT="y";; # Put rodata in ROM if possible
-
+ -s) ;; # Ignore -s (strip)
+
-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\(.*\)'`";;
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
then
# Non application modules enter via main not _start
# SEDOP="$SEDOP -e 's/ENTRY (_start)/ENTRY (main)/'"
- SEDOP="$SEDOP -e s/\\(ENTRY.\\)(_start)/\1(lib_main)/"
+ SEDOP="$SEDOP -e s/\\(ENTRY.\\)(@SYMBOL_PREFIX@_start)/\1(lib_main)/"
OBJCOPYOP="--localize-hidden --weaken"
fi
# Provide the magic parameter that defines the library data segment pointer offset
+ GOT_ADJ=4
case "@target_cpu@" in
+ bfin) GOT_OFFSET="_current_shared_library_p5_offset_" GOT_ADJ=1;;
h8300) GOT_OFFSET="__current_shared_library_er5_offset_";;
*) GOT_OFFSET="_current_shared_library_a5_offset_";;
esac
- ARG1="$ARG1 -defsym $GOT_OFFSET=`expr ${SHARED_ID} '*' -4 - 4`"
+ ARG1="$ARG1 -defsym $GOT_OFFSET=`expr ${SHARED_ID} '*' -${GOT_ADJ} - ${GOT_ADJ}`"
fi
if [ "@emit_relocs@" = "yes" ]
then