Author: jim
Date: 2006-07-21 17:45:28 -0600 (Fri, 21 Jul 2006)
New Revision: 2067

Added:
   trunk/patches/colo-1.21-relocation_fix-1.patch
   trunk/patches/grub-0.97-disk_geometry-2.patch
Modified:
   /
Log:
 [EMAIL PROTECTED] (orig r2187):  jim | 2006-07-21 13:15:22 -0700
 Added colo-1.21-relocation_fix-1.patch



Property changes on: 
___________________________________________________________________
Name: svk:merge
   - b6734a72-470d-0410-b049-f317dca95413:/:2186
   + b6734a72-470d-0410-b049-f317dca95413:/:2187

Added: trunk/patches/colo-1.21-relocation_fix-1.patch
===================================================================
--- trunk/patches/colo-1.21-relocation_fix-1.patch                              
(rev 0)
+++ trunk/patches/colo-1.21-relocation_fix-1.patch      2006-07-21 23:45:28 UTC 
(rev 2067)
@@ -0,0 +1,21 @@
+Submitted By: Joe Ciccone <[EMAIL PROTECTED]>
+Date: 2006-06-11
+Initial Package Version: 1.21
+Upstream Status: Unknown
+Origin: Joe Ciccone
+Description: Fixes relocation errors when linking.
+
+diff -Naur colo-1.21.orig/stage1/include/lib.h colo-1.21/stage1/include/lib.h
+--- colo-1.21.orig/stage1/include/lib.h        2006-01-17 18:03:58.000000000 
-0500
++++ colo-1.21/stage1/include/lib.h     2006-07-11 01:01:29.000000000 -0400
+@@ -47,8 +47,8 @@
+ 
+ /* fast.c */
+ 
+-extern void * __attribute__((section(".data"))) _memcpy_w(void *, const void 
*, size_t);
+-extern void * __attribute__((section(".data"))) _memset_w(void *, int, 
size_t);
++extern void * _memcpy_w(void *, const void *, size_t);
++extern void * _memset_w(void *, int, size_t);
+ 
+ #endif
+ 

Added: trunk/patches/grub-0.97-disk_geometry-2.patch
===================================================================
--- trunk/patches/grub-0.97-disk_geometry-2.patch                               
(rev 0)
+++ trunk/patches/grub-0.97-disk_geometry-2.patch       2006-07-21 23:45:28 UTC 
(rev 2067)
@@ -0,0 +1,63 @@
+Submitted By: Jim Gifford <[EMAIL PROTECTED]>
+Date: 07-14-2006
+Initial Package Version: 0.97
+Upstream Status: Unknown
+Origin: Grub Bug Report - 
http://savannah.gnu.org/bugs/?func=detailitem&item_id=11312
+Description: This patch fixes the following issues on x86_64
+       1) malloc'd pages seem to lack the execute bit on x86_64;
+       2) grub seems to use some stack pointer diversion to malloc'd pages;
+       3) nested functions execute data on the stack;
+       4) this causes a segfault (at least on my machine)
+
+diff -Naur grub-0.97.orig/grub/asmstub.c grub-0.97/grub/asmstub.c
+--- grub-0.97.orig/grub/asmstub.c      2005-02-16 12:45:14.000000000 -0800
++++ grub-0.97/grub/asmstub.c   2006-07-14 12:38:08.305902933 -0700
+@@ -43,6 +43,8 @@
+ #include <termios.h>
+ #include <signal.h>
+ 
++#include <sys/mman.h>
++
+ #ifdef __linux__
+ # include <sys/ioctl.h>               /* ioctl */
+ # if !defined(__GLIBC__) || \
+@@ -142,14 +144,25 @@
+     }
+ 
+   assert (grub_scratch_mem == 0);
+-  scratch = malloc (0x100000 + EXTENDED_MEMSIZE + 15);
++  scratch = mmap(NULL,
++                 0x100000 + EXTENDED_MEMSIZE + 15,
++                 PROT_EXEC | PROT_READ | PROT_WRITE,
++                 MAP_PRIVATE | MAP_GROWSDOWN | MAP_ANONYMOUS | MAP_32BIT,
++                 -1,
++                 0);
++
+   assert (scratch);
+   grub_scratch_mem = (char *) ((((int) scratch) >> 4) << 4);
+ 
+   /* FIXME: simulate the memory holes using mprot, if available. */
+ 
+   assert (disks == 0);
+-  disks = malloc (NUM_DISKS * sizeof (*disks));
++  disks = mmap(NULL,
++               NUM_DISKS * sizeof (*disks),
++               PROT_EXEC | PROT_READ | PROT_WRITE,
++               MAP_PRIVATE | MAP_GROWSDOWN | MAP_ANONYMOUS | MAP_32BIT,
++               -1,
++               0);
+   assert (disks);
+   /* Initialize DISKS.  */
+   for (i = 0; i < NUM_DISKS; i++)
+@@ -215,9 +228,9 @@
+   /* Release memory. */
+   restore_device_map (device_map);
+   device_map = 0;
+-  free (disks);
++  munmap(disks, NUM_DISKS * sizeof (*disks));
+   disks = 0;
+-  free (scratch);
++  munmap(scratch, 0x100000 + EXTENDED_MEMSIZE + 15);
+   grub_scratch_mem = 0;
+ 
+   if (serial_device)

-- 
http://linuxfromscratch.org/mailman/listinfo/cross-lfs
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to