Skip to content

Commit ddaec5f

Browse files
anjiahao1xiaoxiang781216
authored andcommitted
apps/tools/mksymtab.sh:When generating symbols, exclude symbols that dynamic modules in bin/ call each other.
Signed-off-by: anjiahao <[email protected]>
1 parent c0d8a07 commit ddaec5f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tools/mksymtab.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@ varlist=`find $dir -name *-thunk.S 2>/dev/null | xargs grep -h asciz | cut -f3 |
4444
if [ -z "$varlist" ]; then
4545
execlist=`find $dir -type f 2>/dev/null`
4646
if [ ! -z "$execlist" ]; then
47+
48+
# Get all undefined symbol names
4749
varlist=`nm $execlist 2>/dev/null | fgrep ' U ' | sed -e "s/^[ ]*//g" | cut -d' ' -f2 | sort | uniq`
50+
51+
# Get all defined symbol names
52+
deflist=`nm $execlist 2>/dev/null | fgrep -v -e ' U ' -e ':' | sed -e "s/^[0-9a-z]* //g" | cut -d' ' -f2 | sort | uniq`
53+
54+
# Remove the intersection between them, and the remaining symbols are found in the main image
55+
common=`echo "$varlist" | tr ' ' '\n' | grep -Fxf <(echo "$deflist" | tr ' ' '\n') | tr '\n' ' '`
56+
varlist=`echo $varlist | sed "s/$common//g"`
4857
fi
4958
fi
5059

0 commit comments

Comments
 (0)