diff options
author | Ryan S. Arnold <rsa@linux.vnet.ibm.com> | 2013-02-12 10:59:12 -0600 |
---|---|---|
committer | Ryan S. Arnold <rsa@linux.vnet.ibm.com> | 2013-02-12 11:01:40 -0600 |
commit | 0de52d934560c373daae66f1ac36ed4a264b509d (patch) | |
tree | eefa5d0ca1943a3a8bd0f2eba2f8d712b2f31f66 | |
parent | 4943a3cc59f23c48a40f0f72a111dac55d5c85d4 (diff) | |
parent | 943515f05cdbc1463bb06c9adbd3dcee5c1a7f57 (diff) | |
download | glibc-0de52d934560c373daae66f1ac36ed4a264b509d.zip glibc-0de52d934560c373daae66f1ac36ed4a264b509d.tar.gz glibc-0de52d934560c373daae66f1ac36ed4a264b509d.tar.bz2 |
Merge remote branch 'origin/release/2.13/master' into local_ibm_2.13
Pick up dynamic linker fix related to bugzilla 12454 which is:
Inconsistency detected by ld.so: dl-deps.c: 622: _dl_map_object_deps:
Assertion `nlist > 1' failed!
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | elf/dl-deps.c | 93 | ||||
-rw-r--r-- | elf/dl-fini.c | 10 | ||||
-rw-r--r-- | sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S | 2 | ||||
-rw-r--r-- | sysdeps/i386/i686/multiarch/memcpy-ssse3.S | 2 | ||||
-rw-r--r-- | sysdeps/x86_64/multiarch/memcpy-ssse3-back.S | 2 | ||||
-rw-r--r-- | sysdeps/x86_64/multiarch/memcpy-ssse3.S | 2 |
8 files changed, 79 insertions, 55 deletions
@@ -277,6 +277,25 @@ an embedded RPATH flag, which is what a compiler modified to embed a non-default INTERP section would do. +2011-05-30 Ulrich Drepper <drepper@gmail.com> + + [BZ #12454] + * elf/dl-deps.c (_dl_map_object_deps): Run initializer sorting only + when there are multiple maps. + * elf/dl-fini.c (_dl_sort_fini): Check for list of one. + (_dl_fini): Remove test here. + + * elf/rtld.c (dl_main): Don't allow the loader to load itself. + +2011-02-06 Mike Frysinger <vapier@gentoo.org> + + [BZ #12653] + * sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S: Only protect + MEMCPY_CHK with USE_AS_BCOPY ifdef check. + * sysdeps/i386/i686/multiarch/memcpy-ssse3.S: Likewise. + * sysdeps/x86_64/multiarch/memcpy-ssse3.S: Likewise. + * sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: Likewise. + 2010-09-28 Andreas Schwab <schwab@redhat.com> Ulrich Drepper <drepper@gmail.com> @@ -1,4 +1,4 @@ -GNU C Library NEWS -- history of user-visible changes. 2011-1-19 +GNU C Library NEWS -- history of user-visible changes. 2011-5-30 Copyright (C) 1992-2009, 2010, 2011 Free Software Foundation, Inc. See the end for copying conditions. @@ -13,7 +13,7 @@ Version 2.13 11655, 11701, 11840, 11856, 11883, 11903, 11904, 11968, 11979, 12005, 12037, 12067, 12077, 12078, 12092, 12093, 12107, 12108, 12113, 12140, 12159, 12167, 12191, 12194, 12201, 12204, 12205, 12207, 12348, 12378, - 12394, 12397, 12489 + 12394, 12397, 12489, 12653, 12454 * New Linux interfaces: prlimit, prlimit64, fanotify_init, fanotify_mark diff --git a/elf/dl-deps.c b/elf/dl-deps.c index d3c27f1..0b03b90 100644 --- a/elf/dl-deps.c +++ b/elf/dl-deps.c @@ -617,61 +617,64 @@ Filters not supported with LD_TRACE_PRELINKING")); map->l_searchlist.r_list[i]->l_reserved = 0; } - /* Now determine the order in which the initialization has to happen. */ + /* Sort the initializer list to take dependencies into account. The binary + itself will always be initialize last. */ memcpy (l_initfini, map->l_searchlist.r_list, nlist * sizeof (struct link_map *)); - - /* We can skip looking for the binary itself which is at the front - of the search list. */ - assert (nlist > 1); - i = 1; - bool seen[nlist]; - memset (seen, false, nlist * sizeof (seen[0])); - while (1) + if (__builtin_expect (nlist > 1, 1)) { - /* Keep track of which object we looked at this round. */ - seen[i] = true; - struct link_map *thisp = l_initfini[i]; - - /* Find the last object in the list for which the current one is - a dependency and move the current object behind the object - with the dependency. */ - unsigned int k = nlist - 1; - while (k > i) + /* We can skip looking for the binary itself which is at the front + of the search list. */ + i = 1; + bool seen[nlist]; + memset (seen, false, nlist * sizeof (seen[0])); + while (1) { - struct link_map **runp = l_initfini[k]->l_initfini; - if (runp != NULL) - /* Look through the dependencies of the object. */ - while (*runp != NULL) - if (__builtin_expect (*runp++ == thisp, 0)) - { - /* Move the current object to the back past the last - object with it as the dependency. */ - memmove (&l_initfini[i], &l_initfini[i + 1], - (k - i) * sizeof (l_initfini[0])); - l_initfini[k] = thisp; - - if (seen[i + 1]) + /* Keep track of which object we looked at this round. */ + seen[i] = true; + struct link_map *thisp = l_initfini[i]; + + /* Find the last object in the list for which the current one is + a dependency and move the current object behind the object + with the dependency. */ + unsigned int k = nlist - 1; + while (k > i) + { + struct link_map **runp = l_initfini[k]->l_initfini; + if (runp != NULL) + /* Look through the dependencies of the object. */ + while (*runp != NULL) + if (__builtin_expect (*runp++ == thisp, 0)) { - ++i; - goto next_clear; + /* Move the current object to the back past the last + object with it as the dependency. */ + memmove (&l_initfini[i], &l_initfini[i + 1], + (k - i) * sizeof (l_initfini[0])); + l_initfini[k] = thisp; + + if (seen[i + 1]) + { + ++i; + goto next_clear; + } + + memmove (&seen[i], &seen[i + 1], + (k - i) * sizeof (seen[0])); + seen[k] = true; + + goto next; } - memmove (&seen[i], &seen[i + 1], (k - i) * sizeof (seen[0])); - seen[k] = true; + --k; + } - goto next; - } + if (++i == nlist) + break; + next_clear: + memset (&seen[i], false, (nlist - i) * sizeof (seen[0])); - --k; + next:; } - - if (++i == nlist) - break; - next_clear: - memset (&seen[i], false, (nlist - i) * sizeof (seen[0])); - - next:; } /* Terminate the list of dependencies. */ diff --git a/elf/dl-fini.c b/elf/dl-fini.c index ba6c62a..269bcec 100644 --- a/elf/dl-fini.c +++ b/elf/dl-fini.c @@ -33,9 +33,12 @@ internal_function _dl_sort_fini (struct link_map *l, struct link_map **maps, size_t nmaps, char *used, Lmid_t ns) { + /* A list of one element need not be sorted. */ + if (nmaps == 1) + return; + /* We can skip looking for the binary itself which is at the front of the search list for the main namespace. */ - assert (nmaps > 1); unsigned int i = ns == LM_ID_BASE; bool seen[nmaps]; memset (seen, false, nmaps * sizeof (seen[0])); @@ -195,9 +198,8 @@ _dl_fini (void) assert (ns == LM_ID_BASE || i == nloaded || i == nloaded - 1); nmaps = i; - if (nmaps > 1) - /* Now we have to do the sorting. */ - _dl_sort_fini (GL(dl_ns)[ns]._ns_loaded, maps, nmaps, NULL, ns); + /* Now we have to do the sorting. */ + _dl_sort_fini (GL(dl_ns)[ns]._ns_loaded, maps, nmaps, NULL, ns); /* We do not rely on the linked list of loaded object anymore from this point on. We have our own list here (maps). The various diff --git a/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S b/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S index 48a109c..8e81183 100644 --- a/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S +++ b/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S @@ -110,7 +110,7 @@ __i686.get_pc_thunk.bx: #endif .section .text.ssse3,"ax",@progbits -#if defined SHARED && !defined NOT_IN_libc && !defined USE_AS_BCOPY +#if !defined USE_AS_BCOPY ENTRY (MEMCPY_CHK) movl 12(%esp), %eax cmpl %eax, 16(%esp) diff --git a/sysdeps/i386/i686/multiarch/memcpy-ssse3.S b/sysdeps/i386/i686/multiarch/memcpy-ssse3.S index ec9eeb9..f64f8d2 100644 --- a/sysdeps/i386/i686/multiarch/memcpy-ssse3.S +++ b/sysdeps/i386/i686/multiarch/memcpy-ssse3.S @@ -110,7 +110,7 @@ __i686.get_pc_thunk.bx: #endif .section .text.ssse3,"ax",@progbits -#if defined SHARED && !defined NOT_IN_libc && !defined USE_AS_BCOPY +#if !defined USE_AS_BCOPY ENTRY (MEMCPY_CHK) movl 12(%esp), %eax cmpl %eax, 16(%esp) diff --git a/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S b/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S index 48c974e..bdd114a 100644 --- a/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S +++ b/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S @@ -49,7 +49,7 @@ ud2 .section .text.ssse3,"ax",@progbits -#if defined SHARED && !defined NOT_IN_libc +#if !defined USE_AS_BCOPY ENTRY (MEMCPY_CHK) cmpq %rdx, %rcx jb HIDDEN_JUMPTARGET (__chk_fail) diff --git a/sysdeps/x86_64/multiarch/memcpy-ssse3.S b/sysdeps/x86_64/multiarch/memcpy-ssse3.S index 9a878d3..cd7e45f 100644 --- a/sysdeps/x86_64/multiarch/memcpy-ssse3.S +++ b/sysdeps/x86_64/multiarch/memcpy-ssse3.S @@ -49,7 +49,7 @@ ud2 .section .text.ssse3,"ax",@progbits -#if defined SHARED && !defined NOT_IN_libc +#if !defined USE_AS_BCOPY ENTRY (MEMCPY_CHK) cmpq %rdx, %rcx jb HIDDEN_JUMPTARGET (__chk_fail) |