Re: 2.6.8.1-mm1

From: William Lee Irwin III
Date: Tue Aug 17 2004 - 01:21:19 EST


On Mon, Aug 16, 2004 at 02:37:10PM -0700, Andrew Morton wrote:
> handle-undefined-symbols.patch
> Fail if vmlinux contains undefined symbols
> sparc32-ignore-undefined-symbols-with-3-or-more-leading-underscores.patch
> sparc32: ignore undefined symbols with 3 or more leading underscores

Okay, this patch has officially made my shitlist along with whatever
introduced the second check. The following appears to be necessary to
get sparc64 to link, which of course clashes wildly with the UML
changes to get *it* to link.

And why the Hell are we checking twice??? Check #2 lagging behind
check #1 wrt. updates caused a relatively large amount of pain as I had
to scour the whole damn tree for where the Hell check #2 was happening
and that on a relatively slow box as my faster sparc64 box is down until
ambient temperature regulation issues are mitigated by weather.

This scripting crap is fragile and nightmarish. We should probably be
examining the ELF bits directly in C.


-- wli

Index: mm1-2.6.8.1/Makefile
===================================================================
--- mm1-2.6.8.1.orig/Makefile 2004-08-16 21:09:23.000000000 -0700
+++ mm1-2.6.8.1/Makefile 2004-08-16 23:06:39.530357000 -0700
@@ -542,8 +542,29 @@
$(if $($(quiet)cmd_vmlinux__), \
echo ' $($(quiet)cmd_vmlinux__)' &&) \
$(cmd_vmlinux__); \
- if $(OBJDUMP) --syms $@ | $(AWK) '$$4!~/^___.*/ { print $$0 }' \
- | egrep -q '^([^R]|R[^E]|RE[^G])[^w]*\*UND\*'; then \
+ if $(OBJDUMP) --syms $@ \
+ | $(AWK) 'BEGIN { \
+ status = 1 \
+ } \
+ $$4 !~ /^___.*/ && $$1 !~ /^REG.*/ { \
+ for (i = 0; i < NF; ++i) { \
+ if ($$i == "*UND*") { \
+ for (j = i - 1; j >= 0; --j) { \
+ if ($$j == "w") \
+ break; \
+ } \
+ if (j < 0) { \
+ printf "undefined!!\n"; \
+ print $$0; \
+ status = 0 \
+ } \
+ } \
+ } \
+ } \
+ END { \
+ exit status \
+ }'; \
+ then \
echo 'ldchk: $@: final image has undefined symbols:'; \
$(NM) $@ | sed 's/^ *U \(.*\)/ \1/p;d'; \
$(RM) -f $@; \
Index: mm1-2.6.8.1/scripts/mksysmap
===================================================================
--- mm1-2.6.8.1.orig/scripts/mksysmap 2004-08-16 21:07:48.000000000 -0700
+++ mm1-2.6.8.1/scripts/mksysmap 2004-08-16 23:07:40.852035000 -0700
@@ -18,9 +18,31 @@
# they are used by the sparc BTFIXUP logic - and is assumed to be undefined.


-if [ "`$NM -u $1 | grep -v ' ___'`" != "" ]; then
- echo "$1: error: undefined symbol(s) found:"
- $NM -u $1 | grep -v ' ___'
+if $(OBJDUMP) --syms $@ \
+ | $(AWK) 'BEGIN { \
+ status = 1 \
+ } \
+ $$4 !~ /^___.*/ && $$1 !~ /^REG.*/ { \
+ for (i = 0; i < NF; ++i) { \
+ if ($$i == "*UND*") { \
+ for (j = i - 1; j >= 0; --j) { \
+ if ($$j == "w") \
+ break; \
+ } \
+ if (j < 0) { \
+ printf "undefined!!\n"; \
+ print $$0; \
+ status = 0 \
+ } \
+ } \
+ } \
+ } \
+ END { \
+ exit status \
+ }'; \
+ then
+ echo "$1: error: undefined symbol(s) found:"
+ $NM -u $1 | grep -v ' ___'
exit 1
fi

-
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/