tools/mksymtab.sh: Support symbol name overriding

The lines start with "," make no effects(as comments)

e.g.
  $ cat exports.txt | grep atan2
  atan2Override,atan2

  $ /PATH/TO/APPS/tools/mksymtab.sh FOO BAR exports.txt | grep atan2
  extern void *atan2Override;
    {"atan2", &atan2Override},

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
wangjianyu3 2024-04-25 19:55:32 +08:00 committed by Xiang Xiao
parent 7f7ff8c7d4
commit d1fc46d978

View File

@ -62,9 +62,9 @@ fi
if [ "x$add_sym" != "x" ]; then
if [ -f $add_sym ]; then
varlist="${varlist}\n$(cat $add_sym)"
varlist="${varlist}\n$(cat $add_sym | grep -v "^,.*")"
elif [ -d $add_sym ]; then
varlist="${varlist}\n$(find $add_sym -type f | xargs cat)"
varlist="${varlist}\n$(find $add_sym -type f | xargs cat | grep -v "^,.*")"
else
echo $usage
exit 1
@ -83,7 +83,7 @@ echo ""
for string in $varlist; do
var=`echo $string | sed -e "s/\"//g"`
echo "extern void *${var};"
echo "extern void *${var/,*/};"
done
echo ""
@ -102,7 +102,7 @@ echo "{"
for string in $varlist; do
var=`echo $string | sed -e "s/\"//g"`
echo " {\"${var}\", &${var}},"
echo " {\"${var/*,/}\", &${var/,*/}},"
done
echo "};"