summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-09-06 15:19:04 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-09-06 15:19:04 +0000
commitf808b3b8a163ab46de995015240207a05af4d9b6 (patch)
tree848211a0c1bf37f74405205d9a76007e5534ee2c
parente563f94fbcdea23cf0d4cad93b7e086d221856cf (diff)
downloadeglibc2-f808b3b8a163ab46de995015240207a05af4d9b6.tar.gz
Merge changes between r14663 and r15225 from /fsf/glibc-2_13-branch.
git-svn-id: svn://svn.eglibc.org/branches/eglibc-2_13@15226 7b3dc134-2b1b-0410-93df-9e9f96275f8d
-rw-r--r--libc/ChangeLog10
-rw-r--r--libc/NEWS4
-rw-r--r--libc/elf/dl-deps.c93
-rw-r--r--libc/elf/dl-fini.c10
-rw-r--r--ports/ChangeLog.mips8
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatfs64.c1
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/n64/statfs64.c1
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list3
8 files changed, 79 insertions, 51 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog
index 9d3222a92..c2f5a1835 100644
--- a/libc/ChangeLog
+++ b/libc/ChangeLog
@@ -1,3 +1,13 @@
+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]
diff --git a/libc/NEWS b/libc/NEWS
index 7a723e414..91facbec1 100644
--- a/libc/NEWS
+++ b/libc/NEWS
@@ -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, 12653
+ 12394, 12397, 12489, 12653, 12454
* New Linux interfaces: prlimit, prlimit64, fanotify_init, fanotify_mark
diff --git a/libc/elf/dl-deps.c b/libc/elf/dl-deps.c
index 524d76ee1..663141250 100644
--- a/libc/elf/dl-deps.c
+++ b/libc/elf/dl-deps.c
@@ -613,61 +613,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/libc/elf/dl-fini.c b/libc/elf/dl-fini.c
index c8c9a52d6..f3a1c7cf2 100644
--- a/libc/elf/dl-fini.c
+++ b/libc/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/ports/ChangeLog.mips b/ports/ChangeLog.mips
index bdb641e26..90052590a 100644
--- a/ports/ChangeLog.mips
+++ b/ports/ChangeLog.mips
@@ -1,3 +1,11 @@
+2011-09-06 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13109]
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list (fstatfs)
+ (statfs): New.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/fstatfs64.c,
+ sysdeps/unix/sysv/linux/mips/mips64/n64/statfs64.c: New.
+
2011-04-01 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list: Add
diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatfs64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatfs64.c
new file mode 100644
index 000000000..6e25b021a
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatfs64.c
@@ -0,0 +1 @@
+/* Empty. */
diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/statfs64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/statfs64.c
new file mode 100644
index 000000000..6e25b021a
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/statfs64.c
@@ -0,0 +1 @@
+/* Empty. */
diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
index 2404709ee..bb0bba6db 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
+++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
@@ -5,3 +5,6 @@ sync_file_range - sync_file_range i:iiii sync_file_range
prlimit EXTRA prlimit64 i:iipp prlimit prlimit64
fanotify_mark EXTRA fanotify_mark i:iiiis fanotify_mark
+
+fstatfs - fstatfs i:ip __fstatfs fstatfs fstatfs64 __fstatfs64
+statfs - statfs i:sp __statfs statfs statfs64 __statfs64