[patch 04/20] uml: fix symbol conflict in linking

From: blaisorblade_spam
Date: Wed Nov 03 2004 - 21:58:14 EST



Since arch/um/kernel/tt/unmap_fin.o is linked statically, it could contain
some symbols also contained in the rest of vmlinux; on some systems, this
actually happens (due to some glibc differences).

Since that file *must* be linked statically and then relinked (its code must
remap the whole .text area except the section it is contained in during UML
startup), we cannot change this. So, we use objcopy to turn all symbols into
local ones except for switcheroo(), which is the only function actually
defined in the source (the other ones are brought in during linking).

This shouldn't hurt other systems, while improving the behaviour on affected
ones (there is still another issue I'm trying to fix). And it is logically
always needed (i.e., without this UML has just happened to work until now).

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@xxxxxxxx>
---

vanilla-linux-2.6.9-paolo/arch/um/kernel/tt/Makefile | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff -puN arch/um/kernel/tt/Makefile~uml-link-fix-symbol-conflict arch/um/kernel/tt/Makefile
--- vanilla-linux-2.6.9/arch/um/kernel/tt/Makefile~uml-link-fix-symbol-conflict 2004-11-03 23:44:57.575807264 +0100
+++ vanilla-linux-2.6.9-paolo/arch/um/kernel/tt/Makefile 2004-11-03 23:44:57.577806960 +0100
@@ -4,6 +4,7 @@
#

extra-y := unmap_fin.o
+clean-files := unmap_tmp.o

obj-y = exec_kern.o exec_user.o gdb.o ksyms.o mem.o mem_user.o process_kern.o \
syscall_kern.o syscall_user.o time.o tlb.o tracer.o trap_user.o \
@@ -20,10 +21,9 @@ UNMAP_CFLAGS := $(patsubst -fprofile-arc
$(USER_OBJS) : %.o: %.c
$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<

-$(O_TARGET) : $(obj)/unmap_fin.o
-
$(obj)/unmap.o: $(src)/unmap.c
$(CC) $(UNMAP_CFLAGS) -c -o $@ $<

-$(obj)/unmap_fin.o : $(src)/unmap.o
- ld -r -o $@ $< -lc -L/usr/lib
+$(obj)/unmap_fin.o : $(obj)/unmap.o
+ ld -r -o $(obj)/unmap_tmp.o $< -lc -L/usr/lib
+ objcopy $(obj)/unmap_tmp.o $@ -G switcheroo
_
-
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/