[syslinux] [PATCH 2/4] elflink: Warn about unresolved symbols when creating modules.dep
Matt Fleming
matt at console-pimps.org
Thu Feb 17 14:03:26 PST 2011
From: Matt Fleming <matt.fleming at linux.intel.com>
If, after running elf_gen_dep.sh, there are still some symbols that
are not provided by any of the modules that we built, issue a warning
and list the unresolved symbols.
Signed-off-by: Matt Fleming <matt.fleming at linux.intel.com>
---
elf_gen_dep.sh | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/elf_gen_dep.sh b/elf_gen_dep.sh
index 306034a..abdeb41 100755
--- a/elf_gen_dep.sh
+++ b/elf_gen_dep.sh
@@ -71,9 +71,20 @@ resolve_sym ()
while read symbol
do
- #echo $symbol
- sed -n -e "s/^$symbol <\(.*\)>/\1/p" all.txt >> resolve.tmp
- #grep $symbol all.txt
+ # If no one provides the symbol we're trying to
+ # resolve then add it to the list of unresolved
+ # symbols.
+ grep -q $symbol all.txt
+ if [ $? -ne 0 ]; then
+ # We only need to add the symbol once
+ if [[ ! "$unresolved_symbols" =~ "$symbol" ]]; then
+ unresolved_symbols="$unresolved_symbols $symbol"
+ fi
+ else
+ #echo $symbol
+ sed -n -e "s/^$symbol <\(.*\)>/\1/p" all.txt >> resolve.tmp
+ #grep $symbol all.txt
+ fi
done
rm_cr < resolve.tmp
@@ -108,4 +119,9 @@ done
rm *.txt
rm *.ext
rm *.int
+
+if [ "$unresolved_symbols" ]; then
+ echo "WARNING: These symbols could not be resolved:" $unresolved_symbols
+fi
+
echo ELF modules dependency is bult up, pls check modules.dep!
--
1.7.4
More information about the Syslinux
mailing list