Skip to contentSkip to conversation

UML - Clean up tt mode remapping of UML binary

PATCH In review Jeff Dike 4 participants 9 messages Jun 6, 2005 – Jun 7, 2005 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 3/5 UML - Clean up tt mode remapping of UML binary

From Al Viro - this turns the tt mode remapping of the binary into arch code.

arch/um/Makefile +1 -1
Index: linux-2.6.12-rc/arch/um/Makefile
===================================================================
@@ -119,7 +119,7 @@ ifndef START
   START = $$(($(TOP_ADDR) - $(SIZE)))
 endif
 
-CPPFLAGS_vmlinux.lds = $(shell echo -U$(SUBARCH) \
+CPPFLAGS_vmlinux.lds = $(shell echo -U$(SUBARCH) -I$(SYS_DIR) \
 	-DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \
 	-DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE-y) \
 	-DKERNEL_STACK_SIZE=$(STACK_SIZE))
arch/um/include/sysdep-i386/unmap.lds +14 -0
Index: linux-2.6.12-rc/arch/um/include/sysdep-i386/unmap.lds
===================================================================
@@ -0,0 +1,14 @@
+  .thread_private : {
+    __start_thread_private = .;
+    errno = .;
+    . += 4;
+    arch/um/sys-i386/unmap_fin.o (.bss)
+    __end_thread_private = .;
+  }
+  . = ALIGN(4096);
+  .remap : { arch/um/sys-i386/unmap_fin.o (.text) }
+
+  /* We want it only if we are in MODE_TT. In both cases, however, when MODE_TT
+   * is off the resulting binary segfaults.*/
+
+  . = ALIGN(4096);		/* Init code and data */
arch/um/include/sysdep-x86_64/unmap.lds +6 -0
Index: linux-2.6.12-rc/arch/um/include/sysdep-x86_64/unmap.lds
===================================================================
@@ -0,0 +1,6 @@
+  . = ALIGN(4096);		/* Init code and data */
+  .remap : {
+	arch/um/sys-x86_64/unmap_fin.o (.bss)
+	arch/um/sys-x86_64/unmap_fin.o (.text)
+  }
+  . = ALIGN(4096);		/* Init code and data */
arch/um/kernel/tt/Makefile +0 -15
Index: linux-2.6.12-rc/arch/um/kernel/tt/Makefile
===================================================================
@@ -3,10 +3,6 @@
 # Licensed under the GPL
 #
 
-extra-y := unmap_fin.o
-targets := unmap.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 \
 	uaccess.o uaccess_user.o
@@ -16,14 +12,3 @@ obj-$(CONFIG_PT_PROXY) += gdb_kern.o ptp
 USER_OBJS := gdb.o time.o tracer.o
 
 include arch/um/scripts/Makefile.rules
-
-UNMAP_CFLAGS := $(patsubst -pg -DPROFILING,,$(USER_CFLAGS))
-UNMAP_CFLAGS := $(patsubst -fprofile-arcs -ftest-coverage,,$(UNMAP_CFLAGS))
-
-#XXX: partially copied from arch/um/scripts/Makefile.rules
-$(obj)/unmap.o: c_flags = -Wp,-MD,$(depfile) $(UNMAP_CFLAGS)
-
-$(obj)/unmap_fin.o : $(obj)/unmap.o
-	$(LD) -r -o $(obj)/unmap_tmp.o $< $(shell $(CC) -print-file-name=libc.a)
-	$(OBJCOPY) $(obj)/unmap_tmp.o $@ -G switcheroo
-
arch/um/kernel/tt/unmap.c +0 -31
Index: linux-2.6.12-rc/arch/um/kernel/tt/unmap.c
===================================================================
@@ -1,31 +0,0 @@
-/* 
- * Copyright (C) 2000 Jeff Dike ([email protected])
- * Licensed under the GPL
- */
-
-#include <sys/mman.h>
-
-int switcheroo(int fd, int prot, void *from, void *to, int size)
-{
-	if(munmap(to, size) < 0){
-		return(-1);
-	}
-	if(mmap(to, size, prot,	MAP_SHARED | MAP_FIXED, fd, 0) != to){
-		return(-1);
-	}
-	if(munmap(from, size) < 0){
-		return(-1);
-	}
-	return(0);
-}
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only.  This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
arch/um/kernel/uml.lds.S +1 -14
Index: linux-2.6.12-rc/arch/um/kernel/uml.lds.S
===================================================================
@@ -15,20 +15,7 @@ SECTIONS
    * is remapped.*/
   __binary_start = .;
 #ifdef MODE_TT
-  .thread_private : {
-    __start_thread_private = .;
-    errno = .;
-    . += 4;
-    arch/um/kernel/tt/unmap_fin.o (.data)
-    __end_thread_private = .;
-  }
-  . = ALIGN(4096);
-  .remap : { arch/um/kernel/tt/unmap_fin.o (.text) }
-
-  /* We want it only if we are in MODE_TT. In both cases, however, when MODE_TT
-   * is off the resulting binary segfaults.*/
-
-  . = ALIGN(4096);		/* Init code and data */
+#include <unmap.lds>
 #endif
 
   _stext = .;
arch/um/scripts/Makefile.rules +5 -0
Index: linux-2.6.12-rc/arch/um/scripts/Makefile.rules
===================================================================
@@ -10,6 +10,11 @@ USER_OBJS := $(foreach file,$(USER_OBJS)
 $(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) \
 	$(CFLAGS_$(notdir $@))
 
+# The stubs and unmap.o can't try to call mcount or update basic block data
+define unprofile
+	$(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1)))
+endef
+
 quiet_cmd_make_link = SYMLINK $@
 cmd_make_link       = ln -sf $(srctree)/arch/$(SUBARCH)/$($(notdir $@)-dir)/$(notdir $@) $@
 
arch/um/sys-i386/Makefile +4 -0
Index: linux-2.6.12-rc/arch/um/sys-i386/Makefile
===================================================================
@@ -2,6 +2,8 @@ obj-y = bitops.o bugs.o checksum.o delay
 	ptrace_user.o semaphore.o signal.o sigcontext.o syscalls.o sysrq.o \
 	sys_call_table.o
 
+extra-$(CONFIG_MODE_TT) := unmap_fin.o
+
 obj-$(CONFIG_HIGHMEM) += highmem.o
 obj-$(CONFIG_MODULES) += module.o
 
@@ -16,4 +18,6 @@ semaphore.c-dir = kernel
 highmem.c-dir = mm
 module.c-dir = kernel
 
+$(obj)/unmap_fin.o : _c_flags = $(call unprofile,$(CFLAGS))
+
 subdir- := util
arch/um/sys-i386/unmap_fin.c +25 -0
Index: linux-2.6.12-rc/arch/um/sys-i386/unmap_fin.c
===================================================================
@@ -0,0 +1,25 @@
+/* 
+ * Copyright (C) 2000 Jeff Dike ([email protected])
+ * Licensed under the GPL
+ */
+
+#include <linux/mman.h>
+#include <asm/unistd.h>
+
+static int errno;
+
+static inline _syscall2(int,munmap,void *,start,size_t,len)
+static inline _syscall6(void *,mmap2,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset)
+int switcheroo(int fd, int prot, void *from, void *to, int size)
+{
+        if(munmap(to, size) < 0){
+                return(-1);
+        }
+        if(mmap2(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){
+                return(-1);
+        }
+        if(munmap(from, size) < 0){
+                return(-1);
+        }
+        return(0);
+}
arch/um/sys-x86_64/Makefile +4 -0
Index: linux-2.6.12-rc/arch/um/sys-x86_64/Makefile
===================================================================
@@ -4,6 +4,8 @@
 # Licensed under the GPL
 #
 
+extra-$(CONFIG_MODE_TT) := unmap_fin.o
+
 #XXX: why into lib-y?
 lib-y = bitops.o bugs.o csum-partial.o delay.o fault.o mem.o memcpy.o \
 	ptrace.o ptrace_user.o semaphore.o sigcontext.o signal.o \
@@ -29,3 +31,5 @@ thunk.S-dir = lib
 module.c-dir = kernel
 
 subdir- := util
+
+$(obj)/unmap_fin.o: _c_flags = $(call unprofile,$(CFLAGS))
arch/um/sys-x86_64/unmap_fin.c +25 -0
Index: linux-2.6.12-rc/arch/um/sys-x86_64/unmap_fin.c
===================================================================
@@ -0,0 +1,25 @@
+/* 
+ * Copyright (C) 2000 Jeff Dike ([email protected])
+ * Licensed under the GPL
+ */
+
+#include <linux/mman.h>
+#include <asm/unistd.h>
+
+static int errno;
+
+static inline _syscall2(int,munmap,void *,start,size_t,len)
+static inline _syscall6(void *,mmap,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset)
+int switcheroo(int fd, int prot, void *from, void *to, int size)
+{
+        if(munmap(to, size) < 0){
+                return(-1);
+        }
+        if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){
+                return(-1);
+        }
+        if(munmap(from, size) < 0){
+                return(-1);
+        }
+        return(0);
+}

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
Quoted 2 lines · Jeff Dike

From Al Viro - this turns the tt mode remapping of the binary into arch code.

NACK at all, definitely, don't apply this one please. This patch:

1) On i386 does not fix the problem it was supposed to fix when I originately sent the first version (i.e. avoiding to create a .thread_private section to allow linking against NPTL glibc). It's done on x86_64 and forgot on i386.
2) Splitting the linker script for subarchs is definitely not needed.
3) This removes the fix (done through objcopy -G switcheroo) to a link time conflict happening on some weird glibc combinations.

I'll merge this work when it's ready.

Quoted 1 line
Signature · 20 lines
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

		
___________________________________ 
Yahoo! Messenger: chiamate gratuite in tutto il mondo 
http://it.beta.messenger.yahoo.com



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#2 lore raw
Quoted 8 lines · Blaisorblade
Quoted 2 lines · Jeff Dike

From Al Viro - this turns the tt mode remapping of the binary into arch code.

NACK at all, definitely, don't apply this one please. This patch:

1) On i386 does not fix the problem it was supposed to fix when I originately sent the first version (i.e. avoiding to create a .thread_private section to allow linking against NPTL glibc). It's done on x86_64 and forgot on i386.

True. i386 still assumes non-NPTL (as it is on the box I'm working on - such setups *do* exist).

Quoted 1 line

2) Splitting the linker script for subarchs is definitely not needed.

Per-subarch - perhaps not. Per-glibc-type - definitely needed.

Quoted 2 lines

3) This removes the fix (done through objcopy -G switcheroo) to a link time conflict happening on some weird glibc combinations.

*What* link-time conflict? We don't link libc into switcheroo anymore.

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#3 lore raw
Quoted 7 lines · Al Viro
Quoted 6 lines · Blaisorblade
Quoted 2 lines · Jeff Dike

From Al Viro - this turns the tt mode remapping of the binary into arch code.

NACK at all, definitely, don't apply this one please. This patch:

Quoted 7 lines
Quoted 4 lines

1) On i386 does not fix the problem it was supposed to fix when I originately sent the first version (i.e. avoiding to create a .thread_private section to allow linking against NPTL glibc). It's done on x86_64 and forgot on i386.

True. i386 still assumes non-NPTL (as it is on the box I'm working on - such setups *do* exist).

Yes, it's the most common one, and it's even the setup for my box currently.

Quoted 3 lines
Quoted 1 line

2) Splitting the linker script for subarchs is definitely not needed.

Per-subarch - perhaps not. Per-glibc-type - definitely needed.

No, because the setup for NPTL glibc works also on non-NPTL one. Actually, to be exact, I've tested it *only* on normal glibc. I'm still waiting to get some testing in NPTL environments, but I expect it to work.

Quoted 4 lines
Quoted 2 lines

3) This removes the fix (done through objcopy -G switcheroo) to a link time conflict happening on some weird glibc combinations.

*What* link-time conflict? We don't link libc into switcheroo anymore.

Hmm, yes, I noted this... and maybe it could even be good (it makes sense, at least). Probably you are right on this, too.

P.S: is it only me or you've sent about 20 copies of your last message?

Signature · 11 lines
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it
#4 lore raw
Quoted 4 lines · Blaisorblade
Quoted 1 line

Per-subarch - perhaps not. Per-glibc-type - definitely needed.

No, because the setup for NPTL glibc works also on non-NPTL one. Actually, to be exact, I've tested it *only* on normal glibc. I'm still waiting to get some testing in NPTL environments, but I expect it to work.

Now, that is interesting. Which script are you using for i386 and which libc version does it work with?

Quoted 1 line

P.S: is it only me or you've sent about 20 copies of your last message?

Headers?

#5 lore raw
Quoted 10 lines · Al Viro
Quoted 6 lines · Blaisorblade
Quoted 1 line

Per-subarch - perhaps not. Per-glibc-type - definitely needed.

No, because the setup for NPTL glibc works also on non-NPTL one. Actually, to be exact, I've tested it *only* on normal glibc. I'm still waiting to get some testing in NPTL environments, but I expect it to work.

Now, that is interesting. Which script are you using for i386 and which libc version does it work with?

The one I sent originally didn't work because I had been lazy (used .data instead of .bss), but only for that. Well, there were another zillion of problems, but now it works.

Quoted 3 lines
Quoted 1 line

P.S: is it only me or you've sent about 20 copies of your last message?

Headers?

The Message-ID seem to match, so guess it's my Kmail (never seen such a problem, though).

Message-ID: <[email protected]>
References: <[email protected]> <[email protected]>

Signature · 3 lines
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

From: Paolo 'Blaisorblade' Giarrusso <[email protected]>, Al Viro <[email protected]>

To make sure switcheroo() can execute when we remap all the executable image, we used a trick to make it use a local copy of errno... this trick does not work with NPTL glibc, only with LinuxThreads, so use another (simpler) one to make it work anyway.

Hopefully, a lot improved thanks to merging with the version of Al Viro (which had his part of problems, though, i.e. removing a fix to another bug and not fixing the problem on i386).

---

 linux-2.6.git-paolo/arch/um/Makefile               |    2 -
 linux-2.6.git-paolo/arch/um/kernel/tt/Makefile     |   15 ----------
 linux-2.6.git-paolo/arch/um/kernel/uml.lds.S       |   15 ++--------
 linux-2.6.git-paolo/arch/um/scripts/Makefile.rules |    6 ++++
 linux-2.6.git-paolo/arch/um/scripts/Makefile.unmap |   22 ++++++++++++++
 linux-2.6.git-paolo/arch/um/sys-i386/Makefile      |    2 +
 linux-2.6.git-paolo/arch/um/sys-i386/unmap.c       |   25 ++++++++++++++++
 linux-2.6.git-paolo/arch/um/sys-x86_64/Makefile    |    2 +
 linux-2.6.git-paolo/arch/um/sys-x86_64/unmap.c     |   25 ++++++++++++++++
 linux-2.6.git/arch/um/kernel/tt/unmap.c            |   31 ---------------------
 10 files changed, 86 insertions(+), 59 deletions(-)
arch/um/kernel/tt/unmap.c deleted +0 -31
diff -L arch/um/kernel/tt/unmap.c -puN arch/um/kernel/tt/unmap.c~uml-link-tt-mode-against-nptl /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Copyright (C) 2000 Jeff Dike ([email protected])
- * Licensed under the GPL
- */
-
-#include <sys/mman.h>
-
-int switcheroo(int fd, int prot, void *from, void *to, int size)
-{
-	if(munmap(to, size) < 0){
-		return(-1);
-	}
-	if(mmap(to, size, prot,	MAP_SHARED | MAP_FIXED, fd, 0) != to){
-		return(-1);
-	}
-	if(munmap(from, size) < 0){
-		return(-1);
-	}
-	return(0);
-}
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only.  This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
arch/um/kernel/uml.lds.S renamed from arch/um/kernel/uml.lds.S~uml-link-tt-mode-against-nptl +3 -12
diff -puN arch/um/kernel/uml.lds.S~uml-link-tt-mode-against-nptl arch/um/kernel/uml.lds.S
@@ -14,19 +14,10 @@ SECTIONS
   /* Used in arch/um/kernel/mem.c. Any memory between START and __binary_start
    * is remapped.*/
   __binary_start = .;
-#ifdef MODE_TT
-  .thread_private : {
-    __start_thread_private = .;
-    errno = .;
-    . += 4;
-    arch/um/kernel/tt/unmap_fin.o (.data)
-    __end_thread_private = .;
-  }
-  . = ALIGN(4096);
-  .remap : { arch/um/kernel/tt/unmap_fin.o (.text) }
 
-  /* We want it only if we are in MODE_TT. In both cases, however, when MODE_TT
-   * is off the resulting binary segfaults.*/
+#ifdef MODE_TT
+  .remap_data : { arch/um/sys-SUBARCH/unmap_fin.o (.data .bss) }
+  .remap : { arch/um/sys-SUBARCH/unmap_fin.o (.text) }
 
   . = ALIGN(4096);		/* Init code and data */
 #endif
arch/um/sys-i386/unmap.c new file +25 -0
diff -puN /dev/null arch/um/sys-i386/unmap.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2000 Jeff Dike ([email protected])
+ * Licensed under the GPL
+ */
+
+#include <linux/mman.h>
+#include <asm/unistd.h>
+
+static int errno;
+
+static inline _syscall2(int,munmap,void *,start,size_t,len)
+static inline _syscall6(void *,mmap2,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset)
+int switcheroo(int fd, int prot, void *from, void *to, int size)
+{
+	if(munmap(to, size) < 0){
+		return(-1);
+	}
+	if(mmap2(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){
+		return(-1);
+	}
+	if(munmap(from, size) < 0){
+		return(-1);
+	}
+	return(0);
+}
arch/um/sys-x86_64/unmap.c new file +25 -0
diff -puN /dev/null arch/um/sys-x86_64/unmap.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2000 Jeff Dike ([email protected])
+ * Licensed under the GPL
+ */
+
+#include <linux/mman.h>
+#include <asm/unistd.h>
+
+static int errno;
+
+static inline _syscall2(int,munmap,void *,start,size_t,len)
+static inline _syscall6(void *,mmap,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset)
+int switcheroo(int fd, int prot, void *from, void *to, int size)
+{
+	if(munmap(to, size) < 0){
+		return(-1);
+	}
+	if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){
+		return(-1);
+	}
+	if(munmap(from, size) < 0){
+		return(-1);
+	}
+	return(0);
+}
arch/um/kernel/tt/Makefile renamed from arch/um/kernel/tt/Makefile~uml-link-tt-mode-against-nptl +0 -15
diff -puN arch/um/kernel/tt/Makefile~uml-link-tt-mode-against-nptl arch/um/kernel/tt/Makefile
@@ -3,10 +3,6 @@
 # Licensed under the GPL
 #
 
-extra-y := unmap_fin.o
-targets := unmap.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 \
 	uaccess.o uaccess_user.o
@@ -16,14 +12,3 @@ obj-$(CONFIG_PT_PROXY) += gdb_kern.o ptp
 USER_OBJS := gdb.o time.o tracer.o
 
 include arch/um/scripts/Makefile.rules
-
-UNMAP_CFLAGS := $(patsubst -pg -DPROFILING,,$(USER_CFLAGS))
-UNMAP_CFLAGS := $(patsubst -fprofile-arcs -ftest-coverage,,$(UNMAP_CFLAGS))
-
-#XXX: partially copied from arch/um/scripts/Makefile.rules
-$(obj)/unmap.o: c_flags = -Wp,-MD,$(depfile) $(UNMAP_CFLAGS)
-
-$(obj)/unmap_fin.o : $(obj)/unmap.o
-	$(LD) -r -o $(obj)/unmap_tmp.o $< $(shell $(CC) -print-file-name=libc.a)
-	$(OBJCOPY) $(obj)/unmap_tmp.o $@ -G switcheroo
-
arch/um/sys-i386/Makefile renamed from arch/um/sys-i386/Makefile~uml-link-tt-mode-against-nptl +2 -0
diff -puN arch/um/sys-i386/Makefile~uml-link-tt-mode-against-nptl arch/um/sys-i386/Makefile
@@ -17,3 +17,5 @@ highmem.c-dir = mm
 module.c-dir = kernel
 
 subdir- := util
+
+include arch/um/scripts/Makefile.unmap
arch/um/sys-x86_64/Makefile renamed from arch/um/sys-x86_64/Makefile~uml-link-tt-mode-against-nptl +2 -0
diff -puN arch/um/sys-x86_64/Makefile~uml-link-tt-mode-against-nptl arch/um/sys-x86_64/Makefile
@@ -29,3 +29,5 @@ thunk.S-dir = lib
 module.c-dir = kernel
 
 subdir- := util
+
+include arch/um/scripts/Makefile.unmap
arch/um/scripts/Makefile.unmap new file +22 -0
diff -puN /dev/null arch/um/scripts/Makefile.unmap
@@ -0,0 +1,22 @@
+clean-files += unmap_tmp.o unmap_fin.o unmap.o
+
+ifdef CONFIG_MODE_TT
+
+#Always build unmap_fin.o
+extra-y += unmap_fin.o
+#Do dependency tracking for unmap.o (it will be always built, but won't get the tracking unless we use this).
+targets += unmap.o
+
+#XXX: partially copied from arch/um/scripts/Makefile.rules
+$(obj)/unmap.o: _c_flags = $(call unprofile,$(CFLAGS))
+
+quiet_cmd_wrapld = LD      $@
+define cmd_wrapld
+	$(LD) -r -o $(obj)/unmap_tmp.o $< $(shell $(CC) -print-file-name=libc.a); \
+	$(OBJCOPY) $(obj)/unmap_tmp.o $@ -G switcheroo
+endef
+
+$(obj)/unmap_fin.o : $(obj)/unmap.o FORCE
+	$(call if_changed,wrapld)
+
+endif
arch/um/Makefile renamed from arch/um/Makefile~uml-link-tt-mode-against-nptl +1 -1
diff -puN arch/um/Makefile~uml-link-tt-mode-against-nptl arch/um/Makefile
@@ -118,7 +118,7 @@ endif
 CPPFLAGS_vmlinux.lds = $(shell echo -U$(SUBARCH) \
 	-DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \
 	-DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE-y) \
-	-DKERNEL_STACK_SIZE=$(STACK_SIZE))
+	-DKERNEL_STACK_SIZE=$(STACK_SIZE) -DSUBARCH=$(SUBARCH))
 
 #The wrappers will select whether using "malloc" or the kernel allocator.
 LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
arch/um/scripts/Makefile.rules renamed from arch/um/scripts/Makefile.rules~uml-link-tt-mode-against-nptl +6 -0
diff -puN arch/um/scripts/Makefile.rules~uml-link-tt-mode-against-nptl arch/um/scripts/Makefile.rules
@@ -10,6 +10,12 @@ USER_OBJS := $(foreach file,$(USER_OBJS)
 $(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) \
 	$(CFLAGS_$(notdir $@))
 
+# The stubs and unmap.o can't try to call mcount or update basic block data
+define unprofile
+	$(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1)))
+endef
+
+
 quiet_cmd_make_link = SYMLINK $@
 cmd_make_link       = ln -sf $(srctree)/arch/$(SUBARCH)/$($(notdir $@)-dir)/$(notdir $@) $@
 

_

author
#8 lore raw
In reply to Blaisorblade
Quoted 10 lines · Blaisorblade

NACK at all, definitely, don't apply this one please. This patch:

1) On i386 does not fix the problem it was supposed to fix when I originately sent the first version (i.e. avoiding to create a .thread_private section to allow linking against NPTL glibc). It's done on x86_64 and forgot on i386.
2) Splitting the linker script for subarchs is definitely not needed.
3) This removes the fix (done through objcopy -G switcheroo) to a link time conflict happening on some weird glibc combinations.

I'll merge this work when it's ready.

OK, Andrew, just drop this one for now.

Jeff

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

author
#7 lore raw
In reply to Al Viro
Quoted 3 lines · Al Viro
Quoted 1 line

P.S: is it only me or you've sent about 20 copies of your last message?

Headers?

I got 18 copies.

Something horrible happened at Intel:

Received: from orsfmr005.jf.intel.com (fmr20.intel.com [134.134.136.19])

        by saraswathi.solana.com (8.13.1/8.13.1) with ESMTP id j570cDAU017960 
        for <[email protected]>; Mon, 6 Jun 2005 20:38:18 -0400
Received: from orsfmr101.jf.intel.com (orsfmr101.jf.intel.com [10.7.209.17])
        by orsfmr005.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1
+2004/09/17 17:50:56 root Exp $) with ESMTP id j570c60S009128;
        Tue, 7 Jun 2005 00:38:06 GMT
Received: from orsmsxvs041.jf.intel.com (orsmsxvs041.jf.intel.com
+[192.168.65.54])
        by orsfmr101.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2
+2004/09/17 18:05:01 root Exp $) with SMTP id j570c6OK009846;
        Tue, 7 Jun 2005 00:38:06 GMT

Received: from orsmsx332.amr.corp.intel.com ([192.168.65.60])
by orsmsxvs041.jf.intel.com (SAVSMTP 3.1.7.47) with SMTP id
+M2005060617380513306
; Mon, 06 Jun 2005 17:38:05 -0700
Received: from mail pickup service by orsmsx332.amr.corp.intel.com with

+Microsoft SMTPSVC;
         Mon, 6 Jun 2005 17:38:04 -0700
Received: from orsmsxvs041.jf.intel.com ([192.168.65.54]) by
+orsmsx332.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.211);
         Mon, 6 Jun 2005 17:11:02 -0700

Received: from orsfmr100.jf.intel.com ([10.7.209.16])
by orsmsxvs041.jf.intel.com (SAVSMTP 3.1.7.47) with SMTP id
+M2005060617110210382
for <[email protected]>; Mon, 06 Jun 2005 17:11:02 -0700
Received: from orsfmr004.jf.intel.com (orsfmr004.jf.intel.com [10.7.208.20])

        by orsfmr100.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2
+2004/09/17 18:05:01 root Exp $) with ESMTP id j570B2qr012933
        for <[email protected]>; Tue, 7 Jun 2005 00:11:02 GMT
Received: from vger.kernel.org (vger.kernel.org [12.107.209.244])
        by orsfmr004.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1
+2004/09/17 17:50:56 root Exp $) with ESMTP id j570AlTq014175
        for <[email protected]>; Tue, 7 Jun 2005 00:11:01 GMT

This looks like it was intended for Suresh (hi!), but Intel forwarded it back to my server.

The others are the same, except they involve different Intel people, some of whom I know, some I don't :-)

Jeff

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#6 lore raw
In reply to Blaisorblade
Quoted 10 lines · Blaisorblade
Quoted 3 lines
Quoted 1 line

P.S: is it only me or you've sent about 20 copies of your last message?

Headers?

The Message-ID seem to match, so guess it's my Kmail (never seen such a problem, though).

Message-ID: <[email protected]>
References: <[email protected]> <[email protected]>

I got about 20 copies of that message too. There's some kind of loop going through Intel's servers, the message headers are progressively longer variants of:

Return-Path: <[email protected]>
Received: from lists-outbound.sourceforge.net (lists-outbound.sourceforge.net
[66.35.250.225])

        by grelber.thyrsus.com (8.13.1/8.13.1) with ESMTP id j5727DMt031684
        for <[email protected]>; Mon, 6 Jun 2005 22:07:13 -0400

Received: from projects.sourceforge.net (sc8-sf-list1-b.sourceforge.net
[10.3.1.7])
by sc8-sf-spam2.sourceforge.net (Postfix) with ESMTP
id 2E0C5E4AF; Mon, 6 Jun 2005 17:46:15 -0700 (PDT)
Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.12]
helo=sc8-sf-mx2.sourceforge.net)
by sc8-sf-list1.sourceforge.net with esmtp (Exim 4.30)
id 1DfSDQ-0007UB-Rp
for [email protected]; Mon, 06 Jun 2005
17:45:12 -0700
Received: from fmr19.intel.com ([134.134.136.18] helo=orsfmr004.jf.intel.com)
by sc8-sf-mx2.sourceforge.net with esmtp (Exim 4.41)
id 1DfSDO-0003gl-Il
for [email protected]; Mon, 06 Jun 2005
17:45:12 -0700
Received: from orsfmr101.jf.intel.com (orsfmr101.jf.intel.com [10.7.209.17])

        by orsfmr004.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 
2004/09/17 17:50:56 root Exp $) with ESMTP id j570j4TU027763;
        Tue, 7 Jun 2005 00:45:04 GMT
 Received: from orsmsxvs041.jf.intel.com (orsmsxvs041.jf.intel.com 
[192.168.65.54])
        by orsfmr101.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 
2004/09/17 18:05:01 root Exp $) with SMTP id j570dvQF011113;
        Tue, 7 Jun 2005 00:44:50 GMT

Received: from orsmsx332.amr.corp.intel.com ([192.168.65.60]) by orsmsxvs041.jf.intel.com (SAVSMTP 3.1.7.47) with SMTP id
M2005060617432614357
; Mon, 06 Jun 2005 17:43:35 -0700
Received: from mail pickup service by orsmsx332.amr.corp.intel.com with

Microsoft SMTPSVC;
         Mon, 6 Jun 2005 17:38:55 -0700
 Received: from orsmsxvs040.jf.intel.com ([192.168.65.206]) by 
orsmsx332.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.211);
         Mon, 6 Jun 2005 17:11:03 -0700

Received: from orsfmr100.jf.intel.com ([10.7.209.16])
by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.7.47) with SMTP id
M2005060617110225137
for <[email protected]>; Mon, 06 Jun 2005 17:11:02 -0700
Received: from orsfmr004.jf.intel.com (orsfmr004.jf.intel.com [10.7.208.20])

        by orsfmr100.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 
2004/09/17 18:05:01 root Exp $) with ESMTP id j570B2qr012945
        for <[email protected]>; Tue, 7 Jun 2005 00:11:02 GMT
 Received: from vger.kernel.org (vger.kernel.org [12.107.209.244])
        by orsfmr004.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 
2004/09/17 17:50:56 root Exp $) with ESMTP id j570AlTr014175
        for <[email protected]>; Tue, 7 Jun 2005 00:11:02 GMT
 Received: ([email protected]) by vger.kernel.org via listexpand
        id S261787AbVFGABn (ORCPT <rfc822;[email protected]>);
        Mon, 6 Jun 2005 20:01:43 -0400
 Received: ([email protected]) by vger.kernel.org id S261788AbVFFX5w
        (ORCPT <rfc822;linux-kernel-outgoing>);
        Mon, 6 Jun 2005 19:57:52 -0400
 Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:56209 
"EHLO
        parcelfarce.linux.theplanet.co.uk") by vger.kernel.org with ESMTP
        id S261778AbVFFXwe (ORCPT <rfc822;[email protected]>);
        Mon, 6 Jun 2005 19:52:34 -0400
 Received: from viro by parcelfarce.linux.theplanet.co.uk with local (Exim 
4.43)
        id 1DfRPF-0002v4-Sq; Tue, 07 Jun 2005 00:53:21 +0100

From: Al Viro <[email protected]>

Rob

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel