ooo-build r11250 - trunk/patches/test
- From: michael svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r11250 - trunk/patches/test
- Date: Fri, 11 Jan 2008 21:39:11 +0000 (GMT)
Author: michael
Date: Fri Jan 11 21:39:11 2008
New Revision: 11250
URL: http://svn.gnome.org/viewvc/ooo-build?rev=11250&view=rev
Log:
upd.
Modified:
trunk/patches/test/glibc-vt-reloc.diff
Modified: trunk/patches/test/glibc-vt-reloc.diff
==============================================================================
--- trunk/patches/test/glibc-vt-reloc.diff (original)
+++ trunk/patches/test/glibc-vt-reloc.diff Fri Jan 11 21:39:11 2008
@@ -1,6 +1,24 @@
+diff -u -r -x testsuite -x libjava -x cc-nptl -x build-dir -x '*.orig' -x obj-i586-suse-linux -x texis -x Makeconfig -x version.h -x '*.o' -x '*.1' -x 'Makefile*' -x 'config*' -x libtool -x '*.info' -x '*.tex' /usr/src/packages/BUILD/glibc-2.6.1/elf/dl-load.c glibc-2.6.1/elf/dl-load.c
+--- /usr/src/packages/BUILD/glibc-2.6.1/elf/dl-load.c 2008-01-08 20:45:11.000000000 +0000
++++ glibc-2.6.1/elf/dl-load.c 2008-01-11 15:23:16.000000000 +0000
+@@ -1200,9 +1200,13 @@
+
+ /* Remember which part of the address space this object uses. */
+ l->l_map_start = (ElfW(Addr)) __mmap ((void *) mappref, maplength,
+- c->prot,
++ c->prot | PROT_WRITE,
+ MAP_COPY|MAP_FILE,
+ fd, c->mapoff);
++ if (GLRO(dl_debug_mask) & DL_DEBUG_RELOC)
++ _dl_debug_printf ("map '%s' at 0x%x prot 0x%x\n", l->l_name,
++ l->l_map_start, c->prot);
++
+ if (__builtin_expect ((void *) l->l_map_start == MAP_FAILED, 0))
+ {
+ map_error:
diff -u -r -x testsuite -x libjava -x cc-nptl -x build-dir -x '*.orig' -x obj-i586-suse-linux -x texis -x Makeconfig -x version.h -x '*.o' -x '*.1' -x 'Makefile*' -x 'config*' -x libtool -x '*.info' -x '*.tex' /usr/src/packages/BUILD/glibc-2.6.1/elf/dl-reloc.c glibc-2.6.1/elf/dl-reloc.c
--- /usr/src/packages/BUILD/glibc-2.6.1/elf/dl-reloc.c 2007-05-18 09:37:39.000000000 +0100
-+++ glibc-2.6.1/elf/dl-reloc.c 2008-01-10 17:49:56.000000000 +0000
++++ glibc-2.6.1/elf/dl-reloc.c 2008-01-11 16:06:10.000000000 +0000
@@ -27,6 +27,9 @@
#include <sys/types.h>
#include "dynamic-link.h"
@@ -11,7 +29,7 @@
/* Statistics function. */
#ifdef SHARED
# define bump_num_cache_relocations() ++GL(dl_num_cache_relocations)
-@@ -133,6 +136,85 @@
+@@ -133,6 +136,67 @@
'\0', map->l_tls_blocksize - map->l_tls_initimage_size);
}
@@ -24,45 +42,21 @@
+ int i;
+
+ if (debug_output)
-+ _dl_debug_printf ("new vtcopy-reloc processing on '%s'\n", map->l_name);
++ _dl_debug_printf ("new vtcopy-reloc processing on '%s' offset 0x%x map 0x%x\n",
++ map->l_name[0] ? map->l_name : rtld_progname,
++ map->l_addr, map->l_map_start);
+
-+ {
-+ ElfW(Dyn) *item;
-+ _dl_debug_printf ("fidx 0x%x\n", SUSEIDX(DT_SUSE_VTRELOC));
-+ _dl_debug_printf ("in size 0x%x\n", sizeof (map->l_info) / sizeof(map->l_info[0]));
-+ item = map->l_info[DT_STRTAB]; /* SUSEIDX(DT_SUSE_VTRELOC)]; */
-+ _dl_debug_printf ("bits: 0x%x\n", item->d_tag);
-+ _dl_debug_printf ("bits2: 0x%x\n", item->d_un.d_val);
-+ _dl_debug_printf ("bits3: 0x%x\n", item->d_un.d_ptr);
-+ item = map->l_info[SUSEIDX(DT_SUSE_VTRELOC)];
-+ _dl_debug_printf ("vtreloc item: 0x%x\n", item);
-+ if (!item)
-+ return;
-+ }
-+
-+#define TSTFOO_PTR(map, i) (map)->i->d_un.d_ptr
-+ rel = (ElfW(VtReloc) *)(TSTFOO_PTR (map, l_info[SUSEIDX(DT_SUSE_VTRELOC)]));
-+ _dl_debug_printf ("got d_ptr\n");
-+ if (rel == NULL)
++ /* any vtrelocs ? */
++ if (map->l_info[SUSEIDX(DT_SUSE_VTRELOC)] == NULL)
+ {
+ if (debug_output)
+ _dl_debug_printf ("no vtreloc section in '%s'\n", map->l_name);
+ return;
+ }
-+ {
-+ ElfW(Addr) p = map->l_info[DT_PLTGOT];
-+ _dl_debug_printf ("pltgot at 0x%x (0x%x)\n", p, p - map->l_addr);
-+ }
-+ {
-+ ElfW(Addr) p = map->l_info[DT_HASH];
-+ _dl_debug_printf ("hash at 0x%x (0x%x)\n", p, p - map->l_addr);
-+ }
++ rel = (ElfW(VtReloc) *)(D_PTR (map, l_info[SUSEIDX(DT_SUSE_VTRELOC)]));
+ _dl_debug_printf ("vtreloc section found in '%s' at 0x%x (0x%x) mapped at 0x%x\n",
+ map->l_name, rel, ((ElfW(Addr))rel - map->l_addr),
+ map->l_addr);
-+ for (i = 0; i < 64; i++)
-+ _dl_debug_printf ("0x%x: 0x%x\n", (int)&((unsigned char *)rel)[i],
-+ ((unsigned char *)rel)[i]);
+ while (rel->r_src != 0)
+ {
+ ElfW(Addr) **src, **dest;
@@ -70,12 +64,13 @@
+
+ src = (void *)rel->r_src;
+ dest = (void *)rel->r_dest;
-+ _dl_debug_printf ("copy from 0x%x to 0x%x mask 0x%x\n", src, dest, rel->r_mask);
++ if (debug_output)
++ _dl_debug_printf ("copy from 0x%x to 0x%x mask 0x%x\n", src, dest, rel->r_mask);
+
+ for (mask = rel->r_mask; mask; mask >>= 1)
+ {
-+ _dl_debug_printf ("%s copy [&0x%x -> &0x%x]\n",
-+ mask & 1 ? "do" : "no", src, dest);
++/* _dl_debug_printf ("%s copy [&0x%x -> &0x%x]\n",
++ mask & 1 ? "do" : "no", src, dest); */
+ if (mask & 1)
+ {
+ if (debug_output || !(*src == *dest || *dest == (ElfW(Addr) *)0xdeadbeef))
@@ -86,18 +81,40 @@
+ src, dest);
+ }
+ *dest = *src;
++
+ }
+ else if (debug_output)
+ _dl_debug_printf ("no copy 0x%x to 0x%x %s\n",
+ *src, *dest, *src == *dest && (int)*src > 0x100 ? "Bug" : "skip");
+ dest++; src++;
+ }
++
++ if (debug_output)
++ _dl_debug_printf ("move to next vtrel entry\n");
++ rel++;
+ }
+}
void
_dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
-@@ -293,6 +375,8 @@
+@@ -174,11 +238,15 @@
+ /* DT_TEXTREL is now in level 2 and might phase out at some time.
+ But we rewrite the DT_FLAGS entry to a DT_TEXTREL entry to make
+ testing easier and therefore it will be available at all time. */
+- if (__builtin_expect (l->l_info[DT_TEXTREL] != NULL, 0))
++ if (1) //__builtin_expect (l->l_info[DT_TEXTREL] != NULL, 0))
+ {
+ /* Bletch. We must make read-only segments writable
+ long enough to relocate them. */
+ const ElfW(Phdr) *ph;
++
++ if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_RELOC, 0))
++ _dl_debug_printf ("un-protecting foo\n");
++
+ for (ph = l->l_phdr; ph < &l->l_phdr[l->l_phnum]; ++ph)
+ if (ph->p_type == PT_LOAD && (ph->p_flags & PF_W) == 0)
+ {
+@@ -293,9 +361,12 @@
#endif
}
@@ -106,9 +123,21 @@
/* Mark the object so we know this work has been done. */
l->l_relocated = 1;
++#if 0
+ /* Undo the segment protection changes. */
+ while (__builtin_expect (textrels != NULL, 0))
+ {
+@@ -307,6 +378,7 @@
+
+ textrels = textrels->next;
+ }
++#endif
+
+ /* In case we can protect the data now that the relocations are
+ done, do it. */
diff -u -r -x testsuite -x libjava -x cc-nptl -x build-dir -x '*.orig' -x obj-i586-suse-linux -x texis -x Makeconfig -x version.h -x '*.o' -x '*.1' -x 'Makefile*' -x 'config*' -x libtool -x '*.info' -x '*.tex' /usr/src/packages/BUILD/glibc-2.6.1/elf/dynamic-link.h glibc-2.6.1/elf/dynamic-link.h
--- /usr/src/packages/BUILD/glibc-2.6.1/elf/dynamic-link.h 2006-07-10 22:52:18.000000000 +0100
-+++ glibc-2.6.1/elf/dynamic-link.h 2008-01-10 17:45:16.000000000 +0000
++++ glibc-2.6.1/elf/dynamic-link.h 2008-01-10 18:08:21.000000000 +0000
@@ -65,6 +65,10 @@
#ifndef VERSYMIDX
# define VERSYMIDX(sym) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (sym))
@@ -120,28 +149,17 @@
/* Read the dynamic section at DYN and fill in INFO with indices DT_*. */
-@@ -86,8 +90,20 @@
-
- info = l->l_info;
+@@ -88,6 +92,9 @@
-+ _dl_debug_printf ("Name '%s'\n", l->l_name ? l->l_name : "<noname>");
-+ info[SUSEIDX(DT_SUSE_VTRELOC)] = 0;
-+
while (dyn->d_tag != DT_NULL)
{
+ if (dyn->d_tag >= DT_SUSE_LO &&
-+ dyn->d_tag < DT_SUSE_LO + DT_SUSENUM)
-+ {
-+ _dl_debug_printf ("assign at fidx 0x%x (0x%x)\n", SUSEIDX(dyn->d_tag), dyn);
-+ info[SUSEIDX(dyn->d_tag)] = dyn;
-+ } else
-+ _dl_debug_printf ("tag 0x%x not >= 0x%x and < 0x%x\n",
-+ dyn->d_tag, DT_SUSE_LO, DT_SUSE_LO + DT_SUSENUM);
-+
++ dyn->d_tag < DT_SUSE_LO + DT_SUSENUM)
++ info[SUSEIDX(dyn->d_tag)] = dyn;
if (dyn->d_tag < DT_NUM)
info[dyn->d_tag] = dyn;
else if (dyn->d_tag >= DT_LOPROC &&
-@@ -143,6 +159,7 @@
+@@ -143,6 +150,7 @@
# endif
ADJUST_DYN_INFO (DT_JMPREL);
ADJUST_DYN_INFO (VERSYMIDX (DT_VERSYM));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]