<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Russell King &lt;rmk+lkml@arm.linux.org.uk&gt;

Check for undefined symbols in vmlinux - these can occur as a result of
assembly coding errors.

Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 25-akpm/Makefile |    8 ++++++++
 1 files changed, 8 insertions(+)

diff -puN Makefile~check-for-undefined-symbols Makefile
--- 25/Makefile~check-for-undefined-symbols	Thu Jul  1 15:42:15 2004
+++ 25-akpm/Makefile	Thu Jul  1 15:42:15 2004
@@ -534,6 +534,8 @@ define cmd_vmlinux__
 endef
 
 #	set -e makes the rule exit immediately on error
+#	Note: Ensure that there are no undefined symbols in the final
+#	linked image.  Not doing this can lead to silent link failures.
 
 define rule_vmlinux__
 	+set -e;							\
@@ -546,6 +548,12 @@ define rule_vmlinux__
 	$(if $($(quiet)cmd_vmlinux__),					\
 	  echo '  $($(quiet)cmd_vmlinux__)' &amp;&amp;) 			\
 	$(cmd_vmlinux__);						\
+	if $(NM) $@ | grep -q '^ *U '; then				\
+		echo 'ldchk: $@: final image has undefined symbols:';	\
+		$(NM) $@ | sed 's/^ *U \(.*\)/  \1/p;d';		\
+		$(RM) -f $@;						\
+		exit 1;							\
+	fi;								\
 	echo 'cmd_$@ := $(cmd_vmlinux__)' &gt; $(@D)/.$(@F).cmd
 endef
 
_
</pre></body></html>