Re: binutils woes
From: Russell King
Date: Sun Jul 11 2004 - 08:57:48 EST
On Thu, Jul 01, 2004 at 05:52:31PM +0100, Russell King wrote:
> On ARM, we appear to have somewhat of a problem with binutils. At
> least the following binutils suffer from a problem whereby it is
> possible to create programs which contain undefined symbols:
Ok, here's the latest version of the patch. It shouldn't complain
on Sparc64, and neither should it complain while linking the
.tmp_vmlinux* objects - the original regexp on the objdump --syms
output was catching the weak kallsyms symbols.
The only issue with this is that, when a problem is detected, the
reported symbols will also include the Sparc64 register symbols.
===== Makefile 1.500 vs edited =====
--- 1.500/Makefile Tue Jun 29 15:44:49 2004
+++ edited/Makefile Sun Jul 11 14:52:37 2004
@@ -534,6 +534,8 @@
# 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; \
$(if $(filter .tmp_kallsyms%,$^),, \
@@ -545,6 +547,12 @@
$(if $($(quiet)cmd_vmlinux__), \
echo ' $($(quiet)cmd_vmlinux__)' &&) \
$(cmd_vmlinux__); \
+ if $(OBJDUMP) --syms $@ | egrep -q '^([^R]|R[^E]|RE[^G])[^w]*\*UND\*'; then \
+ echo 'ldchk: $@: final image has undefined symbols:'; \
+ $(NM) $@ | sed 's/^ *U \(.*\)/ \1/p;d'; \
+ $(RM) -f $@; \
+ exit 1; \
+ fi; \
echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd
endef
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/