r2067 - in trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian: . patches patches/series

Joshua Kwan joshk@haydn.debian.org
Sun, 26 Dec 2004 15:13:54 -0700


Author: joshk
Date: 2004-12-26 15:13:37 -0700 (Sun, 26 Dec 2004)
New Revision: 2067

Added:
   trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/sparc-ET_DYN_BASE.dpatch
Modified:
   trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog
   trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-11
Log:
ET_DYN_BASE patch for 2.6

Modified: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog	2004-12-26 19:37:28 UTC (rev 2066)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog	2004-12-26 22:13:37 UTC (rev 2067)
@@ -79,8 +79,12 @@
     - A lot of warning fixes for RTC/__exit/serial code.
     - Fix cg6 framebuffer initialization.
     - fix up VM fault code handling
+  
+  * Also a fix from David S. Miller which reverts ELF_ET_DYN_BASE setting,
+    which was was put in place to make an obscure corner case work.
+    closes: #287287
 
- -- Sven Luther <luther@debian.org>  Sun, 26 Dec 2004 12:29:39 +0100
+ -- Joshua Kwan <joshk@triplehelix.org>  Sun, 26 Dec 2004 11:39:11 -0800
 
 kernel-source-2.6.8 (2.6.8-10) unstable; urgency=high
 

Modified: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-11
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-11	2004-12-26 19:37:28 UTC (rev 2066)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-11	2004-12-26 22:13:37 UTC (rev 2067)
@@ -32,3 +32,4 @@
 + sparc32-sun4d-support.dpatch
 + sparc32-hypersparc-dvma.dpatch
 + sparc32-vm-fault-codes.dpatch
++ sparc-ET_DYN_BASE.dpatch

Added: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/sparc-ET_DYN_BASE.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/sparc-ET_DYN_BASE.dpatch	2004-12-26 19:37:28 UTC (rev 2066)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/sparc-ET_DYN_BASE.dpatch	2004-12-26 22:13:37 UTC (rev 2067)
@@ -0,0 +1,71 @@
+# origin: bk
+# cset: 1.2119.1.45
+# inclusion: 2.6.10
+# description: unf**k huge sparc allocations
+# revision date: 2004-12-26
+
+# This is a BitKeeper generated diff -Nru style patch.
+#
+# ChangeSet
+#   2004/12/08 23:02:03-08:00 davem@nuts.davemloft.net 
+#   [SPARC]: Adjust 32-bit ELF_ET_DYN_BASE.
+#   
+#   We were using 0x08000000 instead of TASK_UNMAPPED_BASE
+#   so that running something like "/lib/ld-linux.so.2 emacs"
+#   would work.
+#   
+#   The issue there was that wherever /lib/ld-linux.so.2 gets
+#   mapped (controlled by ELF_ET_DYN_BASE), that is where the
+#   BSS start for the process ends up.  Now, emacs allocates
+#   dynamic memory for LISP objects from the BSS, and needs
+#   the top 4 bits of the virtual address to be clear so that
+#   it can encode LISP type and GC marking information there.
+#   
+#   But making this obscure emacs case work breaks lots of other
+#   stuff.  For example, programs with a reasonably large data
+#   section fail to load via direct ld.so interpreter execution
+#   because the data section is large enough to begin overlapping
+#   with the ELF_ET_DYN_BASE area.
+#   
+#   The /lib/ld-linux.so.2 emacs case does not work on a lot of
+#   platforms due to this issue, including i386, so it is not
+#   worth making work on sparc either.  It is indeed useful
+#   sometimes when debugging a new experimental build of glibc
+#   for example, but people doing that can hack the value of
+#   ELF_ET_DYN_BASE in their kernels.  Perhaps at some point
+#   we will make a sysctl controllable value.
+#   
+#   Signed-off-by: David S. Miller <davem@davemloft.net>
+# 
+# include/asm-sparc/elf.h
+#   2004/12/08 22:56:54-08:00 davem@nuts.davemloft.net +1 -1
+#   [SPARC]: Adjust 32-bit ELF_ET_DYN_BASE.
+# 
+# arch/sparc64/kernel/binfmt_elf32.c
+#   2004/12/08 22:56:54-08:00 davem@nuts.davemloft.net +1 -1
+#   [SPARC]: Adjust 32-bit ELF_ET_DYN_BASE.
+# 
+diff -Nru a/arch/sparc64/kernel/binfmt_elf32.c b/arch/sparc64/kernel/binfmt_elf32.c
+--- a/arch/sparc64/kernel/binfmt_elf32.c	2004-12-08 23:05:11 -08:00
++++ b/arch/sparc64/kernel/binfmt_elf32.c	2004-12-08 23:05:11 -08:00
+@@ -79,7 +79,7 @@
+ 
+ #define elf_check_arch(x)	(((x)->e_machine == EM_SPARC) || ((x)->e_machine == EM_SPARC32PLUS))
+ 
+-#define ELF_ET_DYN_BASE         0x08000000
++#define ELF_ET_DYN_BASE         0x70000000
+ 
+ 
+ #include <asm/processor.h>
+diff -Nru a/include/asm-sparc/elf.h b/include/asm-sparc/elf.h
+--- a/include/asm-sparc/elf.h	2004-12-08 23:05:11 -08:00
++++ b/include/asm-sparc/elf.h	2004-12-08 23:05:11 -08:00
+@@ -143,7 +143,7 @@
+    the loader.  We need to make sure that it is out of the way of the program
+    that it will "exec", and that there is sufficient room for the brk.  */
+ 
+-#define ELF_ET_DYN_BASE         (0x08000000)
++#define ELF_ET_DYN_BASE         (TASK_UNMAPPED_BASE)
+ 
+ /* This yields a mask that user programs can use to figure out what
+    instruction set this cpu supports.  This can NOT be done in userspace