summaryrefslogtreecommitdiff
path: root/extra/scripts/get-needed-libgcc-objects.sh
diff options
context:
space:
mode:
Diffstat (limited to 'extra/scripts/get-needed-libgcc-objects.sh')
-rwxr-xr-xextra/scripts/get-needed-libgcc-objects.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/extra/scripts/get-needed-libgcc-objects.sh b/extra/scripts/get-needed-libgcc-objects.sh
index 7217ee6ac..79e15dac9 100755
--- a/extra/scripts/get-needed-libgcc-objects.sh
+++ b/extra/scripts/get-needed-libgcc-objects.sh
@@ -19,12 +19,12 @@ echo " partial linking..."
rm -f libc.ldr
$LD -r -o libc.ldr ../crt0.o --whole-archive ../libc.a
-if nm --undefined-only libc.ldr | grep -v "^main$" > sym.need ; then
+if $NM --undefined-only libc.ldr | grep -v "^main$" > sym.need ; then
rm -f obj.need
touch obj.need
for SYM in `cat sym.need | sed -e 's/ U //g'` ; do
- if nm -s $LIBGCC | grep -q $SYM" in " ; then
- nm -s $LIBGCC | grep $SYM" in " | cut -d' ' -f3 >> obj.need
+ if $NM -s $LIBGCC | grep -q $SYM" in " ; then
+ $NM -s $LIBGCC | grep $SYM" in " | cut -d' ' -f3 >> obj.need
else
echo Symbol $SYM needed by libc.a but not found in libgcc.a
fi
@@ -36,7 +36,7 @@ fi
rm -rf tmp-gcc
mkdir tmp-gcc
-(cd tmp-gcc ; ar -x $LIBGCC)
+(cd tmp-gcc ; $AR -x $LIBGCC)
rm -f libgcc.ldr
echo Extracting referenced libgcc.a objects ...
@@ -46,10 +46,10 @@ touch obj.need.0
while [ -s obj.need ] && ! cmp -s obj.need obj.need.0 ; do
(cd tmp-gcc ; cat ../obj.need | xargs $LD -r -o ../libgcc.ldr)
cp obj.need obj.need.0
- if nm --undefined-only libgcc.ldr > sym.need ; then
+ if $NM --undefined-only libgcc.ldr > sym.need ; then
for SYM in `cat sym.need | sed -e 's/ U //g'` ; do
- if nm -s $LIBGCC | grep -q $SYM" in " ; then
- nm -s $LIBGCC | grep $SYM" in " | cut -d' ' -f3 >> obj.need
+ if $NM -s $LIBGCC | grep -q $SYM" in " ; then
+ $NM -s $LIBGCC | grep $SYM" in " | cut -d' ' -f3 >> obj.need
fi
done
fi
@@ -61,7 +61,7 @@ cat obj.need | sort | uniq > obj.need.0
if [ -s obj.need.0 ] ; then
echo Objects added from $LIBGCC:
cat obj.need.0
- (cd tmp-gcc ; cat ../obj.need | xargs ar r ../libgcc-need.a)
+ (cd tmp-gcc ; cat ../obj.need | xargs $AR r ../libgcc-need.a)
else
echo No objects added from $LIBGCC.
fi