1997-10-19 15:00:51 +04:00
|
|
|
#!/bin/sh
|
|
|
|
# convert "jbsr" for external symbol to "bsr"
|
|
|
|
# --written by Yasha
|
|
|
|
#
|
|
|
|
# usage: nm foo.o | sh all_bsr.sh foo.s >foo_new.s
|
1998-01-05 23:51:25 +03:00
|
|
|
#
|
|
|
|
# $NetBSD: all_bsr.sh,v 1.2 1998/01/05 20:52:23 perry Exp $
|
1997-10-19 15:00:51 +04:00
|
|
|
|
|
|
|
src="$1"
|
|
|
|
case "$src" in
|
|
|
|
'')
|
|
|
|
echo 'Convert "jbsr" for external symbol to "bsr"' >&2
|
|
|
|
echo "usage: nm foo.o | $0 foo.s >foo_new.s" >&2
|
|
|
|
exit 1;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exts=
|
|
|
|
while read line
|
|
|
|
do
|
|
|
|
set - $line
|
|
|
|
case "$1" in
|
|
|
|
U) exts="$exts $2";;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
sed '
|
|
|
|
/jbsr[ ]/{
|
|
|
|
h
|
|
|
|
s/.*jbsr[ ]*//
|
|
|
|
s/$/:'"$exts"' /
|
|
|
|
/^\([^:]*\):.* \1 /{
|
|
|
|
g
|
|
|
|
s/jbsr[ ]/bsr /
|
|
|
|
p
|
|
|
|
d
|
|
|
|
}
|
|
|
|
g
|
|
|
|
}' "$src"
|