Author: michael Date: Tue Jan 22 16:39:05 2008 New Revision: 11363 URL: http://svn.gnome.org/viewvc/ooo-build?rev=11363&view=rev
Log: process vtrelocs before 'init' - this guarentees ordering & success ! ... Modified: trunk/patches/test/glibc-vt-reloc-3.diff Modified: trunk/patches/test/glibc-vt-reloc-3.diff ============================================================================== --- trunk/patches/test/glibc-vt-reloc-3.diff (original) +++ trunk/patches/test/glibc-vt-reloc-3.diff Tue Jan 22 16:39:05 2008 @@ -1,41 +1,17 @@ -diff -u -r -x '*~' -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' pristine-glibc-2.6.1/elf/dl-load.c glibc-2.6.1/elf/dl-load.c ---- pristine-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 '*~' -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' pristine-glibc-2.6.1/elf/dl-reloc.c glibc-2.6.1/elf/dl-reloc.c ---- pristine-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-18 11:03:37.000000000 +0000 -@@ -27,6 +27,9 @@ - #include <sys/types.h> - #include "dynamic-link.h" +diff -u -r -x '*~' -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' pristine-glibc-2.6.1/elf/dl-init.c glibc-2.6.1/elf/dl-init.c +--- pristine-glibc-2.6.1/elf/dl-init.c 2005-01-06 22:40:26.000000000 +0000 ++++ glibc-2.6.1/elf/dl-init.c 2008-01-22 16:09:03.000000000 +0000 +@@ -30,6 +30,79 @@ + extern int _dl_starting_up_internal attribute_hidden; + #endif +#define SUSEIDX(sym) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM + \ + DT_EXTRANUM + DT_VALNUM + DT_ADDRNUM + DT_SUSE_TAGIDX (sym)) + - /* Statistics function. */ - #ifdef SHARED - # define bump_num_cache_relocations() ++GL(dl_num_cache_relocations) -@@ -133,6 +136,73 @@ - '\0', map->l_tls_blocksize - map->l_tls_initimage_size); - } - +/* process vtable / block copy relocations */ ++ +static void -+_dl_perform_vtrelocs (struct link_map *map, struct r_scope_elem *scope[]) ++_dl_perform_vtrelocs (struct link_map *map) +{ + ElfW(VtReloc) *rel; + int debug_output = GLRO(dl_debug_mask) & DL_DEBUG_RELOC; @@ -67,12 +43,14 @@ + dest = (void *)rel->r_dest; + if (debug_output) + _dl_debug_printf ("copy from 0x%x to 0x%x mask 0x%x\n", src, dest, rel->r_mask); ++#ifdef DONT_TOUCH_EXTERNAL + if (dest < map->l_map_start || dest >= map->l_map_end) + { /* weak symbol defined in another dso - thus already fixed up, and readonly */ + if (debug_output) + _dl_debug_printf (" skip, defined elsewhere\n"); + } + else ++#endif + { + for (mask = rel->r_mask; mask; mask >>= 1) + { @@ -101,9 +79,47 @@ + } +} + static void + call_init (struct link_map *l, int argc, char **argv, char **env) +@@ -42,6 +115,8 @@ + dependency. */ + l->l_init_called = 1; + ++ _dl_perform_vtrelocs (l); ++ + /* Check for object which constructors we do not run here. */ + if (__builtin_expect (l->l_name[0], 'a') == '\0' + && l->l_type == lt_executable) +diff -u -r -x '*~' -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' pristine-glibc-2.6.1/elf/dl-load.c glibc-2.6.1/elf/dl-load.c +--- pristine-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 '*~' -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' pristine-glibc-2.6.1/elf/dl-reloc.c glibc-2.6.1/elf/dl-reloc.c +--- pristine-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-22 15:54:46.000000000 +0000 +@@ -133,7 +133,6 @@ + '\0', map->l_tls_blocksize - map->l_tls_initimage_size); + } + +- void _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[], -@@ -174,11 +244,15 @@ + int lazy, int consider_profiling) +@@ -174,11 +173,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. */ @@ -120,12 +136,7 @@ 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 +367,12 @@ - #endif - } - -+ _dl_perform_vtrelocs (l, scope); -+ +@@ -296,6 +299,7 @@ /* Mark the object so we know this work has been done. */ l->l_relocated = 1; @@ -133,14 +144,14 @@ /* Undo the segment protection changes. */ while (__builtin_expect (textrels != NULL, 0)) { -@@ -307,6 +384,7 @@ - - textrels = textrels->next; - } +@@ -312,6 +316,7 @@ + done, do it. */ + if (l->l_relro_size != 0) + _dl_protect_relro (l); +#endif + } + - /* In case we can protect the data now that the relocations are - done, do it. */ diff -u -r -x '*~' -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' pristine-glibc-2.6.1/elf/dynamic-link.h glibc-2.6.1/elf/dynamic-link.h --- pristine-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 18:08:21.000000000 +0000 _______________________________________________ SVN-commits-list mailing list (read only) http://mail.gnome.org/mailman/listinfo/svn-commits-list Want to limit the commits to a few modules? Go to above URL, log in to edit your options and select the modules ('topics') you want. Module maintainer? It is possible to set the reply-to to your development mailing list. Email [EMAIL PROTECTED] if interested.