diff --git a/tools/mksymtab.sh b/tools/mksymtab.sh index e72196791..4f1d7f481 100755 --- a/tools/mksymtab.sh +++ b/tools/mksymtab.sh @@ -21,7 +21,7 @@ export LC_ALL=C -usage="Usage: $0 [symtabprefix]" +usage="Usage: $0 [symtabprefix [additionalsymbolspath]]" # Check for the required directory path @@ -36,6 +36,7 @@ fi # Get the symbol table prefix prefix=$2 +add_sym=$3 # Extract all of the undefined symbols from the ELF files and create a # list of sorted, unique undefined variable names. @@ -59,6 +60,18 @@ if [ -z "$varlist" ]; then fi fi +if [ "x$add_sym" != "x" ]; then + if [ -f $add_sym ]; then + varlist="${varlist}\n$(cat $add_sym)" + elif [ -d $add_sym ]; then + varlist="${varlist}\n$(find $add_sym -type f | xargs cat)" + else + echo $usage + exit 1 + fi + varlist=$(echo -e "${varlist}" | sort -u) +fi + # Now output the symbol table as a structure in a C source file. All # undefined symbols are declared as void* types. If the toolchain does # any kind of checking for function vs. data objects, then this could