Commit 08f87ca1 authored by Paolo \'Blaisorblade\' Giarrusso's avatar Paolo \'Blaisorblade\' Giarrusso Committed by Linus Torvalds

[PATCH] uml: fix symbol conflict in linking

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: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e75ea3bb
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# #
extra-y := unmap_fin.o 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 \ 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 \ syscall_kern.o syscall_user.o time.o tlb.o tracer.o trap_user.o \
...@@ -20,10 +21,9 @@ UNMAP_CFLAGS := $(patsubst -fprofile-arcs -ftest-coverage,,$(UNMAP_CFLAGS)) ...@@ -20,10 +21,9 @@ UNMAP_CFLAGS := $(patsubst -fprofile-arcs -ftest-coverage,,$(UNMAP_CFLAGS))
$(USER_OBJS) : %.o: %.c $(USER_OBJS) : %.o: %.c
$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $< $(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
$(O_TARGET) : $(obj)/unmap_fin.o
$(obj)/unmap.o: $(src)/unmap.c $(obj)/unmap.o: $(src)/unmap.c
$(CC) $(UNMAP_CFLAGS) -c -o $@ $< $(CC) $(UNMAP_CFLAGS) -c -o $@ $<
$(obj)/unmap_fin.o : $(src)/unmap.o $(obj)/unmap_fin.o : $(obj)/unmap.o
ld -r -o $@ $< -lc -L/usr/lib ld -r -o $(obj)/unmap_tmp.o $< -lc -L/usr/lib
objcopy $(obj)/unmap_tmp.o $@ -G switcheroo
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment