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 |
44
44
if [ -z " $varlist " ]; then
45
45
execlist=` find $dir -type f 2> /dev/null`
46
46
if [ ! -z " $execlist " ]; then
47
+
48
+ # Get all undefined symbol names
47
49
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" `
48
57
fi
49
58
fi
50
59
You can’t perform that action at this time.
0 commit comments