File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,16 @@ varlist=`find $dir -name *-thunk.S 2>/dev/null | xargs grep -h asciz | cut -f3 |
4444if [ -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
4958fi
5059
You can’t perform that action at this time.
0 commit comments