revert to latest release cooker

This commit is contained in:
root 2012-07-30 21:08:33 +04:00
parent 9c0c659670
commit 4a7f411821
57 changed files with 3854 additions and 2433 deletions

View file

@ -1,7 +1,7 @@
---
sources:
crypt_blowfish-1.2.tar.gz: 306ff83af206fac786900ce5e4800516cae909d9
glibc-2.16.0-fedora.tar.xz: 176ddb5fd0ecd2315de5d04ff06b37f540794626
glibc-2.16.0.tar.xz: 9d4fffc9c4ac93e7919e124fa38bb51dcaff5216
glibc-2.15-a316c1f-fedora.tar.gz: fc08eb2483a8401fd324ffd36290d54a5b55bde3
glibc-2.15-a316c1f.tar.gz: aa07170ac6e14a2b3eecd45af19825fa36844dd6
glibc-manpages.tar.bz2: ca54bfb832b703c8e35170fcc1c1f5470b45ff0f
glibc-ports-2.16.0.tar.xz: 429b979b697a97befb56cce49b96ee47d708f20a
glibc-ports-2.15-ad8ae7d.tar.gz: 8626c7eb72f0cad6acf0b94d72b124b8d2dac825

View file

@ -2,8 +2,9 @@
* This version is derived from the original implementation of FreeSec
* (release 1.1) by David Burren. I've reviewed the changes made in
* OpenBSD (as of 2.7) and modified the original code in a similar way
* where applicable. I've also made it reentrant and did a number of
* other changes -- SD.
* where applicable. I've also made it reentrant and made a number of
* other changes.
* - Solar Designer <solar at openwall.com>
*/
/*
@ -36,7 +37,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Owl: Owl/packages/glibc/crypt_freesec.c,v 1.4 2005/11/16 13:08:32 solar Exp $
* $Owl: Owl/packages/glibc/crypt_freesec.c,v 1.6 2010/02/20 14:45:06 solar Exp $
* $Id: crypt.c,v 1.15 1994/09/13 04:58:49 davidb Exp $
*
* This is an original implementation of the DES and the crypt(3) interfaces
@ -54,9 +55,8 @@
* posted to the sci.crypt newsgroup by the author and is available for FTP.
*
* ARCHITECTURE ASSUMPTIONS:
* This code used to have some nasty ones, but I believe these have
* been removed by now. The code isn't very portable and requires a
* 32-bit integer type, though -- SD.
* This code used to have some nasty ones, but these have been removed
* by now. The code requires a 32-bit integer type, though.
*/
#include <sys/types.h>
@ -181,22 +181,35 @@ static u_int32_t fp_maskl[8][256], fp_maskr[8][256];
static u_int32_t key_perm_maskl[8][128], key_perm_maskr[8][128];
static u_int32_t comp_maskl[8][128], comp_maskr[8][128];
/*
* We match the behavior of UFC-crypt on systems where "char" is signed by
* default (the majority), regardless of char's signedness on our system.
*/
static inline int
ascii_to_bin(char ch)
{
if (ch > 'z')
return(0);
if (ch >= 'a')
return(ch - 'a' + 38);
if (ch > 'Z')
return(0);
if (ch >= 'A')
return(ch - 'A' + 12);
if (ch > '9')
return(0);
if (ch >= '.')
return(ch - '.');
return(0);
signed char sch = ch;
int retval;
retval = sch - '.';
if (sch >= 'A') {
retval = sch - ('A' - 12);
if (sch >= 'a')
retval = sch - ('a' - 38);
}
retval &= 0x3f;
return(retval);
}
/*
* When we choose to "support" invalid salts, nevertheless disallow those
* containing characters that would violate the passwd file format.
*/
static inline int
ascii_is_unsafe(char ch)
{
return !ch || ch == '\n' || ch == ':';
}
void
@ -626,14 +639,24 @@ _crypt_extended_r(const char *key, const char *setting,
if (*setting == _PASSWORD_EFMT1) {
/*
* "new"-style:
* setting - underscore, 4 bytes of count, 4 bytes of salt
* setting - underscore, 4 chars of count, 4 chars of salt
* key - unlimited characters
*/
for (i = 1, count = 0; i < 5; i++)
count |= ascii_to_bin(setting[i]) << (i - 1) * 6;
for (i = 1, count = 0; i < 5; i++) {
int value = ascii_to_bin(setting[i]);
if (ascii64[value] != setting[i])
return(NULL);
count |= value << (i - 1) * 6;
}
if (!count)
return(NULL);
for (i = 5, salt = 0; i < 9; i++)
salt |= ascii_to_bin(setting[i]) << (i - 5) * 6;
for (i = 5, salt = 0; i < 9; i++) {
int value = ascii_to_bin(setting[i]);
if (ascii64[value] != setting[i])
return(NULL);
salt |= value << (i - 5) * 6;
}
while (*key) {
/*
@ -652,35 +675,25 @@ _crypt_extended_r(const char *key, const char *setting,
if (des_setkey((u_char *) keybuf, data))
return(NULL);
}
strncpy(data->output, setting, 9);
/*
* Double check that we weren't given a short setting.
* If we were, the above code will probably have created
* wierd values for count and salt, but we don't really care.
* Just make sure the output string doesn't have an extra
* NUL in it.
*/
memcpy(data->output, setting, 9);
data->output[9] = '\0';
p = (u_char *) data->output + strlen(data->output);
p = (u_char *) data->output + 9;
} else {
/*
* "old"-style:
* setting - 2 bytes of salt
* setting - 2 chars of salt
* key - up to 8 characters
*/
count = 25;
if (ascii_is_unsafe(setting[0]) || ascii_is_unsafe(setting[1]))
return(NULL);
salt = (ascii_to_bin(setting[1]) << 6)
| ascii_to_bin(setting[0]);
data->output[0] = setting[0];
/*
* If the encrypted password that the salt was extracted from
* is only 1 character long, the salt will be corrupted. We
* need to ensure that the output string doesn't have an extra
* NUL in it!
*/
data->output[1] = setting[1] ? setting[1] : data->output[0];
data->output[1] = setting[1];
p = (u_char *) data->output + 2;
}
setup_salt(salt, data);
@ -734,6 +747,7 @@ static struct {
char *hash;
char *pw;
} tests[] = {
/* "new"-style */
{"_J9..CCCCXBrJUJV154M", "U*U*U*U*"},
{"_J9..CCCCXUhOBTXzaiE", "U*U***U"},
{"_J9..CCCC4gQ.mB/PffM", "U*U***U*"},
@ -746,6 +760,30 @@ static struct {
{"_J9..SDizxmRI1GjnQuE", "zxyDPWgydbQjgq"},
{"_K9..SaltNrQgIYUAeoY", "726 even"},
{"_J9..SDSD5YGyRCr4W4c", ""},
/* "old"-style, valid salts */
{"CCNf8Sbh3HDfQ", "U*U*U*U*"},
{"CCX.K.MFy4Ois", "U*U***U"},
{"CC4rMpbg9AMZ.", "U*U***U*"},
{"XXxzOu6maQKqQ", "*U*U*U*U"},
{"SDbsugeBiC58A", ""},
{"./xZjzHv5vzVE", "password"},
{"0A2hXM1rXbYgo", "password"},
{"A9RXdR23Y.cY6", "password"},
{"ZziFATVXHo2.6", "password"},
{"zZDDIZ0NOlPzw", "password"},
/* "old"-style, "reasonable" invalid salts, UFC-crypt behavior expected */
{"\001\002wyd0KZo65Jo", "password"},
{"a_C10Dk/ExaG.", "password"},
{"~\377.5OTsRVjwLo", "password"},
/* The below are erroneous inputs, so NULL return is expected/required */
{"", ""}, /* no salt */
{" ", ""}, /* setting string is too short */
{"a:", ""}, /* unsafe character */
{"\na", ""}, /* unsafe character */
{"_/......", ""}, /* setting string is too short for its type */
{"_........", ""}, /* zero iteration count */
{"_/!......", ""}, /* invalid character in count */
{"_/......!", ""}, /* invalid character in salt */
{NULL}
};
@ -753,8 +791,12 @@ int main(void)
{
int i;
for (i = 0; tests[i].hash; i++)
if (strcmp(crypt(tests[i].pw, tests[i].hash), tests[i].hash)) {
for (i = 0; tests[i].hash; i++) {
char *hash = crypt(tests[i].pw, tests[i].hash);
if (!hash && strlen(tests[i].hash) < 13)
continue; /* expected failure */
if (!strcmp(hash, tests[i].hash))
continue; /* expected success */
puts("FAILED");
return 1;
}

View file

@ -1,3 +1,12 @@
/*
* The following notice applies to this header file (only):
*
* Copyright (c) 2002,2010 Solar Designer <solar at openwall.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted.
*/
#ifndef _CRYPT_FREESEC_H
#define _CRYPT_FREESEC_H
@ -13,7 +22,29 @@ struct _crypt_extended_data {
/*
* _crypt_extended_init() must be called explicitly before first use of
* _crypt_extended_r().
* _crypt_extended_r(). Strictly speaking, _crypt_extended_init() is not
* reentrant. All it does is initialize some global variables to constant
* values, so it is unlikely that anything would go wrong if this is done
* multiple times in parallel, but correct behavior in that case is not
* guaranteed (e.g., things may go wrong if a given CPU architecture can't
* operate on 32-bit quantities natively, requiring read-modify-write
* instruction sequences operating on larger quantities and thus affecting
* nearby array elements).
*
* Before first use of the data structure, its "initialized" field must be
* set to 0. This is compatible with the requirement of some other crypt_r()
* implementations requiring the entire data structure to be initialized
* with all zero bytes, so that approach may be applied instead (e.g., this
* may be required from the callers of a wrapper function).
*
* _crypt_extended_r() returns NULL on error. Although modern standards say
* that crypt(3) does in fact return NULL on error, many applications do not
* expect that. Thus, it is recommended that a crypt(3)-like wrapper function
* translate these NULL returns into strings guaranteed to be different from
* the "setting" string, too short for matching a valid password hash, and not
* containing any characters that would be special for the passwd file format.
* Specifically, such a wrapper function may return "*0" on error as long as
* the "setting" string does not start with "*0", or "*1" otherwise.
*/
void _crypt_extended_init(void);

View file

@ -75,3 +75,14 @@
else
ptype (proc->args.decls->decl.prefix,
proc->args.decls->decl.type, 0);
--- glibc-2.14-394-g8f3b1ff/sysdeps/unix/sysv/linux/dl-osinfo.h.str_fmt~ 2011-10-19 13:03:31.000000000 +0200
+++ glibc-2.14-394-g8f3b1ff/sysdeps/unix/sysv/linux/dl-osinfo.h 2011-12-10 20:44:52.713364002 +0100
@@ -35,7 +35,7 @@ static void
__attribute__ ((__noreturn__))
dl_fatal (const char *str)
{
- _dl_dprintf (2, str);
+ _dl_dprintf (2, "%s", str);
_exit (1);
}
#endif

View file

@ -0,0 +1,12 @@
--- glibc-2.15-a316c1f/nscd/nscd_helper.c.orig 2012-02-11 20:25:37.804514879 -0200
+++ glibc-2.15-a316c1f/nscd/nscd_helper.c 2012-02-11 20:26:07.428588082 -0200
@@ -414,7 +414,8 @@ __nscd_get_mapping (request_type type, c
struct mapped_database *oldval = *mappedp;
*mappedp = result;
- if (oldval != NULL && atomic_decrement_val (&oldval->counter) == 0)
+ if (oldval != NULL && oldval != NO_MAPPING
+ && atomic_decrement_val (&oldval->counter) == 0)
__nscd_unmap (oldval);
return result;

View file

@ -1,24 +0,0 @@
--- glibc-2.16.0/crypt/wrapper.c.orig 2012-07-03 18:32:29.000000000 +0400
+++ glibc-2.16.0/crypt/wrapper.c 2012-07-03 18:42:56.935595814 +0400
@@ -326,6 +326,21 @@
weak_alias(__crypt_gensalt, crypt_gensalt)
weak_alias(crypt, fcrypt)
#endif
+/*
+ * To make fcrypt users happy.
+ * They don't need to call init_des.
+ */
+#ifdef _LIBC
+weak_alias (crypt, fcrypt)
+#else
+char *
+__fcrypt (key, salt)
+ const char *key;
+ const char *salt;
+{
+ return crypt (key, salt);
+}
+#endif
#ifdef TEST
static const char *tests[][3] = {

View file

@ -1,37 +0,0 @@
--- glibc-2.16.0/elf/rtld.c.orig 2012-07-03 14:45:24.564837876 +0400
+++ glibc-2.16.0/elf/rtld.c 2012-07-03 14:50:58.156918323 +0400
@@ -16,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+/* Early statistics require high-precision timing. */
+#define NEED_HP_TIMING_HWCAP_AVAIL 1
+
#include <errno.h>
#include <dlfcn.h>
#include <fcntl.h>
@@ -190,6 +193,12 @@
static struct libname_list _dl_rtld_libname;
static struct libname_list _dl_rtld_libname2;
+/* Run-time detect availability of high-precision timer? */
+#ifdef HP_TIMING_HWCAP_AVAIL
+# undef HP_TIMING_AVAIL
+# define HP_TIMING_AVAIL HP_TIMING_HWCAP_AVAIL
+#endif
+
/* We expect less than a second for relocation. */
#ifdef HP_SMALL_TIMING_AVAIL
# undef HP_TIMING_AVAIL
@@ -321,9 +330,8 @@
#endif
-#if HP_TIMING_AVAIL
- HP_TIMING_NOW (GL(dl_cpuclock_offset));
-#endif
+ if (HP_TIMING_AVAIL)
+ HP_TIMING_NOW (GL(dl_cpuclock_offset));
/* Initialize the stack end variable. */
__libc_stack_end = __builtin_frame_address (0);

View file

@ -1,11 +0,0 @@
--- glibc-2.16.0/scripts/check-local-headers.sh.orig 2012-07-03 13:31:41.000000000 +0400
+++ glibc-2.16.0/scripts/check-local-headers.sh 2012-07-03 13:58:54.527563305 +0400
@@ -28,7 +28,7 @@
BEGIN {
status = 0
exclude = "^" includedir \
- "/(.*-.*-.*/|)(asm[-/]|linux/|selinux/|gd|nss3/|sys/capability\\.h|libaudit\\.h|sys/sdt(-config)?\\.h))"
+ "/(.*-.*-.*/|)(asm[-/]|linux/|selinux/|multiarch-|gd|nss3/|sys/capability\\.h|libaudit\\.h|sys/sdt(-config)?\\.h))"
}
/^[^ ]/ && $1 ~ /.*:/ { obj = $1 }
{

View file

@ -1,11 +0,0 @@
--- glibc-2.16.0/time/sys/time.h.orig 2012-06-30 23:12:34.000000000 +0400
+++ glibc-2.16.0/time/sys/time.h 2012-07-03 15:55:56.473832226 +0400
@@ -77,7 +77,7 @@
This call is restricted to the super-user. */
extern int settimeofday (const struct timeval *__tv,
const struct timezone *__tz)
- __THROW __nonnull ((1));
+ __THROW;
/* Adjust the current time of day by the amount in DELTA.
If OLDDELTA is not NULL, it is filled in with the amount

View file

@ -1,12 +0,0 @@
diff -p -up glibc-2.9/Makeconfig.orig glibc-2.9/Makeconfig
--- glibc-2.9/Makeconfig.orig 2008-08-18 05:42:17.000000000 -0400
+++ glibc-2.9/Makeconfig 2009-01-15 09:44:31.000000000 -0500
@@ -226,7 +226,7 @@ inst_zonedir = $(install_root)$(zonedir)
# Where to install the locale files.
ifndef localedir
-localedir = $(libdir)/locale
+localedir = $(datadir)/locale
endif
inst_localedir = $(install_root)$(localedir)

View file

@ -1,16 +0,0 @@
--- glibc-2.16.0/rt/Makefile.orig 2012-06-30 23:12:34.000000000 +0400
+++ glibc-2.16.0/rt/Makefile 2012-07-03 15:09:01.696678685 +0400
@@ -78,3 +78,13 @@
endif
tst-mqueue7-ARGS = -- $(built-program-cmd)
+
+# XXX avoid timing issues on fine-grained SMT systems
+ifeq (powerpc, $(base-machine))
+no-parallel-testing = yes
+endif
+ifneq ($(filter %tests,$(MAKECMDGOALS)),)
+ifeq ($(no-parallel-testing),yes)
+.NOTPARALLEL:
+endif
+endif

View file

@ -1,11 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQEcBAABAgAGBQJP71ojAAoJECXvCkNsKkr/hW8IANUeX+DLwWU5lJuPTTsl6C3M
GHa3S8h7zV8uIaJPonmX4DumiacQZQLX65A2utoi90s2Y4xBrQQwmlqBzNmJGr0q
HALR14V1kp9b5xF+ovtUE41hUTaCwUBXYUp0ODXwFCJqdYJJFWJ1mUI7rWcE3AHM
MGMVyIKm5gtvRNdxSmR96S2V+5hudavChRGCgwdVy301QvqV8qnizf1WCTmxV3vC
mxjVfqZRnh0721eArz19YtnX7eU86SGWP3QaeIo+7xfpoyqwhh5Y+5yfh6MqZNZk
yCDD9jUfjhcejBTSSMaUKc3ZNssaHKm4FfQeQqCayiGGLzpbdB/WKkPV7wHlebM=
=l5tZ
-----END PGP SIGNATURE-----

View file

@ -1,26 +0,0 @@
--- glibc-2.2/nss/nsswitch.c.chmou Fri Mar 31 22:38:32 2000
+++ glibc-2.2/nss/nsswitch.c Wed Nov 22 00:35:53 2000
@@ -333,9 +333,20 @@
ni->library->lib_handle = __libc_dlopen (shlib_name);
if (ni->library->lib_handle == NULL)
{
- /* Failed to load the library. */
- ni->library->lib_handle = (void *) -1l;
- __set_errno (saved_errno);
+ /* Failed to load the library. Try a fallback. */
+ int n = __snprintf(shlib_name, shlen, "libnss_%s.so.%d.%d",
+ ni->library->name, __GLIBC__, __GLIBC_MINOR__);
+ if (n >= shlen)
+ ni->library->lib_handle = NULL;
+ else
+ ni->library->lib_handle = __libc_dlopen (shlib_name);
+
+ if (ni->library->lib_handle == NULL)
+ {
+ /* Ok, really fail now. */
+ ni->library->lib_handle = (void *) -1l;
+ __set_errno (saved_errno);
+ }
}
}

View file

@ -1,47 +0,0 @@
--- glibc-2.3.2/sysdeps/unix/sysv/linux/tcsetattr.c.tcsetattr-kernel-bug-workaround 2003-02-24 21:26:01.000000000 +0100
+++ glibc-2.3.2/sysdeps/unix/sysv/linux/tcsetattr.c 2003-06-05 11:11:01.000000000 +0200
@@ -56,6 +56,7 @@ tcsetattr (fd, optional_actions, termios
{
struct __kernel_termios k_termios;
unsigned long int cmd;
+ int retval;
switch (optional_actions)
{
@@ -87,6 +88,35 @@ tcsetattr (fd, optional_actions, termios
memcpy (&k_termios.c_cc[0], &termios_p->c_cc[0],
__KERNEL_NCCS * sizeof (cc_t));
- return INLINE_SYSCALL (ioctl, 3, fd, cmd, &k_termios);
+ retval = INLINE_SYSCALL (ioctl, 3, fd, cmd, &k_termios);
+
+ if (retval == 0 && cmd == TCSETS)
+ {
+ /* The Linux kernel has a bug which silently ignore the invalid
+ c_cflag on pty. We have to check it here. */
+ int save = errno;
+ retval = INLINE_SYSCALL (ioctl, 3, fd, TCGETS, &k_termios);
+ if (retval)
+ {
+ /* We cannot verify if the setting is ok. We don't return
+ an error (?). */
+ __set_errno (save);
+ retval = 0;
+ }
+ else if ((termios_p->c_cflag & (PARENB | CREAD))
+ != (k_termios.c_cflag & (PARENB | CREAD))
+ || ((termios_p->c_cflag & CSIZE)
+ && ((termios_p->c_cflag & CSIZE)
+ != (k_termios.c_cflag & CSIZE))))
+ {
+ /* It looks like the Linux kernel silently changed the
+ PARENB/CREAD/CSIZE bits in c_cflag. Report it as an
+ error. */
+ __set_errno (EINVAL);
+ retval = -1;
+ }
+ }
+
+ return retval;
}
libc_hidden_def (tcsetattr)

View file

@ -1,5 +1,5 @@
--- glibc-2.16.0/crypt/x86.S.orig 2011-07-16 19:09:42.000000000 +0400
+++ glibc-2.16.0/crypt/x86.S 2012-07-04 15:08:57.743556929 +0400
--- crypt/x86.S 2011-07-16 11:09:42.000000000 -0400
+++ crypt/x86.S.oden 2011-11-25 04:07:23.574489383 -0500
@@ -42,7 +42,7 @@
#define DO_ALIGN(log) .align (1 << (log))
#endif

View file

@ -0,0 +1,132 @@
2006-05-17 Gwenole Beauchesne <gbeauchesne@mandriva.com>
* Update and simplify for glibc 2.4.90.
2002-12-07 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com>
Let an i586 rtld load i686 libraries (especially libpthread)
* elf/rtld.c (HP_TIMING_AVAIL): Redefine to HP_TIMING_HWCAP_AVAIL
since early statistics require high-precision timers.
* sysdeps/generic/ldsodefs.h (rtld_global): Declare
_dl_cpuclock_offset if HP_TIMING_HWCAP_AVAIL is defined too.
* sysdeps/unix/sysv/linux/i386/i586/Makefile: New file.
* sysdeps/unix/sysv/linux/i386/i586/hp-timing.c: New file.
* sysdeps/unix/sysv/linux/i386/i586/hp-timing.h: New file.
--- glibc-2.4.90/elf/rtld.c.i586-hptiming 2006-04-27 14:54:33.000000000 +0200
+++ glibc-2.4.90/elf/rtld.c 2006-05-17 08:31:50.000000000 +0200
@@ -17,6 +17,9 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+/* Early statistics require high-precision timing. */
+#define NEED_HP_TIMING_HWCAP_AVAIL 1
+
#include <errno.h>
#include <dlfcn.h>
#include <fcntl.h>
@@ -178,6 +181,12 @@ static void dl_main (const ElfW(Phdr) *p
static struct libname_list _dl_rtld_libname;
static struct libname_list _dl_rtld_libname2;
+/* Run-time detect availability of high-precision timer? */
+#ifdef HP_TIMING_HWCAP_AVAIL
+# undef HP_TIMING_AVAIL
+# define HP_TIMING_AVAIL HP_TIMING_HWCAP_AVAIL
+#endif
+
/* We expect less than a second for relocation. */
#ifdef HP_SMALL_TIMING_AVAIL
# undef HP_TIMING_AVAIL
@@ -311,9 +320,8 @@ _dl_start_final (void *arg, struct dl_st
#endif
-#if HP_TIMING_AVAIL
- HP_TIMING_NOW (GL(dl_cpuclock_offset));
-#endif
+ if (HP_TIMING_AVAIL)
+ HP_TIMING_NOW (GL(dl_cpuclock_offset));
/* Initialize the stack end variable. */
__libc_stack_end = __builtin_frame_address (0);
--- glibc-2.4.90/sysdeps/generic/ldsodefs.h.i586-hptiming 2006-05-10 15:42:19.000000000 +0200
+++ glibc-2.4.90/sysdeps/generic/ldsodefs.h 2006-05-17 08:13:21.000000000 +0200
@@ -408,7 +408,7 @@ struct rtld_global
/* The object to be initialized first. */
EXTERN struct link_map *_dl_initfirst;
-#if HP_TIMING_AVAIL || HP_SMALL_TIMING_AVAIL
+#if HP_TIMING_AVAIL || HP_SMALL_TIMING_AVAIL || defined HP_TIMING_HWCAP_AVAIL
/* Start time on CPU clock. */
EXTERN hp_timing_t _dl_cpuclock_offset;
#endif
@@ -619,7 +619,7 @@ struct rtld_global_ro
/* All search directories defined at startup. */
EXTERN struct r_search_path_elem *_dl_init_all_dirs;
-#if HP_TIMING_AVAIL || HP_SMALL_TIMING_AVAIL
+#if HP_TIMING_AVAIL || HP_SMALL_TIMING_AVAIL || defined HP_TIMING_HWCAP_AVAIL
/* Overhead of a high-precision timing measurement. */
EXTERN hp_timing_t _dl_hp_timing_overhead;
#endif
--- glibc-2.4.90/sysdeps/i386/i586/Makefile.i586-hptiming 2006-05-17 06:35:29.000000000 +0200
+++ glibc-2.4.90/sysdeps/i386/i586/Makefile 2006-05-17 06:35:41.000000000 +0200
@@ -0,0 +1,4 @@
+ifeq ($(subdir),csu)
+sysdep_routines += hp-timing
+static-only-routines += hp-timing
+endif
--- glibc-2.4.90/sysdeps/i386/i586/hp-timing.c.i586-hptiming 2006-05-17 06:36:28.000000000 +0200
+++ glibc-2.4.90/sysdeps/i386/i586/hp-timing.c 2006-05-17 08:17:51.000000000 +0200
@@ -0,0 +1,2 @@
+/* We can use the i686 implementation without changes. */
+#include <sysdeps/i386/i686/hp-timing.c>
--- glibc-2.4.90/sysdeps/i386/i586/hp-timing.h.i586-hptiming 2006-05-17 06:37:28.000000000 +0200
+++ glibc-2.4.90/sysdeps/i386/i586/hp-timing.h 2006-05-17 08:30:06.000000000 +0200
@@ -0,0 +1,43 @@
+#ifndef _HP_HWCAP_TIMING_H
+#define _HP_HWCAP_TIMING_H 1
+
+/* We can use the i686 implementation with slight changes. */
+#include <sysdeps/i386/i686/hp-timing.h>
+
+/* We need the definition of HWCAP_I386_TSC. */
+#include <sysdeps/i386/dl-hwcapinfo.h>
+
+/* We need to perform a runtime check for the timestamp register. */
+#undef HP_TIMING_AVAIL
+#define HP_TIMING_AVAIL (0)
+
+/* HP_TIMING_HWCAP_AVAIL: this macro performs a run-time check for the
+ capability. */
+#define HP_TIMING_HWCAP_AVAIL (_dl_hp_timing_avail())
+
+/* Perform the TSC check. */
+#ifdef NEED_HP_TIMING_HWCAP_AVAIL
+static inline
+unsigned int
+_dl_cpuid_edx (unsigned int op)
+{
+ unsigned int edx;
+ __asm__ __volatile__("push %%ebx ; cpuid ; pop %%ebx"
+ : "=d" (edx) : "a" (op) : "ecx");
+ return edx;
+}
+
+static int
+internal_function
+_dl_hp_timing_avail (void)
+{
+ static int has_tsc = -1;
+
+ if (__builtin_expect (has_tsc == -1, 0))
+ has_tsc = (_dl_cpuid_edx(1) & HWCAP_I386_TSC) == HWCAP_I386_TSC;
+
+ return has_tsc;
+}
+#endif
+
+#endif /* hp-timing.h */

View file

@ -0,0 +1,24 @@
2006-07-26 Gwenole Beauchesne <gbeauchesne@mandriva.com>
* rt/Makefile (tests): Don't run tests in parallel on fine-grained
SMT systems.
--- glibc-2.4.90/rt/Makefile.testsuite-rt-notparallel 2006-02-16 09:32:18.000000000 -0500
+++ glibc-2.4.90/rt/Makefile 2006-10-25 03:00:03.000000000 -0400
@@ -81,6 +81,16 @@ endif
tst-mqueue7-ARGS = -- $(built-program-cmd)
+# XXX avoid timing issues on fine-grained SMT systems
+ifeq (powerpc, $(base-machine))
+no-parallel-testing = yes
+endif
+ifneq ($(filter %tests,$(MAKECMDGOALS)),)
+ifeq ($(no-parallel-testing),yes)
+.NOTPARALLEL:
+endif
+endif
+
ifeq (yes,$(build-static-nss))
otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
$(resolvobjdir)/libresolv.a

View file

@ -1,67 +1,13 @@
--- crypt/wrapper.c.org 2008-06-17 13:29:30.000000000 -0600
+++ crypt/wrapper.c 2008-06-17 15:33:47.000000000 -0600
@@ -54,6 +58,11 @@ extern char *__md5_crypt_r(const char *k
extern char *__des_crypt_r(const char *key, const char *salt,
struct crypt_data *data);
extern struct crypt_data _ufc_foobar;
+/* support for sha256-crypt and sha512-crypt */
+extern char *__sha256_crypt_r (const char *key, const char *salt,
+ char *buffer, int buflen);
+extern char *__sha512_crypt_r (const char *key, const char *salt,
+ char *buffer, int buflen);
#endif
static int _crypt_data_alloc(void **data, int *size, int need)
@@ -142,6 +151,10 @@ char *__crypt_rn(__const char *key, __co
return _crypt_blowfish_rn(key, setting, (char *)data, size);
if (setting[0] == '$' && setting[1] == '1')
return __md5_crypt_r(key, setting, (char *)data, size);
+ if (setting[0] == '$' && setting[1] == '5')
+ return __sha256_crypt_r(key, setting, (char *)data, size);
+ if (setting[0] == '$' && setting[1] == '6')
+ return __sha512_crypt_r(key, setting, (char *)data, size);
if (setting[0] == '$') goto out_einval;
if (setting[0] == '_') {
if (size < sizeof(struct _crypt_extended_data)) goto out_erange;
@@ -181,6 +194,16 @@ char *__crypt_ra(__const char *key, __co
return NULL;
return __md5_crypt_r(key, setting, (char *)*data, *size);
}
+ if (setting[0] == '$' && setting[1] == '5') {
+ if (_crypt_data_alloc(data, size, CRYPT_OUTPUT_SIZE))
+ return NULL;
+ return __sha256_crypt_r(key, setting, (char *)*data, *size);
+ }
+ if (setting[0] == '$' && setting[1] == '6') {
+ if (_crypt_data_alloc(data, size, CRYPT_OUTPUT_SIZE))
+ return NULL;
+ return __sha512_crypt_r(key, setting, (char *)*data, *size);
+ }
if (setting[0] == '$') goto out_einval;
if (setting[0] == '_') {
if (_crypt_data_alloc(data, size,
@@ -271,6 +294,12 @@ char *__crypt_gensalt_rn(__CONST char *p
if (!strncmp(prefix, "$1$", 3))
use = _crypt_gensalt_md5_rn;
else
+ if (!strncmp(prefix, "$5$", 3))
+ use = _crypt_gensalt_sha256c_rn;
+ else
+ if (!strncmp(prefix, "$6$", 3))
+ use = _crypt_gensalt_sha512c_rn;
+ else
if (prefix[0] == '_')
use = _crypt_gensalt_extended_rn;
else
--- crypt/crypt_gensalt.c.org 2008-06-17 13:31:49.000000000 -0600
+++ crypt/crypt_gensalt.c 2008-06-17 15:30:35.000000000 -0600
@@ -109,3 +109,78 @@ char *_crypt_gensalt_md5_rn(unsigned lon
diff -Naurp glibc-2.14-121-g5551a7b/crypt/crypt_gensalt.c glibc-2.14-121-g5551a7b.oden/crypt/crypt_gensalt.c
--- glibc-2.14-121-g5551a7b/crypt/crypt_gensalt.c 2011-07-16 11:06:53.000000000 -0400
+++ glibc-2.14-121-g5551a7b.oden/crypt/crypt_gensalt.c 2011-11-25 04:08:39.264489146 -0500
@@ -122,3 +122,78 @@ char *_crypt_gensalt_md5_rn(const char *
return output;
}
+
+char *_crypt_gensalt_sha256c_rn(unsigned long count,
+ __CONST char *input, int size, char *output, int output_size)
+ const char *input, int size, char *output, int output_size)
+{
+ unsigned long value;
+
@ -99,7 +45,7 @@
+
+
+char *_crypt_gensalt_sha512c_rn(unsigned long count,
+ __CONST char *input, int size, char *output, int output_size)
+ const char *input, int size, char *output, int output_size)
+{
+ unsigned long value;
+
@ -134,15 +80,72 @@
+
+ return output;
+}
--- crypt/crypt_gensalt.h.orig 2012-07-04 17:42:27.151565561 +0400
+++ crypt/crypt_gensalt.h 2012-07-04 17:44:20.351588292 +0400
@@ -26,5 +26,9 @@
diff -Naurp glibc-2.14-121-g5551a7b/crypt/crypt_gensalt.h glibc-2.14-121-g5551a7b.oden/crypt/crypt_gensalt.h
--- glibc-2.14-121-g5551a7b/crypt/crypt_gensalt.h 2011-07-16 10:58:39.000000000 -0400
+++ glibc-2.14-121-g5551a7b.oden/crypt/crypt_gensalt.h 2011-11-25 04:13:34.984489216 -0500
@@ -26,5 +26,8 @@ extern char *_crypt_gensalt_extended_rn(
const char *input, int size, char *output, int output_size);
extern char *_crypt_gensalt_md5_rn(const char *prefix, unsigned long count,
const char *input, int size, char *output, int output_size);
-
+extern char *_crypt_gensalt_sha256c_rn(unsigned long count,
+ const char *input, int size, char *output, int output_size);
+extern char *_crypt_gensalt_sha512c_rn(unsigned long count,
+ const char *input, int size, char *output, int output_size);
#endif
diff -Naurp glibc-2.14-121-g5551a7b/crypt/wrapper.c glibc-2.14-121-g5551a7b.oden/crypt/wrapper.c
--- glibc-2.14-121-g5551a7b/crypt/wrapper.c 2011-11-25 04:08:23.654489356 -0500
+++ glibc-2.14-121-g5551a7b.oden/crypt/wrapper.c 2011-11-25 04:08:39.264489146 -0500
@@ -55,6 +55,11 @@ extern char *__md5_crypt_r(const char *k
extern char *__des_crypt_r(const char *key, const char *salt,
struct crypt_data *data);
extern struct crypt_data _ufc_foobar;
+/* support for sha256-crypt and sha512-crypt */
+extern char *__sha256_crypt_r (const char *key, const char *salt,
+ char *buffer, int buflen);
+extern char *__sha512_crypt_r (const char *key, const char *salt,
+ char *buffer, int buflen);
#endif
static int _crypt_data_alloc(void **data, int *size, int need)
@@ -140,6 +145,10 @@ char *__crypt_rn(__const char *key, __co
return _crypt_blowfish_rn(key, setting, (char *)data, size);
if (setting[0] == '$' && setting[1] == '1')
return __md5_crypt_r(key, setting, (char *)data, size);
+ if (setting[0] == '$' && setting[1] == '5')
+ return __sha256_crypt_r(key, setting, (char *)data, size);
+ if (setting[0] == '$' && setting[1] == '6')
+ return __sha512_crypt_r(key, setting, (char *)data, size);
if (setting[0] == '$') goto out_einval;
if (setting[0] == '_') {
if (size < sizeof(struct _crypt_extended_data)) goto out_erange;
@@ -179,6 +188,16 @@ char *__crypt_ra(__const char *key, __co
return NULL;
return __md5_crypt_r(key, setting, (char *)*data, *size);
}
+ if (setting[0] == '$' && setting[1] == '5') {
+ if (_crypt_data_alloc(data, size, CRYPT_OUTPUT_SIZE))
+ return NULL;
+ return __sha256_crypt_r(key, setting, (char *)*data, *size);
+ }
+ if (setting[0] == '$' && setting[1] == '6') {
+ if (_crypt_data_alloc(data, size, CRYPT_OUTPUT_SIZE))
+ return NULL;
+ return __sha512_crypt_r(key, setting, (char *)*data, *size);
+ }
if (setting[0] == '$') goto out_einval;
if (setting[0] == '_') {
if (_crypt_data_alloc(data, size,
@@ -270,6 +289,12 @@ char *__crypt_gensalt_rn(const char *pre
if (!strncmp(prefix, "$1$", 3))
use = _crypt_gensalt_md5_rn;
else
+ if (!strncmp(prefix, "$5$", 3))
+ use = _crypt_gensalt_sha256c_rn;
+ else
+ if (!strncmp(prefix, "$6$", 3))
+ use = _crypt_gensalt_sha512c_rn;
+ else
if (prefix[0] == '_')
use = _crypt_gensalt_extended_rn;
else

View file

@ -0,0 +1,49 @@
diff -Naurp glibc-2.14-121-g5551a7b/crypt/crypt-entry.c glibc-2.14-121-g5551a7b.oden/crypt/crypt-entry.c
--- glibc-2.14-121-g5551a7b/crypt/crypt-entry.c 2011-11-25 05:00:43.214487962 -0500
+++ glibc-2.14-121-g5551a7b.oden/crypt/crypt-entry.c 2011-11-25 05:04:42.044487854 -0500
@@ -164,18 +164,3 @@ crypt (key, salt)
#endif
-/*
- * To make fcrypt users happy.
- * They don't need to call init_des.
- */
-#ifdef _LIBC
-weak_alias (crypt, fcrypt)
-#else
-char *
-__fcrypt (key, salt)
- const char *key;
- const char *salt;
-{
- return crypt (key, salt);
-}
-#endif
diff -Naurp glibc-2.14-121-g5551a7b/crypt/wrapper.c glibc-2.14-121-g5551a7b.oden/crypt/wrapper.c
--- glibc-2.14-121-g5551a7b/crypt/wrapper.c 2011-11-25 05:00:43.224487962 -0500
+++ glibc-2.14-121-g5551a7b.oden/crypt/wrapper.c 2011-11-25 05:05:14.264487791 -0500
@@ -324,7 +324,22 @@ weak_alias(__crypt, crypt)
weak_alias(__crypt_gensalt_rn, crypt_gensalt_rn)
weak_alias(__crypt_gensalt_ra, crypt_gensalt_ra)
weak_alias(__crypt_gensalt, crypt_gensalt)
-weak_alias(crypt, fcrypt)
+#endif
+
+/*
+ * To make fcrypt users happy.
+ * They don't need to call init_des.
+ */
+#ifdef _LIBC
+weak_alias (crypt, fcrypt)
+#else
+char *
+__fcrypt (key, salt)
+ const char *key;
+ const char *salt;
+{
+ return crypt (key, salt);
+}
#endif
#ifdef TEST

View file

@ -0,0 +1,36 @@
diff -p -up glibc-2.9/Makeconfig.orig glibc-2.9/Makeconfig
--- glibc-2.9/Makeconfig.orig 2008-08-18 05:42:17.000000000 -0400
+++ glibc-2.9/Makeconfig 2009-01-15 09:44:31.000000000 -0500
@@ -226,7 +226,7 @@ inst_zonedir = $(install_root)$(zonedir)
# Where to install the locale files.
ifndef localedir
-localedir = $(libdir)/locale
+localedir = $(datadir)/locale
endif
inst_localedir = $(install_root)$(localedir)
diff -p -up glibc-2.9/sysdeps/unix/sysv/linux/configure.in.orig glibc-2.9/sysdeps/unix/sysv/linux/configure.in
--- glibc-2.9/sysdeps/unix/sysv/linux/configure.in.orig 2008-04-11 17:13:38.000000000 -0400
+++ glibc-2.9/sysdeps/unix/sysv/linux/configure.in 2009-01-15 09:44:31.000000000 -0500
@@ -169,7 +169,7 @@ case "$prefix" in
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib64';
# Locale data can be shared between 32bit and 64bit libraries
- libc_cv_localedir='${exec_prefix}/lib/locale'
+ libc_cv_localedir='${datadir}/locale'
fi
;;
*)
diff -p -up glibc-2.9/sysdeps/unix/sysv/linux/configure.orig glibc-2.9/sysdeps/unix/sysv/linux/configure
--- glibc-2.9/sysdeps/unix/sysv/linux/configure.orig 2008-04-11 17:13:51.000000000 -0400
+++ glibc-2.9/sysdeps/unix/sysv/linux/configure 2009-01-15 09:44:31.000000000 -0500
@@ -381,7 +381,7 @@ case "$prefix" in
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib64';
# Locale data can be shared between 32bit and 64bit libraries
- libc_cv_localedir='${exec_prefix}/lib/locale'
+ libc_cv_localedir='${datadir}/locale'
fi
;;
*)

0
glibc-check.sh Executable file → Normal file
View file

File diff suppressed because it is too large Load diff

View file

@ -1,11 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQEcBAABAgAGBQJP71okAAoJECXvCkNsKkr/sNQIAL9cDaYqmOuvl2dNQoAgZxHW
43BhiOG3gOSGzooEGFSwJZdR1QlT8Nk9/SMIpiR6m5v6EzT/UjmpXE9l8FgwR31X
aXZDGqWy+kvpAkPh+xGzPVTaGHHifuGTUQQctiEMfMiGdjl9sSV42YpTARb//xgE
qPA2MhBWZOCjJgY9D4rGlV9sopZ99jbntv69O0RcKDGNrciGE/DuuXXmLtnfSI3F
XxpZWVZMNUQDU73bWXCCbe/agVOmmvGz0SY9T+RA1ui4XBk705m+9JrWqe00xqJi
t9UkjU7DsTZ86q+lnCTMV4/LpAehUsgKYJnzgraI1t/bxrHZQk3BsmPqhxScO1Y=
=4OMI
-----END PGP SIGNATURE-----

13
glibc-rh446078.patch Normal file
View file

@ -0,0 +1,13 @@
diff --git a/localedata/locales/it_IT b/localedata/locales/it_IT
index 31acd53..9513970 100644
--- a/localedata/locales/it_IT
+++ b/localedata/locales/it_IT
@@ -124,6 +124,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0065><U0020><U0025>/
<U0062><U0020><U0025><U0059><U002C><U0020><U0025><U0048><U002E>/
<U0025><U004D><U002E><U0025><U0053><U002C><U0020><U0025><U005A>"
+first_weekday 2
+first_workday 2
END LC_TIME
LC_PAPER

13
glibc-rh454629.patch Normal file
View file

@ -0,0 +1,13 @@
diff --git a/localedata/locales/ca_ES b/localedata/locales/ca_ES
index cd83bcc..3c14340 100644
--- a/localedata/locales/ca_ES
+++ b/localedata/locales/ca_ES
@@ -138,6 +138,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_weekday 2
+first_workday 2
END LC_TIME
LC_PAPER

27
glibc-rh552960-2.patch Normal file
View file

@ -0,0 +1,27 @@
diff -rup a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S 2012-02-10 12:49:42.609737373 -0700
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S 2012-02-10 12:52:00.962150379 -0700
@@ -438,6 +438,10 @@ __pthread_cond_wait:
addl $1, cond_futex(%ebx)
movl cond_futex(%ebx), %ebp
+ /* Increment total_seq to ensure we do not lose wakeups. */
+ addl $1, total_seq(%ebx)
+ adcl $0, total_seq+4(%ebx)
+
/* Unlock. */
LOCK
#if cond_lock == 0
diff -rup a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S 2012-02-10 12:49:42.612737361 -0700
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S 2012-02-10 12:52:36.179000963 -0700
@@ -366,6 +366,9 @@ __pthread_cond_wait:
incl cond_futex(%rdi)
movl cond_futex(%rdi), %edx
+ /* Increment total_seq to ensure we do not lose wakeups. */
+ incq total_seq(%rdi)
+
/* Release internal lock. */
LOCK
#if cond_lock == 0

13
glibc-rh622499.patch Normal file
View file

@ -0,0 +1,13 @@
diff --git a/localedata/locales/lt_LT b/localedata/locales/lt_LT
index b709d83..63cb6de 100644
--- a/localedata/locales/lt_LT
+++ b/localedata/locales/lt_LT
@@ -2191,6 +2191,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_weekday 2
+first_workday 2
END LC_TIME
LC_MESSAGES

13
glibc-rh624296.patch Normal file
View file

@ -0,0 +1,13 @@
diff -rup a/localedata/locales/ru_UA b/localedata/locales/ru_UA
--- a/localedata/locales/ru_UA 2012-01-01 05:16:32.000000000 -0700
+++ b/localedata/locales/ru_UA 2012-02-09 22:57:29.698433625 -0700
@@ -141,6 +141,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_weekday 2
+first_workday 2
END LC_TIME
LC_PAPER
Only in b/localedata/locales: uk_UA.rej

View file

@ -1,14 +0,0 @@
diff -rup a/sysdeps/unix/sysv/linux/check_pf.c b/sysdeps/unix/sysv/linux/check_pf.c
--- a/sysdeps/unix/sysv/linux/check_pf.c 2012-02-16 22:51:17.148797741 -0700
+++ b/sysdeps/unix/sysv/linux/check_pf.c 2012-02-17 10:55:26.513139941 -0700
@@ -209,7 +209,8 @@ make_request (int fd, pid_t pid)
}
else
{
- if (!IN6_IS_ADDR_LOOPBACK (address))
+ if (!IN6_IS_ADDR_LOOPBACK (address)
+ && !IN6_IS_ADDR_LINKLOCAL (address))
seen_ipv6 = true;
}
}
Only in b/sysdeps/x86_64: .dl-trampoline.S.swp

56
glibc-rh729661.patch Normal file
View file

@ -0,0 +1,56 @@
diff -rup a/elf/dl-deps.c b/elf/dl-deps.c
--- a/elf/dl-deps.c 2012-01-23 14:28:15.888185967 -0700
+++ b/elf/dl-deps.c 2012-01-23 14:29:11.620197431 -0700
@@ -634,7 +634,7 @@ Filters not supported with LD_TRACE_PREL
/* We can skip looking for the binary itself which is at the front
of the search list. */
i = 1;
- char seen[nlist];
+ uint16_t seen[nlist];
memset (seen, 0, nlist * sizeof (seen[0]));
while (1)
{
@@ -660,13 +660,13 @@ Filters not supported with LD_TRACE_PREL
(k - i) * sizeof (l_initfini[0]));
l_initfini[k] = thisp;
- if (seen[i + 1] > 1)
+ if (seen[i + 1] > nlist - i)
{
++i;
goto next_clear;
}
- char this_seen = seen[i];
+ uint16_t this_seen = seen[i];
memmove (&seen[i], &seen[i + 1],
(k - i) * sizeof (seen[0]));
seen[k] = this_seen;
diff -rup a/elf/dl-fini.c b/elf/dl-fini.c
--- a/elf/dl-fini.c 2012-01-01 05:16:32.000000000 -0700
+++ b/elf/dl-fini.c 2012-01-23 14:29:39.661203226 -0700
@@ -39,7 +39,7 @@ _dl_sort_fini (struct link_map **maps, s
/* We can skip looking for the binary itself which is at the front
of the search list for the main namespace. */
unsigned int i = ns == LM_ID_BASE;
- char seen[nmaps];
+ uint16_t seen[nmaps];
memset (seen, 0, nmaps * sizeof (seen[0]));
while (1)
{
@@ -79,13 +79,13 @@ _dl_sort_fini (struct link_map **maps, s
used[k] = here_used;
}
- if (seen[i + 1] > 1)
+ if (seen[i + 1] > nmaps - i)
{
++i;
goto next_clear;
}
- char this_seen = seen[i];
+ uint16_t this_seen = seen[i];
memmove (&seen[i], &seen[i + 1], (k - i) * sizeof (seen[0]));
seen[k] = this_seen;

View file

@ -1,52 +1,16 @@
diff -rup a/resolv/res_query.c b/resolv/res_query.c
--- a/resolv/res_query.c 2012-02-16 22:51:17.451796009 -0700
+++ b/resolv/res_query.c 2012-02-16 22:54:42.522623598 -0700
@@ -122,6 +122,7 @@ __libc_res_nquery(res_state statp,
int *resplen2)
{
HEADER *hp = (HEADER *) answer;
+ HEADER *hp2;
int n, use_malloc = 0;
u_int oflags = statp->_flags;
@@ -239,26 +240,25 @@ __libc_res_nquery(res_state statp,
/* __libc_res_nsend might have reallocated the buffer. */
hp = (HEADER *) *answerp;
- /* We simplify the following tests by assigning HP to HP2. It
- is easy to verify that this is the same as ignoring all
- tests of HP2. */
- HEADER *hp2 = answerp2 ? (HEADER *) *answerp2 : hp;
-
- if (n < (int) sizeof (HEADER) && answerp2 != NULL
- && *resplen2 > (int) sizeof (HEADER))
+ /* We simplify the following tests by assigning HP to HP2 or
+ vice versa. It is easy to verify that this is the same as
+ ignoring all tests of HP or HP2. */
+ if (answerp2 == NULL || *resplen2 < (int) sizeof (HEADER))
2011-09-01 Andreas Schwab <schwab@redhat.com>
* resolv/res_query.c (__libc_res_nquery): Update assertion.
diff -ru a/resolv/res_query.c b/resolv/res_query.c
--- a/resolv/res_query.c 2011-12-12 14:10:52.000000000 -0700
+++ b/resolv/res_query.c 2011-12-12 14:23:04.832739111 -0700
@@ -248,7 +248,7 @@
&& *resplen2 > (int) sizeof (HEADER))
{
- /* Special case of partial answer. */
/* Special case of partial answer. */
- assert (hp != hp2);
- hp = hp2;
+ hp2 = hp;
+ assert (n == 0 || hp != hp2);
hp = hp2;
}
- else if (answerp2 != NULL && *resplen2 < (int) sizeof (HEADER)
- && n > (int) sizeof (HEADER))
+ else
{
- /* Special case of partial answer. */
- assert (hp != hp2);
- hp2 = hp;
+ hp2 = (HEADER *) *answerp2;
+ if (n < (int) sizeof (HEADER))
+ {
+ hp = hp2;
+ }
}
+ /* Make sure both hp and hp2 are defined */
+ assert((hp != NULL) && (hp2 != NULL));
+
if ((hp->rcode != NOERROR || ntohs(hp->ancount) == 0)
&& (hp2->rcode != NOERROR || ntohs(hp2->ancount) == 0)) {
#ifdef DEBUG
else if (answerp2 != NULL && *resplen2 < (int) sizeof (HEADER)

View file

@ -1,55 +0,0 @@
2009-04-26 Aurelien Jarno <aurelien@aurel32.net>
* sysdeps/posix/getaddrinfo.c (rfc3484_sort): don't assign native
result if the result has no associated interface.
---
sysdeps/posix/getaddrinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -1456,13 +1456,13 @@
/* Fill in the results in all the records. */
for (int i = 0; i < src->nresults; ++i)
- if (src->results[i].index == a1_index)
+ if (a1_index != -1 && src->results[i].index == a1_index)
{
assert (src->results[i].native == -1
|| src->results[i].native == a1_native);
src->results[i].native = a1_native;
}
- else if (src->results[i].index == a2_index)
+ else if (a2_index != -1 && src->results[i].index == a2_index)
{
assert (src->results[i].native == -1
|| src->results[i].native == a2_native);
2009-03-15 Aurelien Jarno <aurelien@aurel32.net>
* sysdeps/posix/getaddrinfo.c (getaddrinfo): correctly detect
interface for all 127.X.Y.Z addresses.
---
sysdeps/posix/getaddrinfo.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -2265,7 +2265,14 @@
tmp.addr[0] = 0;
tmp.addr[1] = 0;
tmp.addr[2] = htonl (0xffff);
- tmp.addr[3] = sinp->sin_addr.s_addr;
+ /* Special case for lo interface, the source address
+ being possibly different than the interface
+ address. */
+ if ((ntohl(sinp->sin_addr.s_addr) & 0xff000000)
+ == 0x7f000000)
+ tmp.addr[3] = htonl(0x7f000001);
+ else
+ tmp.addr[3] = sinp->sin_addr.s_addr;
}
else
{

40
glibc-rh740506.patch Normal file
View file

@ -0,0 +1,40 @@
* malloc/arena.c (arena_get2): Avoid unnecessarily
retrieving #cpus from /proc.
* malloc/malloc.c (mALLOPt): Clamp arena_test based on
the value of arena_max.
commit 41b81892f11fe1353123e892158b53de73863d62
Author: Ulrich Drepper <drepper@gmail.com>
Date: Tue Jan 31 14:42:34 2012 -0500
Handle ARENA_TEST correctly
diff --git a/malloc/arena.c b/malloc/arena.c
index d3cf4b9..b1c9469 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -828,7 +828,7 @@ arena_get2(mstate a_tsd, size_t size)
{
if (mp_.arena_max != 0)
narenas_limit = mp_.arena_max;
- else
+ else if (narenas > mp_.arena_test)
{
int n = __get_nprocs ();
@@ -842,7 +842,14 @@ arena_get2(mstate a_tsd, size_t size)
}
repeat:;
size_t n = narenas;
- if (__builtin_expect (n <= mp_.arena_test || n < narenas_limit, 0))
+ /* NB: the following depends on the fact that (size_t)0 - 1 is a
+ very large number and that the underflow is OK. If arena_max
+ is set the value of arena_test is irrelevant. If arena_test
+ is set but narenas is not yet larger or equal to arena_test
+ narenas_limit is 0. There is no possibility for narenas to
+ be too big for the test to always fail since there is not
+ enough address space to create that many arenas. */
+ if (__builtin_expect (n <= narenas_limit - 1, 0))
{
if (catomic_compare_and_exchange_bool_acq (&narenas, n + 1, n))
goto repeat;

12
glibc-rh740682.patch Normal file
View file

@ -0,0 +1,12 @@
diff -rup a/time/sys/time.h b/time/sys/time.h
--- a/time/sys/time.h 2012-01-01 05:16:32.000000000 -0700
+++ b/time/sys/time.h 2012-01-26 11:16:44.309112430 -0700
@@ -78,7 +78,7 @@ extern int gettimeofday (struct timeval
This call is restricted to the super-user. */
extern int settimeofday (__const struct timeval *__tv,
__const struct timezone *__tz)
- __THROW __nonnull ((1));
+ __THROW;
/* Adjust the current time of day by the amount in DELTA.
If OLDDELTA is not NULL, it is filled in with the amount

View file

@ -1,7 +1,8 @@
diff -Nrup a/malloc/arena.c b/malloc/arena.c
--- a/malloc/arena.c 2012-05-29 16:45:53.000000000 -0600
+++ b/malloc/arena.c 2012-05-30 00:13:40.683514016 -0600
@@ -673,7 +673,7 @@ heap_trim(heap_info *heap, size_t pad)
Index: glibc-2.12-2-gc4ccff1/malloc/arena.c
===================================================================
--- glibc-2.12-2-gc4ccff1.orig/malloc/arena.c
+++ glibc-2.12-2-gc4ccff1/malloc/arena.c
@@ -870,7 +870,7 @@ heap_trim(heap, pad) heap_info *heap; si
heap = prev_heap;
if(!prev_inuse(p)) { /* consolidate backward */
p = prev_chunk(p);
@ -10,10 +11,11 @@ diff -Nrup a/malloc/arena.c b/malloc/arena.c
}
assert(((unsigned long)((char*)p + new_size) & (pagesz-1)) == 0);
assert( ((char*)p + new_size) == ((char*)heap + heap->size) );
diff -Nrup a/malloc/hooks.c b/malloc/hooks.c
--- a/malloc/hooks.c 2012-05-29 16:45:53.000000000 -0600
+++ b/malloc/hooks.c 2012-05-30 00:13:40.684514011 -0600
@@ -191,7 +191,9 @@ top_check(void)
Index: glibc-2.12-2-gc4ccff1/malloc/hooks.c
===================================================================
--- glibc-2.12-2-gc4ccff1.orig/malloc/hooks.c
+++ glibc-2.12-2-gc4ccff1/malloc/hooks.c
@@ -219,7 +219,9 @@ top_check()
(char*)t + chunksize(t) == mp_.sbrk_base + main_arena.system_mem)))
return 0;
@ -23,10 +25,11 @@ diff -Nrup a/malloc/hooks.c b/malloc/hooks.c
/* Try to set up a new top chunk. */
brk = MORECORE(0);
diff -Nrup a/malloc/malloc.c b/malloc/malloc.c
--- a/malloc/malloc.c 2012-05-29 16:45:53.000000000 -0600
+++ b/malloc/malloc.c 2012-05-30 00:13:40.686514001 -0600
@@ -1424,12 +1424,14 @@ typedef struct malloc_chunk* mbinptr;
Index: glibc-2.12-2-gc4ccff1/malloc/malloc.c
===================================================================
--- glibc-2.12-2-gc4ccff1.orig/malloc/malloc.c
+++ glibc-2.12-2-gc4ccff1/malloc/malloc.c
@@ -1541,12 +1541,14 @@
#define last(b) ((b)->bk)
/* Take a chunk off a bin list */
@ -44,7 +47,7 @@ diff -Nrup a/malloc/malloc.c b/malloc/malloc.c
FD->bk = BK; \
BK->fd = FD; \
if (!in_smallbin_range (P->size) \
@@ -2511,7 +2513,9 @@ static void* sysmalloc(INTERNAL_SIZE_T n
@@ -2593,7 +2595,9 @@
else if (contiguous(av) && old_size && brk < old_end) {
/* Oops! Someone else killed our space.. Can't touch anything. */
@ -54,7 +57,7 @@ diff -Nrup a/malloc/malloc.c b/malloc/malloc.c
}
/*
@@ -3345,7 +3349,9 @@ _int_malloc(mstate av, size_t bytes)
@@ -3467,7 +3471,9 @@
{
errstr = "malloc(): memory corruption (fast)";
errout:
@ -64,7 +67,7 @@ diff -Nrup a/malloc/malloc.c b/malloc/malloc.c
return NULL;
}
check_remalloced_chunk(av, victim, nb);
@@ -3430,8 +3436,12 @@ _int_malloc(mstate av, size_t bytes)
@@ -3552,8 +3558,12 @@
bck = victim->bk;
if (__builtin_expect (victim->size <= 2 * SIZE_SZ, 0)
|| __builtin_expect (victim->size > av->system_mem, 0))
@ -79,7 +82,7 @@ diff -Nrup a/malloc/malloc.c b/malloc/malloc.c
size = chunksize(victim);
/*
@@ -3572,7 +3582,7 @@ _int_malloc(mstate av, size_t bytes)
@@ -3694,7 +3704,7 @@
victim = victim->fd;
remainder_size = size - nb;
@ -88,7 +91,7 @@ diff -Nrup a/malloc/malloc.c b/malloc/malloc.c
/* Exhaust */
if (remainder_size < MINSIZE) {
@@ -3670,7 +3680,7 @@ _int_malloc(mstate av, size_t bytes)
@@ -3792,7 +3802,7 @@
remainder_size = size - nb;
/* unlink */
@ -97,7 +100,7 @@ diff -Nrup a/malloc/malloc.c b/malloc/malloc.c
/* Exhaust */
if (remainder_size < MINSIZE) {
@@ -3805,9 +3815,11 @@ _int_free(mstate av, mchunkptr p, int ha
@@ -3927,9 +3937,11 @@
{
errstr = "free(): invalid pointer";
errout:
@ -109,8 +112,8 @@ diff -Nrup a/malloc/malloc.c b/malloc/malloc.c
+ mutex_lock(&av->mutex);
return;
}
/* We know that each chunk is at least MINSIZE bytes in size or a
@@ -3952,7 +3964,7 @@ _int_free(mstate av, mchunkptr p, int ha
/* We know that each chunk is at least MINSIZE bytes in size. */
@@ -4073,7 +4085,7 @@
prevsize = p->prev_size;
size += prevsize;
p = chunk_at_offset(p, -((long) prevsize));
@ -119,7 +122,7 @@ diff -Nrup a/malloc/malloc.c b/malloc/malloc.c
}
if (nextchunk != av->top) {
@@ -3961,7 +3973,7 @@ _int_free(mstate av, mchunkptr p, int ha
@@ -4082,7 +4094,7 @@
/* consolidate forward */
if (!nextinuse) {
@ -128,7 +131,7 @@ diff -Nrup a/malloc/malloc.c b/malloc/malloc.c
size += nextsize;
} else
clear_inuse_bit_at_offset(nextchunk, 0);
@@ -4122,7 +4134,7 @@ static void malloc_consolidate(mstate av
@@ -4243,7 +4255,7 @@
prevsize = p->prev_size;
size += prevsize;
p = chunk_at_offset(p, -((long) prevsize));
@ -137,7 +140,7 @@ diff -Nrup a/malloc/malloc.c b/malloc/malloc.c
}
if (nextchunk != av->top) {
@@ -4130,7 +4142,7 @@ static void malloc_consolidate(mstate av
@@ -4251,7 +4263,7 @@
if (!nextinuse) {
size += nextsize;
@ -146,7 +149,7 @@ diff -Nrup a/malloc/malloc.c b/malloc/malloc.c
} else
clear_inuse_bit_at_offset(nextchunk, 0);
@@ -4199,7 +4211,9 @@ _int_realloc(mstate av, mchunkptr oldp,
@@ -4320,7 +4332,9 @@
{
errstr = "realloc(): invalid old size";
errout:
@ -156,7 +159,7 @@ diff -Nrup a/malloc/malloc.c b/malloc/malloc.c
return NULL;
}
@@ -4241,7 +4255,7 @@ _int_realloc(mstate av, mchunkptr oldp,
@@ -4362,7 +4376,7 @@
(unsigned long)(newsize = oldsize + nextsize) >=
(unsigned long)(nb)) {
newp = oldp;

View file

@ -1,76 +0,0 @@
diff -rup a/sunrpc/svc_tcp.c b/sunrpc/svc_tcp.c
--- a/sunrpc/svc_tcp.c 2012-05-31 20:37:43.000000000 -0600
+++ b/sunrpc/svc_tcp.c 2012-06-05 11:30:09.948733571 -0600
@@ -44,6 +44,7 @@
#include <sys/poll.h>
#include <errno.h>
#include <stdlib.h>
+#include <time.h>
#include <wchar.h>
#include <libio/iolibio.h>
@@ -247,6 +248,11 @@ again:
{
if (errno == EINTR)
goto again;
+ if (errno == EMFILE)
+ {
+ struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
+ __nanosleep(&ts , NULL);
+ }
return FALSE;
}
/*
diff -rup a/sunrpc/svc_udp.c b/sunrpc/svc_udp.c
--- a/sunrpc/svc_udp.c 2012-05-31 20:37:43.000000000 -0600
+++ b/sunrpc/svc_udp.c 2012-06-05 11:30:09.948733571 -0600
@@ -40,6 +40,7 @@
#include <sys/socket.h>
#include <errno.h>
#include <libintl.h>
+#include <time.h>
#ifdef IP_PKTINFO
#include <sys/uio.h>
@@ -277,8 +278,16 @@ again:
(int) su->su_iosz, 0,
(struct sockaddr *) &(xprt->xp_raddr), &len);
xprt->xp_addrlen = len;
- if (rlen == -1 && errno == EINTR)
- goto again;
+ if (rlen == -1)
+ {
+ if (errno == EINTR)
+ goto again;
+ if (errno == EMFILE)
+ {
+ struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
+ __nanosleep(&ts , NULL);
+ }
+ }
if (rlen < 16) /* < 4 32-bit ints? */
return FALSE;
xdrs->x_op = XDR_DECODE;
diff -rup a/sunrpc/svc_unix.c b/sunrpc/svc_unix.c
--- a/sunrpc/svc_unix.c 2012-05-31 20:37:43.000000000 -0600
+++ b/sunrpc/svc_unix.c 2012-06-05 11:30:36.495612770 -0600
@@ -46,6 +46,7 @@
#include <errno.h>
#include <stdlib.h>
#include <libintl.h>
+#include <time.h>
#include <wchar.h>
/*
@@ -244,6 +245,11 @@ again:
{
if (errno == EINTR)
goto again;
+ if (errno == EMFILE)
+ {
+ struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
+ __nanosleep(&ts , NULL);
+ }
return FALSE;
}
/*

View file

@ -1,217 +0,0 @@
diff -Nrup c/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S d/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
--- c/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S 2012-05-20 23:58:20.732670548 -0600
+++ d/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S 2012-05-20 23:58:52.667518135 -0600
@@ -137,7 +137,6 @@ __pthread_cond_wait:
cmpl $PI_BIT, %eax
jne 18f
-90:
movl $(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx
movl %ebp, %edx
xorl %esi, %esi
@@ -151,9 +150,6 @@ __pthread_cond_wait:
sete 16(%esp)
je 19f
- cmpl $-EAGAIN, %eax
- je 91f
-
/* Normal and PI futexes dont mix. Use normal futex functions only
if the kernel does not support the PI futex functions. */
cmpl $-ENOSYS, %eax
@@ -398,78 +394,6 @@ __pthread_cond_wait:
#endif
call __lll_unlock_wake
jmp 11b
-
-91:
-.LcleanupSTART2:
- /* FUTEX_WAIT_REQUEUE_PI returned EAGAIN. We need to
- call it again. */
-
- /* Get internal lock. */
- movl $1, %edx
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %edx, (%ebx)
-#else
- cmpxchgl %edx, cond_lock(%ebx)
-#endif
- jz 92f
-
-#if cond_lock == 0
- movl %ebx, %edx
-#else
- leal cond_lock(%ebx), %edx
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_lock_wait
-
-92:
- /* Increment the cond_futex value again, so it can be used as a new
- expected value. */
- addl $1, cond_futex(%ebx)
- movl cond_futex(%ebx), %ebp
-
- /* Unlock. */
- LOCK
-#if cond_lock == 0
- subl $1, (%ebx)
-#else
- subl $1, cond_lock(%ebx)
-#endif
- je 93f
-#if cond_lock == 0
- movl %ebx, %eax
-#else
- leal cond_lock(%ebx), %eax
-#endif
-#if (LLL_SHARED-LLL_PRIVATE) > 255
- xorl %ecx, %ecx
-#endif
- cmpl $-1, dep_mutex(%ebx)
- setne %cl
- subl $1, %ecx
- andl $(LLL_SHARED-LLL_PRIVATE), %ecx
-#if LLL_PRIVATE != 0
- addl $LLL_PRIVATE, %ecx
-#endif
- call __lll_unlock_wake
-
-93:
- /* Set the rest of SYS_futex args for FUTEX_WAIT_REQUEUE_PI. */
- xorl %ecx, %ecx
- movl dep_mutex(%ebx), %edi
- jmp 90b
-.LcleanupEND2:
-
.size __pthread_cond_wait, .-__pthread_cond_wait
versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
GLIBC_2_3_2)
@@ -642,10 +566,6 @@ __condvar_w_cleanup:
.long .LcleanupEND-.Lsub_cond_futex
.long __condvar_w_cleanup-.LSTARTCODE
.uleb128 0
- .long .LcleanupSTART2-.LSTARTCODE
- .long .LcleanupEND2-.LcleanupSTART2
- .long __condvar_w_cleanup-.LSTARTCODE
- .uleb128 0
.long .LcallUR-.LSTARTCODE
.long .LENDCODE-.LcallUR
.long 0
diff -Nrup c/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S d/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
--- c/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S 2012-05-20 23:58:20.736670528 -0600
+++ d/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S 2012-05-21 00:01:39.870720001 -0600
@@ -136,14 +136,11 @@ __pthread_cond_wait:
cmpl $PI_BIT, %eax
jne 61f
-90:
movl $(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %esi
movl $SYS_futex, %eax
syscall
movl $1, %r8d
- cmpq $-EAGAIN, %rax
- je 91f
#ifdef __ASSUME_REQUEUE_PI
jmp 62f
#else
@@ -331,69 +328,6 @@ __pthread_cond_wait:
13: movq %r10, %rax
jmp 14b
-91:
-.LcleanupSTART2:
- /* FUTEX_WAIT_REQUEUE_PI returned EAGAIN. We need to
- call it again. */
- movq 8(%rsp), %rdi
-
- /* Get internal lock. */
- movl $1, %esi
- xorl %eax, %eax
- LOCK
-#if cond_lock == 0
- cmpxchgl %esi, (%rdi)
-#else
- cmpxchgl %esi, cond_lock(%rdi)
-#endif
- jz 92f
-
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- callq __lll_lock_wait
-#if cond_lock != 0
- subq $cond_lock, %rdi
-#endif
-92:
- /* Increment the cond_futex value again, so it can be used as a new
- expected value. */
- incl cond_futex(%rdi)
- movl cond_futex(%rdi), %edx
-
- /* Release internal lock. */
- LOCK
-#if cond_lock == 0
- decl (%rdi)
-#else
- decl cond_lock(%rdi)
-#endif
- jz 93f
-
-#if cond_lock != 0
- addq $cond_lock, %rdi
-#endif
- LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
- movl $LLL_PRIVATE, %eax
- movl $LLL_SHARED, %esi
- cmovne %eax, %esi
- /* The call preserves %rdx. */
- callq __lll_unlock_wake
-#if cond_lock != 0
- subq $cond_lock, %rdi
-#endif
-93:
- /* Set the rest of SYS_futex args for FUTEX_WAIT_REQUEUE_PI. */
- xorq %r10, %r10
- mov dep_mutex(%rdi), %R8_LP
- leaq cond_futex(%rdi), %rdi
- jmp 90b
-.LcleanupEND2:
-
.size __pthread_cond_wait, .-__pthread_cond_wait
versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
GLIBC_2_3_2)
@@ -546,15 +480,11 @@ __condvar_cleanup1:
.uleb128 .LcleanupSTART-.LSTARTCODE
.uleb128 .LcleanupEND-.LcleanupSTART
.uleb128 __condvar_cleanup1-.LSTARTCODE
- .uleb128 0
- .uleb128 .LcleanupSTART2-.LSTARTCODE
- .uleb128 .LcleanupEND2-.LcleanupSTART2
- .uleb128 __condvar_cleanup1-.LSTARTCODE
- .uleb128 0
+ .uleb128 0
.uleb128 .LcallUR-.LSTARTCODE
.uleb128 .LENDCODE-.LcallUR
.uleb128 0
- .uleb128 0
+ .uleb128 0
.Lcstend:

View file

@ -21,3 +21,101 @@ diff -rup a/fedora/nscd.service b/fedora/nscd.service
[Install]
WantedBy=multi-user.target
diff -rup a/nscd/nscd.c b/nscd/nscd.c
--- a/nscd/nscd.c 2012-01-01 05:16:32.000000000 -0700
+++ b/nscd/nscd.c 2012-02-03 13:07:50.509740586 -0700
@@ -72,7 +72,12 @@ thread_info_t thread_info;
int do_shutdown;
int disabled_passwd;
int disabled_group;
-int go_background = 1;
+
+/* Default is to daemonize. Set to 1 to run in foreground in
+ debugging mode, or negative to run in foreground but otherwise
+ behave like a daemon, i.e., detach from terminal and use
+ syslog. */
+static int run_in_foreground = 0;
static const char *conffile = _PATH_NSCDCONF;
@@ -104,6 +109,8 @@ static const struct argp_option options[
N_("Read configuration data from NAME") },
{ "debug", 'd', NULL, 0,
N_("Do not fork and display messages on the current tty") },
+ { "foreground", 'F', NULL, 0,
+ N_("Do not fork, but otherwise behave like a deamon") },
{ "nthreads", 't', N_("NUMBER"), 0, N_("Start NUMBER threads") },
{ "shutdown", 'K', NULL, 0, N_("Shut the server down") },
{ "statistics", 'g', NULL, 0, N_("Print current configuration statistics") },
@@ -174,16 +181,22 @@ main (int argc, char **argv)
/* Determine page size. */
pagesize_m1 = getpagesize () - 1;
- /* Behave like a daemon. */
- if (go_background)
+ if (run_in_foreground <= 0)
{
int i;
+ pid_t pid;
- pid_t pid = fork ();
- if (pid == -1)
- error (EXIT_FAILURE, errno, _("cannot fork"));
- if (pid != 0)
- exit (0);
+ /* Behave like a daemon. */
+ if (!run_in_foreground)
+ {
+ pid = fork ();
+ if (pid == -1)
+ error (EXIT_FAILURE, errno, _("cannot fork"));
+ if (pid != 0)
+ exit (0);
+ }
+ else
+ fprintf (stderr, _("further output sent to syslog\n"));
int nullfd = open (_PATH_DEVNULL, O_RDWR);
if (nullfd != -1)
@@ -234,11 +247,14 @@ main (int argc, char **argv)
for (i = min_close_fd; i < getdtablesize (); i++)
close (i);
- pid = fork ();
- if (pid == -1)
- error (EXIT_FAILURE, errno, _("cannot fork"));
- if (pid != 0)
- exit (0);
+ if (!run_in_foreground)
+ {
+ pid = fork ();
+ if (pid == -1)
+ error (EXIT_FAILURE, errno, _("cannot fork"));
+ if (pid != 0)
+ exit (0);
+ }
setsid ();
@@ -260,7 +276,7 @@ main (int argc, char **argv)
signal (SIGTSTP, SIG_IGN);
}
else
- /* In foreground mode we are not paranoid. */
+ /* In debug mode we are not paranoid. */
paranoia = 0;
signal (SIGINT, termination_handler);
@@ -309,7 +325,11 @@ parse_opt (int key, char *arg, struct ar
{
case 'd':
++debug_level;
- go_background = 0;
+ run_in_foreground = 1;
+ break;
+
+ case 'F':
+ run_in_foreground = -1;
break;
case 'f':

12
glibc-rh783979.patch Normal file
View file

@ -0,0 +1,12 @@
diff -rup a/sysdeps/powerpc/powerpc64/Makefile b/sysdeps/powerpc/powerpc64/Makefile
--- a/sysdeps/powerpc/powerpc64/Makefile 2012-02-01 09:34:07.018768021 -0700
+++ b/sysdeps/powerpc/powerpc64/Makefile 2012-02-01 09:35:28.813356195 -0700
@@ -31,7 +31,7 @@ elide-routines.os += hp-timing
ifneq ($(elf),no)
# The initfini generation code doesn't work in the presence of -fPIC, so
# we use -fpic instead which is much better.
-CFLAGS-initfini.s += -fpic -O1
+CFLAGS-initfini.s += -fpic -O1 -fno-inline
endif
CFLAGS-libc-start.c += -fno-asynchronous-unwind-tables
endif

144
glibc-rh784402.patch Normal file
View file

@ -0,0 +1,144 @@
commit 3e1aa84e7f9f38815f5db9cd7654b1a9497cf6e4
Author: Ulrich Drepper <drepper@gmail.com>
Date: Fri Jan 20 22:39:54 2012 -0500
Do not cache negative results in nscd if these are transient
diff --git a/nscd/aicache.c b/nscd/aicache.c
index aaaf80d..e1f1244 100644
--- a/nscd/aicache.c
+++ b/nscd/aicache.c
@@ -1,5 +1,5 @@
/* Cache handling for host lookup.
- Copyright (C) 2004-2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2004-2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -514,8 +514,9 @@ next_nip:
if (fd != -1)
TEMP_FAILURE_RETRY (send (fd, &notfound, total, MSG_NOSIGNAL));
- /* If we cannot permanently store the result, so be it. */
- if (__builtin_expect (db->negtimeout == 0, 0))
+ /* If we have a transient error or cannot permanently store the
+ result, so be it. */
+ if (rc4 == EAGAIN || __builtin_expect (db->negtimeout == 0, 0))
{
/* Mark the old entry as obsolete. */
if (dh != NULL)
diff --git a/nscd/grpcache.c b/nscd/grpcache.c
index e9607c6..a698f36 100644
--- a/nscd/grpcache.c
+++ b/nscd/grpcache.c
@@ -1,5 +1,5 @@
/* Cache handling for group lookup.
- Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1998-2008, 2009, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -120,8 +120,9 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
else
written = total;
- /* If we cannot permanently store the result, so be it. */
- if (db->negtimeout == 0)
+ /* If we have a transient error or cannot permanently store
+ the result, so be it. */
+ if (errno == EAGAIN || __builtin_expect (db->negtimeout == 0, 0))
{
/* Mark the old entry as obsolete. */
if (dh != NULL)
diff --git a/nscd/hstcache.c b/nscd/hstcache.c
index 4d68ade..c72feaa 100644
--- a/nscd/hstcache.c
+++ b/nscd/hstcache.c
@@ -1,5 +1,5 @@
/* Cache handling for host lookup.
- Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1998-2008, 2009, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -141,8 +141,9 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
MSG_NOSIGNAL)) != total)
all_written = false;
- /* If we cannot permanently store the result, so be it. */
- if (__builtin_expect (db->negtimeout == 0, 0))
+ /* If we have a transient error or cannot permanently store
+ the result, so be it. */
+ if (errval == EAGAIN || __builtin_expect (db->negtimeout == 0, 0))
{
/* Mark the old entry as obsolete. */
if (dh != NULL)
diff --git a/nscd/initgrcache.c b/nscd/initgrcache.c
index 4ac9942..2019991 100644
--- a/nscd/initgrcache.c
+++ b/nscd/initgrcache.c
@@ -1,5 +1,5 @@
/* Cache handling for host lookup.
- Copyright (C) 2004-2006, 2008, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2004-2006, 2008, 2009, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -202,8 +202,9 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
written = TEMP_FAILURE_RETRY (send (fd, &notfound, total,
MSG_NOSIGNAL));
- /* If we cannot permanently store the result, so be it. */
- if (__builtin_expect (db->negtimeout == 0, 0))
+ /* If we have a transient error or cannot permanently store
+ the result, so be it. */
+ if (all_tryagain || __builtin_expect (db->negtimeout == 0, 0))
{
/* Mark the old entry as obsolete. */
if (dh != NULL)
diff --git a/nscd/pwdcache.c b/nscd/pwdcache.c
index 49e130c..e2ba09d 100644
--- a/nscd/pwdcache.c
+++ b/nscd/pwdcache.c
@@ -1,5 +1,5 @@
/* Cache handling for passwd lookup.
- Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1998-2008, 2009, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -124,8 +124,9 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
written = TEMP_FAILURE_RETRY (send (fd, &notfound, total,
MSG_NOSIGNAL));
- /* If we cannot permanently store the result, so be it. */
- if (__builtin_expect (db->negtimeout == 0, 0))
+ /* If we have a transient error or cannot permanently store
+ the result, so be it. */
+ if (errno == EAGAIN || __builtin_expect (db->negtimeout == 0, 0))
{
/* Mark the old entry as obsolete. */
if (dh != NULL)
diff --git a/nscd/servicescache.c b/nscd/servicescache.c
index d3d5dce..a6337e3 100644
--- a/nscd/servicescache.c
+++ b/nscd/servicescache.c
@@ -1,5 +1,5 @@
/* Cache handling for services lookup.
- Copyright (C) 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2009, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@drepper.com>, 2007.
@@ -108,8 +108,9 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req,
written = TEMP_FAILURE_RETRY (send (fd, &notfound, total,
MSG_NOSIGNAL));
- /* If we cannot permanently store the result, so be it. */
- if (__builtin_expect (db->negtimeout == 0, 0))
+ /* If we have a transient error or cannot permanently store
+ the result, so be it. */
+ if (errval == EAGAIN || __builtin_expect (db->negtimeout == 0, 0))
{
/* Mark the old entry as obsolete. */
if (dh != NULL)

View file

@ -1,159 +0,0 @@
2012-04-12 Jeff Law <law@redhat.com>
* nscd/grpcache.c (cache_addgr): Track alloca usage with alloca_account.
Do not allocate DATASET on the stack if it's too large. Free DATASET
if needed.
diff -rcp a/nscd/grpcache.c b/nscd/grpcache.c
*** a/nscd/grpcache.c Wed Apr 11 12:50:07 2012
--- b/nscd/grpcache.c Wed Apr 11 21:45:58 2012
*************** cache_addgr (struct database_dyn *db, in
*** 178,184 ****
char *cp;
const size_t key_len = strlen (key);
const size_t buf_len = 3 * sizeof (grp->gr_gid) + key_len + 1;
! char *buf = alloca (buf_len);
ssize_t n;
size_t cnt;
--- 178,185 ----
char *cp;
const size_t key_len = strlen (key);
const size_t buf_len = 3 * sizeof (grp->gr_gid) + key_len + 1;
! size_t alloca_used = 0;
! char *buf = alloca_account (buf_len, alloca_used);
ssize_t n;
size_t cnt;
*************** cache_addgr (struct database_dyn *db, in
*** 190,196 ****
/* Determine the length of all members. */
while (grp->gr_mem[gr_mem_cnt])
++gr_mem_cnt;
! gr_mem_len = (uint32_t *) alloca (gr_mem_cnt * sizeof (uint32_t));
for (gr_mem_cnt = 0; grp->gr_mem[gr_mem_cnt]; ++gr_mem_cnt)
{
gr_mem_len[gr_mem_cnt] = strlen (grp->gr_mem[gr_mem_cnt]) + 1;
--- 191,198 ----
/* Determine the length of all members. */
while (grp->gr_mem[gr_mem_cnt])
++gr_mem_cnt;
! gr_mem_len = (uint32_t *) alloca_account (gr_mem_cnt * sizeof (uint32_t),
! alloca_used);
for (gr_mem_cnt = 0; grp->gr_mem[gr_mem_cnt]; ++gr_mem_cnt)
{
gr_mem_len[gr_mem_cnt] = strlen (grp->gr_mem[gr_mem_cnt]) + 1;
*************** cache_addgr (struct database_dyn *db, in
*** 205,214 ****
change. Allocate memory on the cache since it is likely
discarded anyway. If it turns out to be necessary to have a
new record we can still allocate real memory. */
! bool alloca_used = false;
dataset = NULL;
! if (he == NULL)
dataset = (struct dataset *) mempool_alloc (db, total + n, 1);
if (dataset == NULL)
--- 207,216 ----
change. Allocate memory on the cache since it is likely
discarded anyway. If it turns out to be necessary to have a
new record we can still allocate real memory. */
! bool dataset_in_stack_or_freed = false;
dataset = NULL;
! if (he == NULL || ! __libc_use_alloca (alloca_used + total + n))
dataset = (struct dataset *) mempool_alloc (db, total + n, 1);
if (dataset == NULL)
*************** cache_addgr (struct database_dyn *db, in
*** 216,225 ****
/* We cannot permanently add the result in the moment. But
we can provide the result as is. Store the data in some
temporary memory. */
! dataset = (struct dataset *) alloca (total + n);
/* We cannot add this record to the permanent database. */
! alloca_used = true;
}
dataset->head.allocsize = total + n;
--- 218,227 ----
/* We cannot permanently add the result in the moment. But
we can provide the result as is. Store the data in some
temporary memory. */
! dataset = (struct dataset *) alloca_account (total + n, alloca_used);
/* We cannot add this record to the permanent database. */
! dataset_in_stack_or_freed = true;
}
dataset->head.allocsize = total + n;
*************** cache_addgr (struct database_dyn *db, in
*** 273,278 ****
--- 275,288 ----
allocated on the stack and need not be freed. */
dh->timeout = dataset->head.timeout;
++dh->nreloads;
+
+ /* If the new record was not allocated on the stack, then it must
+ be freed. Note that it can no longer be used. */
+ if (! dataset_in_stack_or_freed)
+ {
+ free (dataset);
+ dataset_in_stack_or_freed = true;
+ }
}
else
{
*************** cache_addgr (struct database_dyn *db, in
*** 288,294 ****
key_copy = (char *) newp + (key_copy - (char *) dataset);
dataset = memcpy (newp, dataset, total + n);
! alloca_used = false;
}
/* Mark the old record as obsolete. */
--- 298,304 ----
key_copy = (char *) newp + (key_copy - (char *) dataset);
dataset = memcpy (newp, dataset, total + n);
! dataset_in_stack_or_freed = false;
}
/* Mark the old record as obsolete. */
*************** cache_addgr (struct database_dyn *db, in
*** 303,309 ****
assert (fd != -1);
#ifdef HAVE_SENDFILE
! if (__builtin_expect (db->mmap_used, 1) && !alloca_used)
{
assert (db->wr_fd != -1);
assert ((char *) &dataset->resp > (char *) db->data);
--- 313,319 ----
assert (fd != -1);
#ifdef HAVE_SENDFILE
! if (__builtin_expect (db->mmap_used, 1) && !dataset_in_stack_or_freed)
{
assert (db->wr_fd != -1);
assert ((char *) &dataset->resp > (char *) db->data);
*************** cache_addgr (struct database_dyn *db, in
*** 330,336 ****
/* Add the record to the database. But only if it has not been
stored on the stack. */
! if (! alloca_used)
{
/* If necessary, we also propagate the data to disk. */
if (db->persistent)
--- 340,346 ----
/* Add the record to the database. But only if it has not been
stored on the stack. */
! if (! dataset_in_stack_or_freed)
{
/* If necessary, we also propagate the data to disk. */
if (db->persistent)

View file

@ -1,111 +0,0 @@
diff -rup c/malloc/arena.c d/malloc/arena.c
--- c/malloc/arena.c 2012-04-02 21:21:08.842818529 -0600
+++ d/malloc/arena.c 2012-04-02 21:22:25.943306724 -0600
@@ -121,14 +121,14 @@ int __malloc_initialized = -1;
if(ptr) \
(void)mutex_lock(&ptr->mutex); \
else \
- ptr = arena_get2(ptr, (size)); \
+ ptr = arena_get2(ptr, (size), false); \
} while(0)
#else
# define arena_lock(ptr, size) do { \
if(ptr && !mutex_trylock(&ptr->mutex)) { \
THREAD_STAT(++(ptr->stat_lock_direct)); \
} else \
- ptr = arena_get2(ptr, (size)); \
+ ptr = arena_get2(ptr, (size), false); \
} while(0)
#endif
@@ -782,7 +782,7 @@ get_free_list (void)
static mstate
-reused_arena (void)
+reused_arena (bool retrying)
{
mstate result;
static mstate next_to_use;
@@ -799,6 +799,15 @@ reused_arena (void)
}
while (result != next_to_use);
+ /* If we are retrying due to a failure to allocate in the main
+ arena, don't wait for the main arena to become available, select
+ another.
+
+ To really fix this right we would have to try the allocation
+ in every other arena, but that seems like severe overkill. */
+ if (retrying && result == &main_arena)
+ result = result->next;
+
/* No arena available. Wait for the next in line. */
(void)mutex_lock(&result->mutex);
@@ -813,7 +822,7 @@ reused_arena (void)
static mstate
internal_function
-arena_get2(mstate a_tsd, size_t size)
+arena_get2(mstate a_tsd, size_t size, bool retrying)
{
mstate a;
@@ -858,7 +867,7 @@ arena_get2(mstate a_tsd, size_t size)
catomic_decrement (&narenas);
}
else
- a = reused_arena ();
+ a = reused_arena (retrying);
}
#else
if(!a_tsd)
diff -rup c/malloc/malloc.c d/malloc/malloc.c
--- c/malloc/malloc.c 2012-04-02 21:21:08.984817776 -0600
+++ d/malloc/malloc.c 2012-04-02 21:21:39.533655779 -0600
@@ -2938,7 +2938,7 @@ public_mALLOc(size_t bytes)
/* ... or sbrk() has failed and there is still a chance to mmap() */
mstate prev = ar_ptr->next ? ar_ptr : 0;
(void)mutex_unlock(&ar_ptr->mutex);
- ar_ptr = arena_get2(prev, bytes);
+ ar_ptr = arena_get2(prev, bytes, true);
if(ar_ptr) {
victim = _int_malloc(ar_ptr, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
@@ -3117,7 +3117,7 @@ public_mEMALIGn(size_t alignment, size_t
/* ... or sbrk() has failed and there is still a chance to mmap() */
mstate prev = ar_ptr->next ? ar_ptr : 0;
(void)mutex_unlock(&ar_ptr->mutex);
- ar_ptr = arena_get2(prev, bytes);
+ ar_ptr = arena_get2(prev, bytes, true);
if(ar_ptr) {
p = _int_memalign(ar_ptr, alignment, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
@@ -3164,7 +3164,7 @@ public_vALLOc(size_t bytes)
/* ... or sbrk() has failed and there is still a chance to mmap() */
mstate prev = ar_ptr->next ? ar_ptr : 0;
(void)mutex_unlock(&ar_ptr->mutex);
- ar_ptr = arena_get2(prev, bytes);
+ ar_ptr = arena_get2(prev, bytes, true);
if(ar_ptr) {
p = _int_memalign(ar_ptr, pagesz, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
@@ -3211,7 +3211,7 @@ public_pVALLOc(size_t bytes)
/* ... or sbrk() has failed and there is still a chance to mmap() */
mstate prev = ar_ptr->next ? ar_ptr : 0;
(void)mutex_unlock(&ar_ptr->mutex);
- ar_ptr = arena_get2(prev, bytes + 2*pagesz + MINSIZE);
+ ar_ptr = arena_get2(prev, bytes + 2*pagesz + MINSIZE, true);
if(ar_ptr) {
p = _int_memalign(ar_ptr, pagesz, rounded_bytes);
(void)mutex_unlock(&ar_ptr->mutex);
@@ -3298,7 +3298,7 @@ public_cALLOc(size_t n, size_t elem_size
/* ... or sbrk() has failed and there is still a chance to mmap() */
mstate prev = av->next ? av : 0;
(void)mutex_unlock(&av->mutex);
- av = arena_get2(prev, sz);
+ av = arena_get2(prev, sz, true);
if(av) {
mem = _int_malloc(av, sz);
(void)mutex_unlock(&av->mutex);

View file

@ -1,115 +0,0 @@
Only in b/malloc: arena.c.orig
Only in b/malloc: hooks.c.orig
diff -rup a/malloc/malloc.c b/malloc/malloc.c
--- a/malloc/malloc.c 2012-02-14 10:08:22.062534892 -0700
+++ b/malloc/malloc.c 2012-02-14 10:19:43.088724473 -0700
@@ -2936,8 +2936,9 @@ public_mALLOc(size_t bytes)
(void)mutex_unlock(&ar_ptr->mutex);
} else {
/* ... or sbrk() has failed and there is still a chance to mmap() */
- ar_ptr = arena_get2(ar_ptr->next ? ar_ptr : 0, bytes);
- (void)mutex_unlock(&main_arena.mutex);
+ mstate prev = ar_ptr->next ? ar_ptr : 0;
+ (void)mutex_unlock(&ar_ptr->mutex);
+ ar_ptr = arena_get2(prev, bytes);
if(ar_ptr) {
victim = _int_malloc(ar_ptr, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
@@ -3151,23 +3152,26 @@ public_vALLOc(size_t bytes)
if(!ar_ptr)
return 0;
p = _int_valloc(ar_ptr, bytes);
- (void)mutex_unlock(&ar_ptr->mutex);
if(!p) {
/* Maybe the failure is due to running out of mmapped areas. */
if(ar_ptr != &main_arena) {
+ (void)mutex_unlock(&ar_ptr->mutex);
ar_ptr = &main_arena;
(void)mutex_lock(&ar_ptr->mutex);
p = _int_memalign(ar_ptr, pagesz, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
} else {
/* ... or sbrk() has failed and there is still a chance to mmap() */
- ar_ptr = arena_get2(ar_ptr->next ? ar_ptr : 0, bytes);
+ mstate prev = ar_ptr->next ? ar_ptr : 0;
+ (void)mutex_unlock(&ar_ptr->mutex);
+ ar_ptr = arena_get2(prev, bytes);
if(ar_ptr) {
p = _int_memalign(ar_ptr, pagesz, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
}
}
- }
+ } else
+ (void)mutex_unlock(&ar_ptr->mutex);
assert(!p || chunk_is_mmapped(mem2chunk(p)) ||
ar_ptr == arena_for_chunk(mem2chunk(p)));
@@ -3195,24 +3199,26 @@ public_pVALLOc(size_t bytes)
arena_get(ar_ptr, bytes + 2*pagesz + MINSIZE);
p = _int_pvalloc(ar_ptr, bytes);
- (void)mutex_unlock(&ar_ptr->mutex);
if(!p) {
/* Maybe the failure is due to running out of mmapped areas. */
if(ar_ptr != &main_arena) {
+ (void)mutex_unlock(&ar_ptr->mutex);
ar_ptr = &main_arena;
(void)mutex_lock(&ar_ptr->mutex);
p = _int_memalign(ar_ptr, pagesz, rounded_bytes);
(void)mutex_unlock(&ar_ptr->mutex);
} else {
/* ... or sbrk() has failed and there is still a chance to mmap() */
- ar_ptr = arena_get2(ar_ptr->next ? ar_ptr : 0,
- bytes + 2*pagesz + MINSIZE);
+ mstate prev = ar_ptr->next ? ar_ptr : 0;
+ (void)mutex_unlock(&ar_ptr->mutex);
+ ar_ptr = arena_get2(prev, bytes + 2*pagesz + MINSIZE);
if(ar_ptr) {
p = _int_memalign(ar_ptr, pagesz, rounded_bytes);
(void)mutex_unlock(&ar_ptr->mutex);
}
}
- }
+ } else
+ (void)mutex_unlock(&ar_ptr->mutex);
assert(!p || chunk_is_mmapped(mem2chunk(p)) ||
ar_ptr == arena_for_chunk(mem2chunk(p)));
@@ -3277,8 +3283,6 @@ public_cALLOc(size_t n, size_t elem_size
#endif
mem = _int_malloc(av, sz);
- /* Only clearing follows, so we can unlock early. */
- (void)mutex_unlock(&av->mutex);
assert(!mem || chunk_is_mmapped(mem2chunk(mem)) ||
av == arena_for_chunk(mem2chunk(mem)));
@@ -3286,21 +3290,23 @@ public_cALLOc(size_t n, size_t elem_size
if (mem == 0) {
/* Maybe the failure is due to running out of mmapped areas. */
if(av != &main_arena) {
+ (void)mutex_unlock(&av->mutex);
(void)mutex_lock(&main_arena.mutex);
mem = _int_malloc(&main_arena, sz);
(void)mutex_unlock(&main_arena.mutex);
} else {
/* ... or sbrk() has failed and there is still a chance to mmap() */
- (void)mutex_lock(&main_arena.mutex);
- av = arena_get2(av->next ? av : 0, sz);
- (void)mutex_unlock(&main_arena.mutex);
+ mstate prev = av->next ? av : 0;
+ (void)mutex_unlock(&av->mutex);
+ av = arena_get2(prev, sz);
if(av) {
mem = _int_malloc(av, sz);
(void)mutex_unlock(&av->mutex);
}
}
if (mem == 0) return 0;
- }
+ } else
+ (void)mutex_unlock(&av->mutex);
p = mem2chunk(mem);
/* Two optional cases in which clearing not necessary */

View file

@ -1,188 +0,0 @@
diff -Nrup a/localedata/locales/sat_IN b/localedata/locales/sat_IN
--- a/localedata/locales/sat_IN 1969-12-31 17:00:00.000000000 -0700
+++ b/localedata/locales/sat_IN 2012-02-14 09:45:55.072442697 -0700
@@ -0,0 +1,184 @@
+comment_char %
+escape_char /
+% Santali language locale for India.
+% Contributed by Mr. Pravin Satpute <psatpute AT redhat DOT com> and Mr. Thakur Prasad Murmu <tp_murmu AT yahoo DOT com>
+
+LC_IDENTIFICATION
+title "Santali language locale for India"
+source "Red Hat Pune"
+address "Level 1, Tower X, Cybercity, Magarpatta City, Hadapsar, Pune-411013 "
+contact ""
+email "bug-glibc-locales@gnu.org"
+tel ""
+fax ""
+language "Santali"
+territory "India"
+revision "1.0"
+date "2012-01-17"
+%
+category "sat_IN:2012";LC_IDENTIFICATION
+category "sat_IN:2012";LC_CTYPE
+category "sat_IN:2012";LC_COLLATE
+category "sat_IN:2012";LC_TIME
+category "sat_IN:2012";LC_NUMERIC
+category "sat_IN:2012";LC_MONETARY
+category "sat_IN:2012";LC_MESSAGES
+category "sat_IN:2012";LC_PAPER
+category "sat_IN:2012";LC_NAME
+category "sat_IN:2012";LC_ADDRESS
+category "sat_IN:2012";LC_TELEPHONE
+
+END LC_IDENTIFICATION
+
+LC_CTYPE
+copy "hi_IN"
+END LC_CTYPE
+
+LC_COLLATE
+copy "hi_IN"
+END LC_COLLATE
+
+LC_MONETARY
+copy "hi_IN"
+END LC_MONETARY
+
+
+LC_NUMERIC
+copy "hi_IN"
+END LC_NUMERIC
+
+
+LC_TIME
+% This is the POSIX Locale definition for the LC_TIME category
+% generated by IBM Basic CountryPack Transformer.
+% These are generated based on XML base Locale definition file
+% for IBM Class for Unicode.
+%
+% Abbreviated weekday names (%a)
+abday "<U0938><U093F><U0902><U0917><U0947>";"<U0913><U0924><U0947>";/
+ "<U092C><U093E><U0932><U0947>";"<U0938><U093E><U0917><U0941><U0928>";/
+ "<U0938><U093E><U0930><U0926><U0940>";/
+ "<U091C><U093E><U0930><U0941><U092E>";"<U091E><U0941><U0939><U0941><U092E>"
+%
+
+% Full weekday names (%A)
+day "<U0938><U093F><U0902><U0917><U0947><U092E><U093E><U0901><U0939><U093E><U0901>";/
+ "<U0913><U0924><U0947><U092E><U093E><U0901><U0939><U093E><U0901>";/
+ "<U092C><U093E><U0932><U0947><U092E><U093E><U0901><U0939><U093E><U0901>";/
+ "<U0938><U093E><U0917><U0941><U0928><U092E><U093E><U0901><U0939><U093E><U0901>";/
+ "<U0938><U093E><U0930><U0926><U0940><U092E><U093E><U0901><U0939><U093E><U0901>";/
+ "<U091C><U093E><U0930><U0941><U092E><U092E><U093E><U0901><U0939><U093E><U0901>";/
+ "<U091E><U0941><U0939><U0941><U092E><U092E><U093E><U0901><U0939><U093E><U0901>"
+%
+% Abbreviated month names (%b)
+abmon "<U091C><U0928><U0935><U0930><U0940>";/
+ "<U092B><U0930><U0935><U0930><U0940>";/
+ "<U092E><U093E><U0930><U094D><U091A>";/
+ "<U0905><U092A><U094D><U0930><U0947><U0932>";/
+ "<U092E><U0908>";/
+ "<U091C><U0941><U0928>";/
+ "<U091C><U0941><U0932><U093E><U0908>";/
+ "<U0905><U0917><U0938><U094D><U0924>";/
+ "<U0938><U093F><U0924><U092E><U094D><U092C><U0930>";/
+ "<U0905><U0916><U0925><U092C><U0930>";/
+ "<U0928><U0935><U092E><U094D><U092C><U0930>";/
+ "<U0926><U093F><U0938><U092E><U094D><U092C><U0930>"
+%
+
+% Full month names (%B)
+mon "<U091C><U0928><U0935><U0930><U0940>";/
+ "<U092B><U0930><U0935><U0930><U0940>";/
+ "<U092E><U093E><U0930><U094D><U091A>";/
+ "<U0905><U092A><U094D><U0930><U0947><U0932>";/
+ "<U092E><U0908>";/
+ "<U091C><U0941><U0928>";/
+ "<U091C><U0941><U0932><U093E><U0908>";/
+ "<U0905><U0917><U0938><U094D><U0924>";/
+ "<U0938><U093F><U0924><U092E><U094D><U092C><U0930>";/
+ "<U0905><U0916><U0925><U092C><U0930>";/
+ "<U0928><U0935><U092E><U094D><U092C><U0930>";/
+ "<U0926><U093F><U0938><U092E><U094D><U092C><U0930>"
+%
+% Equivalent of AM PM
+
+am_pm "<U0041><U004D>";"<U0050><U004D>"
+
+%
+% Appropriate date and time representation
+% %A %d %b %Y%I:%M:%S %Z
+d_t_fmt "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/
+<U0020><U0025><U0059><U0020><U0025><U0049><U003A><U0025><U004D><U003A>/
+<U0025><U0053><U0020><U0025><U0070><U0020><U0025><U005A>"
+%
+% Appropriate date representation
+% %A %d %b %Y
+d_fmt "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/
+<U0020><U0025><U0059>"
+%
+% Appropriate time representation
+% %I:%M:%S %Z
+t_fmt "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/
+<U0020><U0020><U0025><U005A>"
+%
+% Appropriate 12 h time representation (%r)
+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/
+<U0020><U0025><U0070><U0020><U0025><U005A>"
+%
+% Appropriate date representation (date(1)) "%a %b %e %H:%M:%S %Z %Y"
+date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
+<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
+<U0025><U005A><U0020><U0025><U0059>"
+END LC_TIME
+
+
+LC_MESSAGES
+% This is the POSIX Locale definition for the LC_MESSAGES category
+% generated by IBM Basic CountryPack Transformer.
+% These are generated based on XML base Locale definition file
+% for IBM Class for Unicode.
+%
+% ^(Yes|[yY])
+yesexpr "<U005E><U0028><U0939><U094B><U092F><U007C><U005B><U0079>/
+<U0059><U005D><U0029>"
+%
+% ^(No|[nN])
+noexpr "<U005E><U0028><U092C><U093E><U0919><U007C><U005B><U006E><U004E>/
+<U005D><U0029>"
+%
+END LC_MESSAGES
+
+
+LC_PAPER
+copy "hi_IN"
+END LC_PAPER
+
+
+LC_NAME
+% This is the ISO_IEC TR14652 Locale definition for the LC_NAME category
+% generated by IBM Basic CountryPack Transformer.
+%
+%
+name_fmt "<U0025><U0070><U0025><U0074><U0025><U0066><U0025><U0074>/
+<U0025><U0067>"
+name_gen ""
+name_mr "<U092E><U093E><U0928>"
+name_mrs "<U092E><U093E><U0928><U0940>"
+name_miss "<U092E><U093E><U0908>"
+name_ms ""
+
+END LC_NAME
+
+
+LC_ADDRESS
+copy "hi_IN"
+END LC_ADDRESS
+
+
+LC_TELEPHONE
+copy "hi_IN"
+END LC_TELEPHONE
+
+
+LC_MEASUREMENT
+copy "hi_IN"
+END LC_MEASUREMENT

View file

@ -1,176 +0,0 @@
diff -Nrup a/localedata/locales/mni_IN b/localedata/locales/mni_IN
--- a/localedata/locales/mni_IN 1969-12-31 17:00:00.000000000 -0700
+++ b/localedata/locales/mni_IN 2012-02-14 09:49:33.059129964 -0700
@@ -0,0 +1,172 @@
+comment_char %
+escape_char /
+% Manipuri language locale for India.
+% Contributed by Mr. Pravin Satpute <psatpute AT redhat DOT com> and Ms. Rebika Devi < rebika_srd AT rediffmail DOT com>
+
+LC_IDENTIFICATION
+title "Manipuri language locale for India"
+source "Red Hat Pune"
+address "Level 1, Tower X, Cybercity, Magarpatta City, Hadapsar, Pune-411013 "
+contact ""
+email "bug-glibc-locales@gnu.org"
+tel ""
+fax ""
+language "Manipuri"
+territory "India"
+revision "1.0"
+date "2012-01-17"
+%
+category "mni_IN:2012";LC_IDENTIFICATION
+category "mni_IN:2012";LC_CTYPE
+category "mni_IN:2012";LC_COLLATE
+category "mni_IN:2012";LC_TIME
+category "mni_IN:2012";LC_NUMERIC
+category "mni_IN:2012";LC_MONETARY
+category "mni_IN:2012";LC_MESSAGES
+category "mni_IN:2012";LC_PAPER
+category "mni_IN:2012";LC_NAME
+category "mni_IN:2012";LC_ADDRESS
+category "mni_IN:2012";LC_TELEPHONE
+
+END LC_IDENTIFICATION
+
+LC_CTYPE
+copy "bn_IN"
+END LC_CTYPE
+
+LC_COLLATE
+copy "bn_IN"
+END LC_COLLATE
+
+LC_MONETARY
+copy "bn_IN"
+END LC_MONETARY
+
+
+LC_NUMERIC
+copy "bn_IN"
+END LC_NUMERIC
+
+
+LC_TIME
+% This is the POSIX Locale definition for the LC_TIME category
+% generated by IBM Basic CountryPack Transformer.
+% These are generated based on XML base Locale definition file
+% for IBM Class for Unicode.
+%
+% Abbreviated weekday names (%a)
+abday "<U09A8><U09CB><U0982>";"<U09A8><U09BF><U0982>";/
+ "<U09B2><U09C8><U09AC><U09BE><U0995>";"<U09DF><U09C1><U09AE>";/
+ "<U09B6><U0997><U09CB><U09B2>";/
+ "<U0987><U09B0><U09BE>";"<U09A5><U09BE><U0982>"
+%
+
+% Full weekday names (%A)
+day "<U09A8><U09CB><U0982><U09AE><U09BE><U0987><U099C><U09BF><U0982>";/
+ "<U09A8><U09BF><U0982><U09A5><U09CC><U0995><U09BE><U09AC><U09BE>";/
+ "<U09B2><U09C8><U09AC><U09BE><U0995><U09AA><U09CB><U0995><U09AA><U09BE>";/
+ "<U09DF><U09C1><U09AE><U09B6><U0995><U09C8><U09B6><U09BE>";/
+ "<U09B6><U0997><U09CB><U09B2><U09B6><U09C7><U09A8>";/
+ "<U0987><U09B0><U09BE><U0987>";/
+ "<U09A5><U09BE><U0982><U099C>"
+%
+% Abbreviated month names (%b)
+abmon "<U099C><U09BE><U09A8>";/
+ "<U09AB><U09C7><U09AC>";/
+ "<U09AE><U09BE><U09B0>";/
+ "<U098F><U09AA><U09CD><U09B0><U09BF>";/
+ "<U09AE><U09C7>";/
+ "<U099C><U09C1><U09A8>";/
+ "<U099C><U09C1><U09B2>";/
+ "<U0986><U0997>";/
+ "<U09B8><U09C7><U09AA>";/
+ "<U0993><U0995><U09CD><U09A4>";/
+ "<U09A8><U09AC><U09C7>";/
+ "<U09A1><U09BF><U09B8>"
+%
+
+% Full month names (%B)
+mon "<U099C><U09BE><U09A8><U09C1><U09F1><U09BE><U09B0><U09BF>";/
+ "<U09AB><U09C7><U09AC><U09CD><U09B0><U09C1><U09F1><U09BE><U09B0><U09BF>";/
+ "<U09AE><U09BE><U09B0><U09CD><U099A>";/
+ "<U098F><U09AA><U09CD><U09B0><U09BF><U09B2>";/
+ "<U09AE><U09C7>";/
+ "<U099C><U09C1><U09A8>";/
+ "<U099C><U09C1><U09B2><U09BE><U0987>";/
+ "<U0986><U0997><U09B7><U09CD><U099F>";/
+ "<U09B8><U09C7><U09AA><U09CD><U09A4><U09C7><U09AE><U09CD><U09AC><U09B0>";/
+ "<U0993><U0995><U09CD><U09A4><U09CB><U09AC><U09B0>";/
+ "<U09A8><U09AC><U09C7><U09AE><U09CD><U09AC><U09B0>";/
+ "<U09A1><U09BF><U09B8><U09C7><U09AE><U09CD><U09AC><U09B0>"
+%
+% Equivalent of AM PM
+
+am_pm "<U098F><U002E><U09AE><U002E>";/
+ "<U09AA><U002E><U09AE><U002E>"
+%
+% Appropriate date and time representation
+% %A %d %b %Y%I:%M:%S %Z
+d_t_fmt "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/
+<U0020><U0025><U0059><U0020><U0025><U0049><U003A><U0025><U004D><U003A>/
+<U0025><U0053><U0020><U0025><U0070><U0020><U0025><U005A>"
+%
+% Appropriate date representation
+% %A %d %b %Y
+d_fmt "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/
+<U0020><U0025><U0059>"
+%
+% Appropriate time representation
+% %I:%M:%S %Z
+t_fmt "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/
+<U0020><U0020><U0025><U005A>"
+%
+% Appropriate 12 h time representation (%r)
+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/
+<U0020><U0025><U0070><U0020><U0025><U005A>"
+%
+% Appropriate date representation (date(1)) "%a %b %e %H:%M:%S %Z %Y"
+date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
+<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
+<U0025><U005A><U0020><U0025><U0059>"
+END LC_TIME
+
+
+LC_MESSAGES
+copy "en_IN"
+END LC_MESSAGES
+
+
+LC_PAPER
+copy "bn_IN"
+END LC_PAPER
+
+
+LC_NAME
+% This is the ISO_IEC TR14652 Locale definition for the LC_NAME category
+% generated by IBM Basic CountryPack Transformer.
+%
+%
+name_fmt "<U0025><U0070><U0025><U0074><U0025><U0066><U0025><U0074>/
+<U0025><U0067>"
+name_gen ""
+name_mr "<U09B6><U09CD><U09B0><U09C0>"
+name_mrs "<U09B6><U09CD><U09B0><U09C0><U09AE><U09A4><U09BF>"
+name_miss "<U0995><U09C1><U09AE><U09BE><U09B0><U09C0>"
+name_ms "<U0995><U09C1><U09AE><U09BE><U09B0>"
+
+END LC_NAME
+
+
+LC_ADDRESS
+copy "bn_IN"
+END LC_ADDRESS
+
+
+LC_TELEPHONE
+copy "bn_IN"
+END LC_TELEPHONE
+
+
+LC_MEASUREMENT
+copy "bn_IN"
+END LC_MEASUREMENT

View file

@ -1,180 +0,0 @@
diff -Nrup a/localedata/locales/doi_IN b/localedata/locales/doi_IN
--- a/localedata/locales/doi_IN 1969-12-31 17:00:00.000000000 -0700
+++ b/localedata/locales/doi_IN 2012-02-16 09:14:08.215572109 -0700
@@ -0,0 +1,176 @@
+comment_char %
+escape_char /
+% Dogri language locale for India.
+% Contributed by Pravin Satpute <psatpute@redhat.com> and Sushil Badyal <badyalsk@gmail.com>
+
+LC_IDENTIFICATION
+title "Dogri language locale for India"
+source "Red Hat Pune"
+address "Level 1, Tower X, Cybercity, Magarpatta City, Hadapsar, Pune-411013 "
+contact ""
+email "bug-glibc-locales@gnu.org"
+tel ""
+fax ""
+language "Dogri"
+territory "India"
+revision "1.0"
+date "2012-02-16"
+%
+category "doi_IN:2012";LC_IDENTIFICATION
+category "doi_IN:2012";LC_CTYPE
+category "doi_IN:2012";LC_COLLATE
+category "doi_IN:2012";LC_TIME
+category "doi_IN:2012";LC_NUMERIC
+category "doi_IN:2012";LC_MONETARY
+category "doi_IN:2012";LC_MESSAGES
+category "doi_IN:2012";LC_PAPER
+category "doi_IN:2012";LC_NAME
+category "doi_IN:2012";LC_ADDRESS
+category "doi_IN:2012";LC_TELEPHONE
+
+END LC_IDENTIFICATION
+
+LC_CTYPE
+copy "hi_IN"
+END LC_CTYPE
+
+LC_COLLATE
+
+% Copy the template from ISO/IEC 14651
+copy "iso14651_t1"
+
+END LC_COLLATE
+
+LC_MONETARY
+copy "hi_IN"
+END LC_MONETARY
+
+
+LC_NUMERIC
+copy "hi_IN"
+END LC_NUMERIC
+
+
+LC_TIME
+% This is the POSIX Locale definition for the LC_TIME category.
+% These are generated based on XML base Locale definition file
+% for IBM Class for Unicode/Java
+%
+% Abbreviated weekday names (%a)
+abday "<U0910><U0924><U0020>";/
+ "<U0938><U094B><U092E><U0020>";/
+ "<U092E><U0902><U0917><U0932><U0020>";/
+ "<U092C><U0941><U0927><U0020>";/
+ "<U092C><U0940><U0930><U0020>";/
+ "<U0936><U0941><U0915><U094D><U0915><U0930><U0020>";/
+ "<U0936><U094D><U0928><U0940><U091A><U0930><U0020>"
+%
+% Full weekday names (%A)
+day "<U0910><U0924><U092C><U093E><U0930><U0020>";/
+ "<U0938><U094B><U092E><U092C><U093E><U0930><U0020>";/
+ "<U092E><U0902><U0917><U0932><U092C><U0930><U0020>";/
+ "<U092C><U0941><U0927><U092C><U093E><U0930><U0020>";/
+ "<U092C><U0940><U0930><U092C><U093E><U0930><U0020>";/
+ "<U0936><U0941><U0915><U094D><U0915><U0930><U092C><U093E><U0930><U0020>";/
+ "<U0936><U094D><U0928><U0940><U091A><U0930><U092C><U093E><U0930><U0020>"
+%
+% Abbreviated month names (%b)
+abmon "<U091C><U0928><U0935><U0930><U0940>";/
+ "<U092B><U0930><U0935><U0930><U0940>";/
+ "<U092E><U093E><U0930><U094D><U091A>";/
+ "<U090F><U092A><U094D><U0930><U0948><U0932>";/
+ "<U092E><U0947><U0908>";"<U091C><U0942><U0928>";/
+ "<U091C><U0942><U0932><U0948>";/
+ "<U0905><U0917><U0938><U094D><U0924>";/
+ "<U0938><U093F><U0924><U0902><U092C><U0930>";/
+ "<U0905><U0915><U094D><U0924><U0942><U092C><U0930>";/
+ "<U0928><U0935><U0902><U092C><U0930>";/
+ "<U0926><U093F><U0938><U0902><U092C><U0930>"
+%
+% Full month names (%B)
+mon "<U091C><U0928><U0935><U0930><U0940>";/
+ "<U092B><U0930><U0935><U0930><U0940>";/
+ "<U092E><U093E><U0930><U094D><U091A>";/
+ "<U090F><U092A><U094D><U0930><U0948><U0932>";/
+ "<U092E><U0947><U0908>";"<U091C><U0942><U0928>";/
+ "<U091C><U0942><U0932><U0948>";/
+ "<U0905><U0917><U0938><U094D><U0924>";/
+ "<U0938><U093F><U0924><U0902><U092C><U0930>";/
+ "<U0905><U0915><U094D><U0924><U0942><U092C><U0930>";/
+ "<U0928><U0935><U0902><U092C><U0930>";/
+ "<U0926><U093F><U0938><U0902><U092C><U0930>"
+%
+% Equivalent of AM PM
+am_pm "<U0938><U091E><U0902>";/
+ "<U0938><U092C><U0947><U0930>"
+%
+% Appropriate date and time representation
+% %A %d %b %Y%I:%M:%S %Z
+d_t_fmt "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/
+<U0020><U0025><U0059><U0020><U0025><U0049><U003A><U0025><U004D><U003A>/
+<U0025><U0053><U0020><U0025><U0070><U0020><U0025><U005A>"
+%
+% Appropriate date representation
+% %A %d %b %Y
+d_fmt "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/
+<U0020><U0025><U0059>"
+%
+% Appropriate time representation
+% %I:%M:%S %Z
+t_fmt "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/
+<U0020><U0020><U0025><U005A>"
+%
+% Appropriate 12 h time representation (%r)
+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/
+<U0020><U0025><U0070><U0020><U0025><U005A>"
+%
+date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
+<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
+<U0025><U005A><U0020><U0025><U0059>"
+END LC_TIME
+
+
+LC_MESSAGES
+% ^(Yes|[yY])
+yesexpr "<U005E><U0028><U0911><U0939><U007C><U005B><U0079>/
+<U0059><U005D><U0029>"
+%
+% ^(No|[nN])
+noexpr "<U005E><U0028><U0928><U093E><U007C><U005B><U006E><U004E>/
+<U005D><U0029>"
+%
+END LC_MESSAGES
+
+LC_PAPER
+copy "hi_IN"
+END LC_PAPER
+
+
+LC_NAME
+% This is the ISO_IEC TR14652 Locale definition for the
+% LC_NAME category.
+%
+name_fmt "<U0025><U0070><U0025><U0074><U0025><U0066><U0025><U0074>/
+<U0025><U0067>"
+name_gen ""
+name_mr "<U004D><U0072><U002E>"
+name_mrs "<U004D><U0072><U0073><U002E>"
+name_miss "<U004D><U0069><U0073><U0073><U002E>"
+name_ms "<U004D><U0073><U002E>"
+
+END LC_NAME
+
+
+
+LC_ADDRESS
+copy "hi_IN"
+END LC_ADDRESS
+
+
+LC_TELEPHONE
+copy "hi_IN"
+END LC_TELEPHONE
+
+LC_MEASUREMENT
+copy "hi_IN"
+END LC_MEASUREMENT

View file

@ -1,78 +0,0 @@
2012-03-07 Jeff Law <law@redhat.com>
* elf/dl-reloc.c (_dl_relocate_object): Move code to allocate
l_reloc_result prior to calling ELF_DYNAMIC_RELOCATE.
diff -rup a/elf/dl-reloc.c b/elf/dl-reloc.c
--- a/elf/dl-reloc.c 2012-01-01 05:16:32.000000000 -0700
+++ b/elf/dl-reloc.c 2012-03-06 15:41:56.486242640 -0700
@@ -238,32 +238,9 @@ _dl_relocate_object (struct link_map *l,
/* String table object symbols. */
const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]);
- /* This macro is used as a callback from the ELF_DYNAMIC_RELOCATE code. */
-#define RESOLVE_MAP(ref, version, r_type) \
- (ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \
- ? ((__builtin_expect ((*ref) == l->l_lookup_cache.sym, 0) \
- && elf_machine_type_class (r_type) == l->l_lookup_cache.type_class) \
- ? (bump_num_cache_relocations (), \
- (*ref) = l->l_lookup_cache.ret, \
- l->l_lookup_cache.value) \
- : ({ lookup_t _lr; \
- int _tc = elf_machine_type_class (r_type); \
- l->l_lookup_cache.type_class = _tc; \
- l->l_lookup_cache.sym = (*ref); \
- const struct r_found_version *v = NULL; \
- if ((version) != NULL && (version)->hash != 0) \
- v = (version); \
- _lr = _dl_lookup_symbol_x (strtab + (*ref)->st_name, l, (ref), \
- scope, v, _tc, \
- DL_LOOKUP_ADD_DEPENDENCY, NULL); \
- l->l_lookup_cache.ret = (*ref); \
- l->l_lookup_cache.value = _lr; })) \
- : l)
-
-#include "dynamic-link.h"
-
- ELF_DYNAMIC_RELOCATE (l, lazy, consider_profiling, skip_ifunc);
-
+ /* ELF_DYNAMIC_RELOCATE may need to examine l_reloc_result
+ when handling MACHINE_IRELATIVE relocs. So we must
+ allocate l_reloc_result prior to calling ELF_DYNAMIC_RELOCATE. */
#ifndef PROF
if (__builtin_expect (consider_profiling, 0))
{
@@ -290,6 +267,32 @@ _dl_relocate_object (struct link_map *l,
}
}
#endif
+
+ /* This macro is used as a callback from the ELF_DYNAMIC_RELOCATE code. */
+#define RESOLVE_MAP(ref, version, r_type) \
+ (ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \
+ ? ((__builtin_expect ((*ref) == l->l_lookup_cache.sym, 0) \
+ && elf_machine_type_class (r_type) == l->l_lookup_cache.type_class) \
+ ? (bump_num_cache_relocations (), \
+ (*ref) = l->l_lookup_cache.ret, \
+ l->l_lookup_cache.value) \
+ : ({ lookup_t _lr; \
+ int _tc = elf_machine_type_class (r_type); \
+ l->l_lookup_cache.type_class = _tc; \
+ l->l_lookup_cache.sym = (*ref); \
+ const struct r_found_version *v = NULL; \
+ if ((version) != NULL && (version)->hash != 0) \
+ v = (version); \
+ _lr = _dl_lookup_symbol_x (strtab + (*ref)->st_name, l, (ref), \
+ scope, v, _tc, \
+ DL_LOOKUP_ADD_DEPENDENCY, NULL); \
+ l->l_lookup_cache.ret = (*ref); \
+ l->l_lookup_cache.value = _lr; })) \
+ : l)
+
+#include "dynamic-link.h"
+
+ ELF_DYNAMIC_RELOCATE (l, lazy, consider_profiling, skip_ifunc);
}
/* Mark the object so we know this work has been done. */

View file

@ -1,27 +0,0 @@
diff -rup a/localedata/SUPPORTED b/localedata/SUPPORTED
--- a/localedata/SUPPORTED 2012-03-12 14:11:04.134056609 -0600
+++ b/localedata/SUPPORTED 2012-03-14 20:59:39.993269235 -0600
@@ -103,6 +103,7 @@ de_DE@euro/ISO-8859-15 \
de_LU.UTF-8/UTF-8 \
de_LU/ISO-8859-1 \
de_LU@euro/ISO-8859-15 \
+doi_IN/UTF-8 \
dv_MV/UTF-8 \
dz_BT/UTF-8 \
el_GR.UTF-8/UTF-8 \
@@ -298,6 +299,7 @@ mk_MK.UTF-8/UTF-8 \
mk_MK/ISO-8859-5 \
ml_IN/UTF-8 \
mn_MN/UTF-8 \
+mni_IN/UTF-8 \
mr_IN/UTF-8 \
ms_MY.UTF-8/UTF-8 \
ms_MY/ISO-8859-1 \
@@ -350,6 +352,7 @@ ru_UA.UTF-8/UTF-8 \
ru_UA/KOI8-U \
rw_RW/UTF-8 \
sa_IN/UTF-8 \
+sat_IN/UTF-8 \
sc_IT/UTF-8 \
sd_IN/UTF-8 \
sd_IN@devanagari/UTF-8 \

View file

@ -1,23 +0,0 @@
diff -rup c/resolv/res_send.c d/resolv/res_send.c
--- c/resolv/res_send.c 2012-01-01 05:16:32.000000000 -0700
+++ d/resolv/res_send.c 2012-03-30 12:39:30.862467628 -0600
@@ -409,6 +409,7 @@ __libc_res_nsend(res_state statp, const
*/
if (EXT(statp).nsinit == 0) {
unsigned char map[MAXNS];
+ unsigned int ext_total_nscount;
memset (map, MAXNS, sizeof (map));
for (n = 0; n < MAXNS; n++) {
@@ -422,8 +423,9 @@ __libc_res_nsend(res_state statp, const
}
}
n = statp->nscount;
- if (statp->nscount > EXT(statp).nscount)
- for (n = EXT(statp).nscount, ns = 0;
+ ext_total_nscount = EXT(statp).nscount + EXT(statp).nscount6;
+ if (statp->nscount > ext_total_nscount)
+ for (n = ext_total_nscount, ns = 0;
n < statp->nscount; n++) {
while (ns < MAXNS
&& EXT(statp).nsmap[ns] != MAXNS)

View file

@ -1,78 +0,0 @@
diff -Nrup a/posix/fnmatch.c b/posix/fnmatch.c
--- a/posix/fnmatch.c 2012-01-01 07:16:32.000000000 -0500
+++ b/posix/fnmatch.c 2012-05-23 14:14:29.099461189 -0400
@@ -333,6 +333,7 @@ fnmatch (pattern, string, flags)
# if HANDLE_MULTIBYTE
if (__builtin_expect (MB_CUR_MAX, 1) != 1)
{
+ const char *orig_pattern = pattern;
mbstate_t ps;
size_t n;
const char *p;
@@ -356,10 +357,8 @@ fnmatch (pattern, string, flags)
alloca_used);
n = mbsrtowcs (wpattern, &p, n + 1, &ps);
if (__builtin_expect (n == (size_t) -1, 0))
- /* Something wrong.
- XXX Do we have to set `errno' to something which mbsrtows hasn't
- already done? */
- return -1;
+ /* Something wrong: Fall back to single byte matching. */
+ goto try_singlebyte;
if (p)
{
memset (&ps, '\0', sizeof (ps));
@@ -371,10 +370,8 @@ fnmatch (pattern, string, flags)
prepare_wpattern:
n = mbsrtowcs (NULL, &pattern, 0, &ps);
if (__builtin_expect (n == (size_t) -1, 0))
- /* Something wrong.
- XXX Do we have to set `errno' to something which mbsrtows hasn't
- already done? */
- return -1;
+ /*Something wrong: Fall back to single byte matching. */
+ goto try_singlebyte;
if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0))
{
__set_errno (ENOMEM);
@@ -401,14 +398,8 @@ fnmatch (pattern, string, flags)
alloca_used);
n = mbsrtowcs (wstring, &p, n + 1, &ps);
if (__builtin_expect (n == (size_t) -1, 0))
- {
- /* Something wrong.
- XXX Do we have to set `errno' to something which
- mbsrtows hasn't already done? */
- free_return:
- free (wpattern_malloc);
- return -1;
- }
+ /* Something wrong: Fall back to single byte matching. */
+ goto free_and_try_singlebyte;
if (p)
{
memset (&ps, '\0', sizeof (ps));
@@ -420,10 +411,8 @@ fnmatch (pattern, string, flags)
prepare_wstring:
n = mbsrtowcs (NULL, &string, 0, &ps);
if (__builtin_expect (n == (size_t) -1, 0))
- /* Something wrong.
- XXX Do we have to set `errno' to something which mbsrtows hasn't
- already done? */
- goto free_return;
+ /* Something wrong: Fall back to singlebyte matching. */
+ goto free_and_try_singlebyte;
if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0))
{
free (wpattern_malloc);
@@ -450,6 +439,10 @@ fnmatch (pattern, string, flags)
free (wpattern_malloc);
return res;
+ free_and_try_singlebyte:
+ free(wpattern_malloc);
+ try_singlebyte:
+ pattern = orig_pattern;
}
# endif /* mbstate_t and mbsrtowcs or _LIBC. */

View file

@ -1,13 +0,0 @@
diff -rup a/manual/Makefile b/manual/Makefile
--- a/manual/Makefile 2012-05-20 19:47:38.000000000 -0600
+++ b/manual/Makefile 2012-05-29 22:23:33.920428631 -0600
@@ -129,7 +129,8 @@ $(objpfx)%.c.texi: examples/%.c
mv -f $@.new $@
$(objpfx)%.info: %.texinfo
- LANGUAGE=C LC_ALL=C $(MAKEINFO) -P $(objpfx) --output=$@ $<
+ LANGUAGE=C LC_ALL=C $(MAKEINFO) -P $(objpfx) --output=`basename $@` $<
+ mv `basename $@`* $(objpfx)
$(objpfx)%.dvi: %.texinfo
cd $(objpfx);$(TEXI2DVI) -I $(shell cd $(<D) && pwd) --output=$@ \

View file

@ -1,27 +0,0 @@
2012-06-14 Jeff Law <law@redhat.com>
* locale/loadlocale.c (_nl_load_locale): Delay setting
file->decided until we have successfully loaded the file's
data.
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
index e3fa187..9fd9216 100644
--- a/locale/loadlocale.c
+++ b/locale/loadlocale.c
@@ -169,7 +169,6 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
int save_err;
int alloc = ld_mapped;
- file->decided = 1;
file->data = NULL;
fd = open_not_cancel_2 (file->filename, O_RDONLY | O_CLOEXEC);
@@ -278,6 +277,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
newdata->alloc = alloc;
file->data = newdata;
+ file->decided = 1;
}
void

View file

@ -1,72 +0,0 @@
diff -rup c/sysdeps/ieee754/dbl-64/slowexp.c d/sysdeps/ieee754/dbl-64/slowexp.c
--- c/sysdeps/ieee754/dbl-64/slowexp.c 2012-05-20 19:47:38.000000000 -0600
+++ d/sysdeps/ieee754/dbl-64/slowexp.c 2012-05-21 10:02:51.693957300 -0600
@@ -30,6 +30,8 @@
#include "mpa.h"
#include <math_private.h>
+#include <stap-probe.h>
+
#ifndef SECTION
# define SECTION
#endif
@@ -60,12 +62,21 @@ __slowexp(double x) {
__sub(&mpy,&mpcor,&mpz,p);
__mp_dbl(&mpw, &w, p);
__mp_dbl(&mpz, &z, p);
- if (w == z) return w;
+ if (w == z) {
+ /* Track how often we get to the slow exp code plus
+ its input/output values. */
+ LIBC_PROBE (slowexp_p6, 2, &x, &w);
+ return w;
+ }
else { /* if calculating is not exactly */
p = 32;
__dbl_mp(x,&mpx,p);
__mpexp(&mpx, &mpy, p);
__mp_dbl(&mpy, &res, p);
+
+ /* Track how often we get to the uber-slow exp code plus
+ its input/output values. */
+ LIBC_PROBE (slowexp_p32, 2, &x, &res);
return res;
}
}
diff -rup c/sysdeps/ieee754/dbl-64/slowpow.c d/sysdeps/ieee754/dbl-64/slowpow.c
--- c/sysdeps/ieee754/dbl-64/slowpow.c 2012-05-20 19:47:38.000000000 -0600
+++ d/sysdeps/ieee754/dbl-64/slowpow.c 2012-05-21 10:02:51.694957291 -0600
@@ -34,6 +34,8 @@
#include "mpa.h"
#include <math_private.h>
+#include <stap-probe.h>
+
#ifndef SECTION
# define SECTION
#endif
@@ -65,7 +67,12 @@ __slowpow(double x, double y, double z)
__mp_dbl(&mpr, &res, p);
__sub(&mpp,&eps,&mpr1,p); /* pp -eps =r1 */
__mp_dbl(&mpr1, &res1, p); /* converting into double precision */
- if (res == res1) return res;
+ if (res == res1) {
+ /* Track how often we get to the slow pow code plus
+ its input/output values. */
+ LIBC_PROBE (slowpow_p6, 4, &x, &y, &z, &res);
+ return res;
+ }
p = 32; /* if we get here result wasn't calculated exactly, continue */
__dbl_mp(x,&mpx,p); /* for more exact calculation */
@@ -75,5 +82,10 @@ __slowpow(double x, double y, double z)
__mul(&mpy,&mpz,&mpw,p); /* y*z =w */
__mpexp(&mpw, &mpp, p); /* e^w=pp */
__mp_dbl(&mpp, &res, p); /* converting into double precision */
+
+ /* Track how often we get to the uber-slow pow code plus
+ its input/output values. */
+ LIBC_PROBE (slowpow_p32, 4, &x, &y, &z, &res);
+
return res;
}

View file

@ -1,12 +1,567 @@
diff -Nrup c/scripts/check-local-headers.sh d/scripts/check-local-headers.sh
--- c/scripts/check-local-headers.sh 2012-05-20 19:47:38.000000000 -0600
+++ d/scripts/check-local-headers.sh 2012-05-20 23:54:51.258670072 -0600
@@ -28,7 +28,7 @@ exec ${AWK} -v includedir="$includedir"
diff -Nrup a/scripts/check-local-headers.sh b/scripts/check-local-headers.sh
--- a/scripts/check-local-headers.sh 2012-01-01 05:16:32.000000000 -0700
+++ b/scripts/check-local-headers.sh 2012-01-01 20:41:26.683439836 -0700
@@ -29,7 +29,7 @@ exec ${AWK} -v includedir="$includedir"
BEGIN {
status = 0
exclude = "^" includedir \
- "/(.*-.*-.*/|)(asm[-/]|linux/|selinux/|gd|nss3/|sys/capability\\.h|libaudit\\.h)"
+ "/(.*-.*-.*/|)(asm[-/]|linux/|selinux/|gd|nss3/|sys/capability\\.h|libaudit\\.h|sys/sdt(-config)?\\.h))"
- "/(asm[-/]|linux/|selinux/|gd|nss3/|sys/capability\\.h|libaudit\\.h)"
+ "/(asm[-/]|linux/|selinux/|gd|nss3/|sys/capability\\.h|libaudit\\.h|sys/sdt(-config)?\\.h))"
}
/^[^ ]/ && $1 ~ /.*:/ { obj = $1 }
{
diff -Nrup a/sysdeps/i386/__longjmp.S b/sysdeps/i386/__longjmp.S
--- a/sysdeps/i386/__longjmp.S 2012-01-01 05:16:32.000000000 -0700
+++ b/sysdeps/i386/__longjmp.S 2012-01-01 20:41:26.686439835 -0700
@@ -1,5 +1,5 @@
/* longjmp for i386.
- Copyright (C) 1995-1998,2000,2002,2005,2006,2009
+ Copyright (C) 1995-1998,2000,2002,2005,2006,2009,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -21,6 +21,7 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
+#include <stap-probe.h>
.text
ENTRY (__longjmp)
@@ -33,6 +34,7 @@ ENTRY (__longjmp)
movl (JB_SP*4)(%eax), %ecx
PTR_DEMANGLE (%edx)
PTR_DEMANGLE (%ecx)
+ LIBC_PROBE (longjmp, 3, 4@%eax, -4@8(%esp), 4@%edx)
cfi_def_cfa(%eax, 0)
cfi_register(%eip, %edx)
cfi_register(%esp, %ecx)
@@ -50,6 +52,7 @@ ENTRY (__longjmp)
cfi_restore(%edi)
cfi_restore(%ebp)
+ LIBC_PROBE (longjmp_target, 3, 4@%eax, -4@8(%esp), 4@%edx)
movl 8(%esp), %eax /* Second argument is return value. */
movl %ecx, %esp
#else
@@ -57,12 +60,14 @@ ENTRY (__longjmp)
movl 8(%esp), %eax /* Second argument is return value. */
/* Save the return address now. */
movl (JB_PC*4)(%ecx), %edx
+ LIBC_PROBE (longjmp, 3, 4@%ecx, -4@%eax, 4@%edx)
/* Restore registers. */
movl (JB_BX*4)(%ecx), %ebx
movl (JB_SI*4)(%ecx), %esi
movl (JB_DI*4)(%ecx), %edi
movl (JB_BP*4)(%ecx), %ebp
movl (JB_SP*4)(%ecx), %esp
+ LIBC_PROBE (longjmp_target, 3, 4@%ecx, -4@%ecx, 4@%edx)
#endif
/* Jump to saved PC. */
jmp *%edx
diff -Nrup a/sysdeps/i386/bsd-_setjmp.S b/sysdeps/i386/bsd-_setjmp.S
--- a/sysdeps/i386/bsd-_setjmp.S 2012-01-01 05:16:32.000000000 -0700
+++ b/sysdeps/i386/bsd-_setjmp.S 2012-01-01 20:41:26.686439835 -0700
@@ -1,5 +1,6 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. i386 version.
- Copyright (C) 1994-1997,2000-2002,2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1994-1997,2000-2002,2005,2006,2011
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,6 +26,7 @@
#include <jmpbuf-offsets.h>
#include "bp-sym.h"
#include "bp-asm.h"
+#include <stap-probe.h>
#define PARMS LINKAGE /* no space for saved regs */
#define JMPBUF PARMS
@@ -47,6 +49,7 @@ ENTRY (BP_SYM (_setjmp))
#endif
movl %ecx, (JB_SP*4)(%edx)
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
+ LIBC_PROBE (setjmp, 3, 4@%edx, -4@$0, 4@%ecx)
#ifdef PTR_MANGLE
PTR_MANGLE (%ecx)
#endif
diff -Nrup a/sysdeps/i386/bsd-setjmp.S b/sysdeps/i386/bsd-setjmp.S
--- a/sysdeps/i386/bsd-setjmp.S 2012-01-01 05:16:32.000000000 -0700
+++ b/sysdeps/i386/bsd-setjmp.S 2012-01-01 20:41:26.687439834 -0700
@@ -1,5 +1,6 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. i386 version.
- Copyright (C) 1994-1997,2000,2001,2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1994-1997,2000,2001,2005,2006,2011
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,6 +26,7 @@
#include <jmpbuf-offsets.h>
#include "bp-sym.h"
#include "bp-asm.h"
+#include <stap-probe.h>
#define PARMS LINKAGE /* no space for saved regs */
#define JMPBUF PARMS
@@ -49,6 +51,7 @@ ENTRY (BP_SYM (setjmp))
#endif
movl %ecx, (JB_SP*4)(%eax)
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
+ LIBC_PROBE (setjmp, 3, 4@%eax, -4@$1, 4@%ecx)
#ifdef PTR_MANGLE
PTR_MANGLE (%ecx)
#endif
diff -Nrup a/sysdeps/i386/setjmp.S b/sysdeps/i386/setjmp.S
--- a/sysdeps/i386/setjmp.S 2012-01-01 05:16:32.000000000 -0700
+++ b/sysdeps/i386/setjmp.S 2012-01-01 20:41:26.687439834 -0700
@@ -1,5 +1,5 @@
/* setjmp for i386.
- Copyright (C) 1995,1996,1997,2000,2001,2005,2006
+ Copyright (C) 1995,1996,1997,2000,2001,2005,2006,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -23,6 +23,7 @@
#include <asm-syntax.h>
#include "bp-sym.h"
#include "bp-asm.h"
+#include <stap-probe.h>
#define PARMS LINKAGE /* no space for saved regs */
#define JMPBUF PARMS
@@ -44,6 +45,7 @@ ENTRY (BP_SYM (__sigsetjmp))
#endif
movl %ecx, (JB_SP*4)(%eax)
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
+ LIBC_PROBE (setjmp, 3, 4@%eax, -4@SIGMSK(%esp), 4@%ecx)
#ifdef PTR_MANGLE
PTR_MANGLE (%ecx)
#endif
diff -Nrup a/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S b/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S
--- a/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S 2012-01-01 05:16:32.000000000 -0700
+++ b/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S 2012-01-01 20:41:26.699439832 -0700
@@ -1,4 +1,5 @@
-/* Copyright (C) 2001,2004,2005,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001,2004,2005,2006,2009,2011
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +20,7 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
+#include <stap-probe.h>
.section .rodata.str1.1,"aMS",@progbits,1
@@ -79,7 +81,9 @@ ENTRY (____longjmp_chk)
cfi_adjust_cfa_offset(-12)
movl 4(%esp), %ecx
-.Lok: /* We add unwind information for the target here. */
+.Lok:
+ LIBC_PROBE (longjmp, 3, 4@%ecx, -4@8(%esp), 4@%edx)
+ /* We add unwind information for the target here. */
cfi_def_cfa(%ecx, 0)
cfi_register(%eip, %edx)
cfi_register(%esp, %edi)
@@ -102,5 +106,6 @@ ENTRY (____longjmp_chk)
cfi_restore(%ebp)
/* Jump to saved PC. */
+ LIBC_PROBE (longjmp_target, 3, 4@%ecx, -4@%eax, 4@%edx)
jmp *%edx
END (____longjmp_chk)
diff -Nrup a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
--- a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S 2012-01-01 05:16:32.000000000 -0700
+++ b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S 2012-01-01 20:41:26.703439831 -0700
@@ -19,6 +19,7 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
+#include <stap-probe.h>
.section .rodata.str1.1,"aMS",@progbits,1
.type longjmp_msg,@object
@@ -94,7 +95,9 @@ ENTRY(____longjmp_chk)
movl %ebx, %esi
cfi_restore (%rsi)
-.Lok: /* We add unwind information for the target here. */
+.Lok:
+ LIBC_PROBE (longjmp, 3, 8@%rdi, -4@%esi, 8@%rdx)
+ /* We add unwind information for the target here. */
cfi_def_cfa(%rdi, 0)
cfi_register(%rsp,%r8)
cfi_register(%rbp,%r9)
@@ -113,5 +116,6 @@ ENTRY(____longjmp_chk)
movl %esi, %eax
movq %r8,%rsp
movq %r9,%rbp
+ LIBC_PROBE (longjmp_target, 3, 8@%rdi, -4@%eax, 8@%rdx)
jmpq *%rdx
END (____longjmp_chk)
diff -Nrup a/sysdeps/x86_64/__longjmp.S b/sysdeps/x86_64/__longjmp.S
--- a/sysdeps/x86_64/__longjmp.S 2012-01-01 05:16:32.000000000 -0700
+++ b/sysdeps/x86_64/__longjmp.S 2012-01-01 20:41:26.703439831 -0700
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,2004,2005,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001,2004,2005,2006,2009,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
+#include <stap-probe.h>
/* Jump to the position specified by ENV, causing the
setjmp call there to return VAL, or 1 if VAL is 0.
@@ -34,6 +35,7 @@ ENTRY(__longjmp)
PTR_DEMANGLE (%r9)
PTR_DEMANGLE (%rdx)
#endif
+ LIBC_PROBE (longjmp, 3, 8@%rdi, -4@%esi, 8@%rdx)
/* We add unwind information for the target here. */
cfi_def_cfa(%rdi, 0)
cfi_register(%rsp,%r8)
@@ -53,5 +55,6 @@ ENTRY(__longjmp)
mov %esi, %eax
movq %r8,%rsp
movq %r9,%rbp
+ LIBC_PROBE (longjmp_target, 3, 8@%rdi, -4@%eax, 8@%rdx)
jmpq *%rdx
END (__longjmp)
diff -Nrup a/sysdeps/x86_64/setjmp.S b/sysdeps/x86_64/setjmp.S
--- a/sysdeps/x86_64/setjmp.S 2012-01-01 05:16:32.000000000 -0700
+++ b/sysdeps/x86_64/setjmp.S 2012-01-01 20:41:26.704439831 -0700
@@ -1,5 +1,5 @@
/* setjmp for x86-64.
- Copyright (C) 2001, 2003, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001,2003,2005,2006,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
+#include <stap-probe.h>
ENTRY (__sigsetjmp)
/* Save registers. */
@@ -41,6 +42,7 @@ ENTRY (__sigsetjmp)
#endif
movq %rdx, (JB_RSP*8)(%rdi)
movq (%rsp), %rax /* Save PC we are returning to now. */
+ LIBC_PROBE (setjmp, 3, 8@%rdi, -4@%esi, 8@%rax)
#ifdef PTR_MANGLE
PTR_MANGLE (%rax)
#endif
diff -Nrup a/include/stap-probe.h b/include/stap-probe.h
--- a/include/stap-probe.h 1969-12-31 17:00:00.000000000 -0700
+++ b/include/stap-probe.h 2012-01-01 20:41:26.646439841 -0700
@@ -0,0 +1,140 @@
+/* Macros for defining Systemtap <sys/sdt.h> static probe points.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STAP_PROBE_H
+#define _STAP_PROBE_H 1
+
+#ifdef USE_STAP_PROBE
+
+# include <sys/sdt.h>
+
+/* Our code uses one macro LIBC_PROBE (name, n, arg1, ..., argn).
+
+ Without USE_STAP_PROBE, that does nothing but evaluates all
+ its arguments (to prevent bit rot, unlike e.g. assert).
+
+ Systemtap's header defines the macros STAP_PROBE (provider, name) and
+ STAP_PROBEn (provider, name, arg1, ..., argn). For "provider" we paste
+ in the IN_LIB name (libc, libpthread, etc.) automagically. */
+
+# ifndef NOT_IN_libc
+# define IN_LIB libc
+# elif !defined IN_LIB
+/* This is intentionally defined with extra unquoted commas in it so
+ that macro substitution will bomb out when it is used. We don't
+ just use #error here, so that this header can be included by
+ other headers that use LIBC_PROBE inside their own macros. We
+ only want such headers to fail to compile if those macros are
+ actually used in a context where IN_LIB has not been defined. */
+# define IN_LIB ,,,missing -DIN_LIB=... -- not extra-lib.mk?,,,
+# endif
+
+# define LIBC_PROBE(name, n, ...) \
+ LIBC_PROBE_1 (IN_LIB, name, n, ## __VA_ARGS__)
+
+# define LIBC_PROBE_1(lib, name, n, ...) \
+ STAP_PROBE##n (lib, name, ## __VA_ARGS__)
+
+# define STAP_PROBE0 STAP_PROBE
+
+# define LIBC_PROBE_ASM(name, template) \
+ STAP_PROBE_ASM (IN_LIB, name, template)
+
+# define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS
+
+#else /* Not USE_STAP_PROBE. */
+
+# ifndef __ASSEMBLER__
+# define LIBC_PROBE(name, n, ...) DUMMY_PROBE##n (__VA_ARGS__)
+# else
+# define LIBC_PROBE(name, n, ...) /* Nothing. */
+# endif
+
+# define LIBC_PROBE_ASM(name, template) /* Nothing. */
+# define LIBC_PROBE_ASM_OPERANDS(n, ...) /* Nothing. */
+
+/* This silliness lets us evaluate all the arguments for each arity
+ of probe. My kingdom for a real macro system. */
+
+# define DUMMY_PROBE0() do {} while (0)
+# define DUMMY_PROBE1(a1) do {} while ((void) (a1), 0)
+# define DUMMY_PROBE2(a1, a2) do {} while ((void) (a1), \
+ (void) (a2), 0)
+# define DUMMY_PROBE3(a1, a2, a3) do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), 0)
+# define DUMMY_PROBE4(a1, a2, a3, a4) do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), \
+ (void) (a4), 0)
+# define DUMMY_PROBE5(a1, a2, a3, a4, a5) \
+ do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), \
+ (void) (a4), \
+ (void) (a5), 0)
+# define DUMMY_PROBE6(a1, a2, a3, a4, a5, a6) \
+ do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), \
+ (void) (a4), \
+ (void) (a5), \
+ (void) (a6), 0)
+# define DUMMY_PROBE7(a1, a2, a3, a4, a5, a6, a7) \
+ do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), \
+ (void) (a4), \
+ (void) (a5), \
+ (void) (a6), \
+ (void) (a7), 0)
+# define DUMMY_PROBE8(a1, a2, a3, a4, a5, a6, a7, a8) \
+ do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), \
+ (void) (a4), \
+ (void) (a5), \
+ (void) (a6), \
+ (void) (a7), \
+ (void) (a8), 0)
+# define DUMMY_PROBE9(a1, a2, a3, a4, a5, a6, a7, a8, a9) \
+ do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), \
+ (void) (a4), \
+ (void) (a5), \
+ (void) (a6), \
+ (void) (a7), \
+ (void) (a8), \
+ (void) (a9), 0)
+# define DUMMY_PROBE10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) \
+ do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), \
+ (void) (a4), \
+ (void) (a5), \
+ (void) (a6), \
+ (void) (a7), \
+ (void) (a8), \
+ (void) (a9), \
+ (void) (a10), 0)
+
+#endif /* USE_STAP_PROBE. */
+
+#endif /* stap-probe.h */
diff -Nrup a/config.h.in b/config.h.in
--- a/config.h.in 2012-01-01 05:16:32.000000000 -0700
+++ b/config.h.in 2012-01-01 20:41:26.632439843 -0700
@@ -187,6 +187,9 @@
/* Define if `.ctors' and `.dtors' sections shouldn't be used. */
#undef NO_CTORS_DTORS_SECTIONS
+/* Define if Systemtap <sys/sdt.h> probes should be defined. */
+#undef USE_STAP_PROBE
+
/*
*/
diff -Nrup a/configure b/configure
--- a/configure 2012-01-01 20:40:50.423446105 -0700
+++ b/configure 2012-01-01 20:41:26.634439843 -0700
@@ -791,6 +791,7 @@ enable_kernel
enable_all_warnings
enable_multi_arch
enable_nss_crypt
+enable_systemtap
with_cpu
'
ac_precious_vars='build_alias
@@ -1450,6 +1451,7 @@ Optional Features:
--enable-multi-arch enable single DSO with optimizations for multiple
architectures
--enable-nss-crypt enable libcrypt to use nss
+ --enable-systemtap enable systemtap static probe points [default=no]
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -3804,6 +3806,51 @@ else
fi
+# Check whether --enable-systemtap was given.
+if test "${enable_systemtap+set}" = set; then :
+ enableval=$enable_systemtap; systemtap=$enableval
+else
+ systemtap=no
+fi
+
+if test x$systemtap != xno; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for systemtap static probe support" >&5
+$as_echo_n "checking for systemtap static probe support... " >&6; }
+if test "${libc_cv_sdt+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ old_CFLAGS="$CFLAGS"
+ CFLAGS="-std=gnu99 $CFLAGS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/sdt.h>
+void foo (int i, void *p)
+{
+ asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
+ :: STAP_PROBE_ASM_OPERANDS (2, i, p));
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ libc_cv_sdt=yes
+else
+ libc_cv_sdt=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$old_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_sdt" >&5
+$as_echo "$libc_cv_sdt" >&6; }
+ if test $libc_cv_sdt = yes; then
+ $as_echo "#define USE_STAP_PROBE 1" >>confdefs.h
+
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "systemtap support needs sys/sdt.h with asm support
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+fi
+
# The way shlib-versions is used to generate soversions.mk uses a
# fairly simplistic model for name recognition that can't distinguish
# i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
diff -Nrup a/configure.in b/configure.in
--- a/configure.in 2012-01-01 05:16:32.000000000 -0700
+++ b/configure.in 2012-01-01 20:41:26.635439843 -0700
@@ -290,6 +290,29 @@ else
fi
AC_SUBST(libc_cv_nss_crypt)
+AC_ARG_ENABLE([systemtap],
+ [AS_HELP_STRING([--enable-systemtap],
+ [enable systemtap static probe points @<:@default=no@:>@])],
+ [systemtap=$enableval],
+ [systemtap=no])
+if test x$systemtap != xno; then
+ AC_CACHE_CHECK([for systemtap static probe support], libc_cv_sdt, [dnl
+ old_CFLAGS="$CFLAGS"
+ CFLAGS="-std=gnu99 $CFLAGS"
+ AC_COMPILE_IFELSE([#include <sys/sdt.h>
+void foo (int i, void *p)
+{
+ asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
+ :: STAP_PROBE_ASM_OPERANDS (2, i, p));
+}], [libc_cv_sdt=yes], [libc_cv_sdt=no])
+ CFLAGS="$old_CFLAGS"])
+ if test $libc_cv_sdt = yes; then
+ AC_DEFINE([USE_STAP_PROBE])
+ else
+ AC_MSG_FAILURE([systemtap support needs sys/sdt.h with asm support])
+ fi
+fi
+
# The way shlib-versions is used to generate soversions.mk uses a
# fairly simplistic model for name recognition that can't distinguish
# i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
diff -Nrup a/extra-lib.mk b/extra-lib.mk
--- a/extra-lib.mk 2012-01-01 05:16:32.000000000 -0700
+++ b/extra-lib.mk 2012-01-01 20:41:26.644439841 -0700
@@ -101,4 +101,4 @@ ifneq (,$(cpp-srcs-left))
include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
endif
-CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1
+CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1 -DIN_LIB=$(lib)
diff -Nrup a/elf/Makefile b/elf/Makefile
--- a/elf/Makefile 2012-01-01 05:16:32.000000000 -0700
+++ b/elf/Makefile 2012-01-01 20:41:26.637439843 -0700
@@ -505,7 +506,8 @@ CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'
CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
CFLAGS-cache.c = $(SYSCONF-FLAGS)
-CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1)
+CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
+ -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
generated += $(addsuffix .so,$(strip $(modules-names)))
diff -Nrup a/elf/rtld-Rules b/elf/rtld-Rules
--- a/elf/rtld-Rules 2012-01-01 05:16:32.000000000 -0700
+++ b/elf/rtld-Rules 2012-01-01 20:41:26.642439841 -0700
@@ -1,7 +1,7 @@
# Subroutine makefile for compiling libc modules linked into dynamic linker.
# Copyright (C) 2002,2003,2005,2006,2008,2010,2011
-# Free Software Foundation, Inc.
+# Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -131,6 +131,6 @@ ifdef rtld-depfiles
endif
# This here is the whole point of all the shenanigans.
-rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1
+rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld
endif

28
glibc-sw13618-2.patch Normal file
View file

@ -0,0 +1,28 @@
diff -Nrup a/elf/dl-open.c b/elf/dl-open.c
--- a/elf/dl-open.c 2012-01-29 21:57:36.251660367 -0700
+++ b/elf/dl-open.c 2012-01-29 21:58:55.762694069 -0700
@@ -328,7 +328,7 @@ dl_open_worker (void *a)
while (l != NULL);
if (nmaps > 1)
{
- char seen[nmaps];
+ uint16_t seen[nmaps];
memset (seen, '\0', nmaps);
size_t i = 0;
while (1)
@@ -354,13 +354,13 @@ dl_open_worker (void *a)
(k - i) * sizeof (maps[0]));
maps[k] = thisp;
- if (seen[i + 1] > 1)
+ if (seen[i + 1] > nmaps - i)
{
++i;
goto next_clear;
}
- char this_seen = seen[i];
+ uint16_t this_seen = seen[i];
memmove (&seen[i], &seen[i + 1],
(k - i) * sizeof (seen[0]));
seen[k] = this_seen;

267
glibc-sw13618.patch Normal file
View file

@ -0,0 +1,267 @@
diff -Nrup a/Makeconfig b/Makeconfig
--- a/Makeconfig 2012-01-29 21:44:43.010328202 -0700
+++ b/Makeconfig 2012-01-29 21:45:18.242344330 -0700
@@ -950,6 +950,12 @@ libdl =
endif
endif
+ifeq ($(build-shared),yes)
+libm = $(common-objpfx)math/libm.so$(libm.so-version)
+else
+libm = $(common-objpfx)math/libm.a
+endif
+
# These are the subdirectories containing the library source. The order
# is more or less arbitrary. The sorting step will take care of the
# dependencies.
diff -Nrup a/elf/Makefile b/elf/Makefile
--- a/elf/Makefile 2012-01-29 21:44:43.087328238 -0700
+++ b/elf/Makefile 2012-01-29 21:45:18.880344622 -0700
@@ -124,7 +124,8 @@ distribute := rtld-Rules \
tst-initordera1.c tst-initordera2.c tst-initorderb1.c \
tst-initorderb2.c tst-initordera3.c tst-initordera4.c \
tst-initorder.c \
- tst-initorder2.c
+ tst-initorder2.c \
+ tst-relsort1.c tst-relsort1mod1.c tst-relsort1mod2.c
CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-dl-lookup.c = -fexceptions -fasynchronous-unwind-tables
@@ -230,7 +231,7 @@ tests += loadtest restest1 preloadtest l
tst-audit1 tst-audit2 \
tst-stackguard1 tst-addr1 tst-thrlock \
tst-unique1 tst-unique2 tst-unique3 tst-unique4 \
- tst-initorder tst-initorder2
+ tst-initorder tst-initorder2 tst-relsort1
# reldep9
test-srcs = tst-pathopt
selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null)
@@ -293,7 +294,9 @@ modules-names = testobj1 testobj2 testob
tst-initordera1 tst-initorderb1 \
tst-initordera2 tst-initorderb2 \
tst-initordera3 tst-initordera4 \
- tst-initorder2a tst-initorder2b tst-initorder2c tst-initorder2d
+ tst-initorder2a tst-initorder2b tst-initorder2c \
+ tst-initorder2d \
+ tst-relsort1mod1 tst-relsort1mod2
ifeq (yes,$(have-initfini-array))
modules-names += tst-array2dep tst-array5dep
endif
@@ -1199,3 +1202,9 @@ CFLAGS-tst-auditmod6b.c += $(AVX-CFLAGS)
CFLAGS-tst-auditmod6c.c += $(AVX-CFLAGS)
CFLAGS-tst-auditmod7b.c += $(AVX-CFLAGS)
endif
+
+$(objpfx)tst-relsort1: $(libdl)
+$(objpfx)tst-relsort1mod1.so: $(libm) $(objpfx)tst-relsort1mod2.so
+$(objpfx)tst-relsort1mod2.so: $(libm)
+$(objpfx)tst-relsort1.out: $(objpfx)tst-relsort1mod1.so \
+ $(objpfx)tst-relsort1mod2.so
diff -Nrup a/elf/dl-open.c b/elf/dl-open.c
--- a/elf/dl-open.c 2012-01-29 21:44:43.165328272 -0700
+++ b/elf/dl-open.c 2012-01-29 21:55:06.683599515 -0700
@@ -1,5 +1,5 @@
/* Load a shared object at runtime, relocate it, and run its initializer.
- Copyright (C) 1996-2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1996-2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -304,53 +304,116 @@ dl_open_worker (void *a)
if (GLRO(dl_lazy))
reloc_mode |= mode & RTLD_LAZY;
- /* Relocate the objects loaded. We do this in reverse order so that copy
- relocs of earlier objects overwrite the data written by later objects. */
-
+ /* Sort the objects by dependency for the relocation process. This
+ allows IFUNC relocations to work and it also means copy
+ relocation of dependencies are if necessary overwritten. */
+ size_t nmaps = 0;
struct link_map *l = new;
- while (l->l_next)
- l = l->l_next;
- int relocation_in_progress = 0;
- while (1)
+ do
{
if (! l->l_real->l_relocated)
+ ++nmaps;
+ l = l->l_next;
+ }
+ while (l != NULL);
+ struct link_map *maps[nmaps];
+ nmaps = 0;
+ l = new;
+ do
+ {
+ if (! l->l_real->l_relocated)
+ maps[nmaps++] = l;
+ l = l->l_next;
+ }
+ while (l != NULL);
+ if (nmaps > 1)
+ {
+ char seen[nmaps];
+ memset (seen, '\0', nmaps);
+ size_t i = 0;
+ while (1)
{
- if (! relocation_in_progress)
+ ++seen[i];
+ struct link_map *thisp = maps[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. */
+ size_t k = nmaps - 1;
+ while (k > i)
{
- /* Notify the debugger that relocations are about to happen. */
- LIBC_PROBE (rtld_reloc_start, 2, args->nsid, r);
- relocation_in_progress = 1;
+ struct link_map **runp = maps[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 (&maps[i], &maps[i + 1],
+ (k - i) * sizeof (maps[0]));
+ maps[k] = thisp;
+
+ if (seen[i + 1] > 1)
+ {
+ ++i;
+ goto next_clear;
+ }
+
+ char this_seen = seen[i];
+ memmove (&seen[i], &seen[i + 1],
+ (k - i) * sizeof (seen[0]));
+ seen[k] = this_seen;
+
+ goto next;
+ }
+
+ --k;
}
+ if (++i == nmaps)
+ break;
+ next_clear:
+ memset (&seen[i], 0, (nmaps - i) * sizeof (seen[0]));
+ next:;
+ }
+ }
+
+ int relocation_in_progress = 0;
+ for (size_t i = nmaps; i-- > 0; )
+ {
+ l = maps[i];
+
+ if (! relocation_in_progress)
+ {
+ /* Notify the debugger that relocations are about to happen. */
+ LIBC_PROBE (rtld-reloc_start, 2, args->nsid, r);
+ relocation_in_progress = 1;
+ }
#ifdef SHARED
- if (__builtin_expect (GLRO(dl_profile) != NULL, 0))
+ if (__builtin_expect (GLRO(dl_profile) != NULL, 0))
+ {
+ /* If this here is the shared object which we want to profile
+ make sure the profile is started. We can find out whether
+ this is necessary or not by observing the `_dl_profile_map'
+ variable. If it was NULL but is not NULL afterwars we must
+ start the profiling. */
+ struct link_map *old_profile_map = GL(dl_profile_map);
+
+ _dl_relocate_object (l, l->l_scope, reloc_mode | RTLD_LAZY, 1);
+
+ if (old_profile_map == NULL && GL(dl_profile_map) != NULL)
{
- /* If this here is the shared object which we want to profile
- make sure the profile is started. We can find out whether
- this is necessary or not by observing the `_dl_profile_map'
- variable. If was NULL but is not NULL afterwars we must
- start the profiling. */
- struct link_map *old_profile_map = GL(dl_profile_map);
-
- _dl_relocate_object (l, l->l_scope, reloc_mode | RTLD_LAZY, 1);
-
- if (old_profile_map == NULL && GL(dl_profile_map) != NULL)
- {
- /* We must prepare the profiling. */
- _dl_start_profile ();
-
- /* Prevent unloading the object. */
- GL(dl_profile_map)->l_flags_1 |= DF_1_NODELETE;
- }
+ /* We must prepare the profiling. */
+ _dl_start_profile ();
+
+ /* Prevent unloading the object. */
+ GL(dl_profile_map)->l_flags_1 |= DF_1_NODELETE;
}
- else
-#endif
- _dl_relocate_object (l, l->l_scope, reloc_mode, 0);
}
-
- if (l == new)
- break;
- l = l->l_prev;
+ else
+#endif
+ _dl_relocate_object (l, l->l_scope, reloc_mode, 0);
}
/* If the file is not loaded now as a dependency, add the search
diff -Nrup a/elf/tst-relsort1.c b/elf/tst-relsort1.c
--- a/elf/tst-relsort1.c 1969-12-31 17:00:00.000000000 -0700
+++ b/elf/tst-relsort1.c 2012-01-29 21:45:18.913344636 -0700
@@ -0,0 +1,19 @@
+#include <dlfcn.h>
+#include <stdio.h>
+
+
+static int
+do_test ()
+{
+ const char lib[] = "$ORIGIN/tst-relsort1mod1.so";
+ void *h = dlopen (lib, RTLD_NOW);
+ if (h == NULL)
+ {
+ puts (dlerror ());
+ return 1;
+ }
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff -Nrup a/elf/tst-relsort1mod1.c b/elf/tst-relsort1mod1.c
--- a/elf/tst-relsort1mod1.c 1969-12-31 17:00:00.000000000 -0700
+++ b/elf/tst-relsort1mod1.c 2012-01-29 21:45:18.914344636 -0700
@@ -0,0 +1,7 @@
+extern int foo (double);
+
+int
+bar (void)
+{
+ return foo (1.2);
+}
diff -Nrup a/elf/tst-relsort1mod2.c b/elf/tst-relsort1mod2.c
--- a/elf/tst-relsort1mod2.c 1969-12-31 17:00:00.000000000 -0700
+++ b/elf/tst-relsort1mod2.c 2012-01-29 21:45:18.914344636 -0700
@@ -0,0 +1,7 @@
+#include <math.h>
+
+int
+foo (double d)
+{
+ return floor (d) != 0.0;
+}

View file

@ -1,5 +1,5 @@
# CVS snapshots of glibc
%define RELEASE 1
%define RELEASE 0
%if %{RELEASE}
%define glibcsrcdir glibc-%{version}
%define glibcportsdir glibc-%{version}
@ -22,7 +22,6 @@
%define libc_devel %mklibname -d c
%define libc_static_devel %mklibname -d -s c
%define multilibc libc%{libc_major}
%define api 2.16
%define _disable_ld_no_undefined 1
%undefine _fortify_cflags
@ -74,27 +73,27 @@
#-----------------------------------------------------------------------
Summary: The GNU libc libraries
Name: glibc
Version: 2.16.0
Release: 1
Version: 2.15
Release: 3
Epoch: 6
License: LGPLv2+ and LGPLv2+ with exceptions and GPLv2+
Group: System/Libraries
Url: http://www.gnu.org/software/libc/
# FSF source
Source0: http://ftp.gnu.org/gnu/glibc/%{glibcsrcdir}.tar.xz
Source0: http://ftp.gnu.org/gnu/glibc/%{glibcsrcdir}.tar.gz
%if %{RELEASE}
Source1: http://ftp.gnu.org/gnu/glibc/%{glibcsrcdir}.tar.xz.sig
Source1: http://ftp.gnu.org/gnu/glibc/%{glibcsrcdir}.tar.gz.sig
%endif
# Fedora tarball
Source2: %{glibcsrcdir}-fedora.tar.xz
Source2: %{glibcsrcdir}-fedora.tar.gz
Source3: glibc-manpages.tar.bz2
Source5: glibc-check.sh
Source8: http://ftp.gnu.org/gnu/glibc/%{glibcportsdir}.tar.xz
Source8: http://ftp.gnu.org/gnu/glibc/%{glibcportsdir}.tar.gz
%if %{RELEASE}
Source9: http://ftp.gnu.org/gnu/glibc/%{glibcportsdir}.tar.xz.sig
Source9: http://ftp.gnu.org/gnu/glibc/%{glibcportsdir}.tar.gz.sig
%endif
# Blowfish support
@ -119,6 +118,10 @@ BuildRequires: kernel-headers
%if %{build_selinux}
BuildRequires: libselinux-devel >= 1.17.10
%endif
# need linker for -Wl,--hash-style=both (>= 2.16.91.0.7-%{mkrel 6})
# need gnu indirect function for multiarch (>= 2.19.51.0.14-1mnb2)
%define binutils_version 2.19.51.0.14-1mnb2
BuildRequires: binutils >= %{binutils_version}
# Old prelink versions breaks the system with glibc 2.11
Conflicts: prelink < 1:0.4.2-1.20091104.1mdv2010.1
@ -137,18 +140,14 @@ BuildRequires: systemtap
BuildRequires: nss-devel
%endif
BuildRequires: autoconf2.5
BuildRequires: cap-devel
BuildRequires: libcap-devel
BuildRequires: rpm-mandriva-setup-build >= 1.133
BuildRequires: rpm >= 1:5.4.4-20
BuildRequires: spec-helper >= 0.31.2
#-----------------------------------------------------------------------
# from fedora glibc.spec
#
# Patches that are highly unlikely to ever be accepated upstream.
#
# Still needs to be broken down into individual patches
Patch00: glibc-fedora.patch
# Is this still necessary, if so, it needs to go upstream
Patch01: glibc-stap.patch
#-----------------------------------------------------------------------
@ -156,7 +155,7 @@ Patch01: glibc-stap.patch
Patch02: glibc-2.11.1-localedef-archive-follow-symlinks.patch
Patch03: glibc-2.15-fix-dns-with-broken-routers.patch
Patch04: glibc-2.14.90-nss-upgrade.patch
Patch05: glibc-2.16.0-share-locale.patch
Patch05: glibc-2.9-share-locale.patch
Patch06: glibc-2.3.6-nsswitch.conf.patch
Patch07: glibc-2.2.4-xterm-xvt.patch
Patch08: glibc-2.3.3-nscd-enable.patch
@ -167,12 +166,12 @@ Patch12: glibc-2.3.4-timezone.patch
Patch13: glibc-2.10.1-biarch-cpp-defines.patch
Patch14: glibc-2.8-ENOTTY-fr-translation.patch
Patch15: glibc-2.3.5-biarch-utils.patch
Patch16: glibc-2.16.0-multiarch.patch
Patch17: glibc-2.16.0-i586-hptiming.patch
Patch16: glibc-2.15-multiarch.patch
Patch17: glibc-2.4.90-i586-hptiming.patch
Patch18: glibc-2.3.4-i586-if-no-cmov.patch
Patch19: glibc-2.3.6-pt_BR-i18nfixes.patch
Patch20: glibc-2.4.90-testsuite-ldbl-bits.patch
Patch21: glibc-2.16.0-testsuite-rt-notparallel.patch
Patch21: glibc-2.4.90-testsuite-rt-notparallel.patch
Patch22: glibc-2.13-fix-compile-error.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=638477#c275
@ -185,112 +184,70 @@ Patch23: 0001-x86_64-fix-for-new-memcpy-behavior.patch
Patch24: glibc-2.14.90-revert-fedora-not-installing-stream-headers.patch
Patch25: glibc-no-leaf-attribute.patch
Patch26: glibc-2.16.0-string-format-fixes.patch
Patch26: glibc-2.14-394-g8f3b1ff-string-format-fixes.patch
#-----------------------------------------------------------------------
# from fedora glibc.spec
# Reverting an upstream patch. I don't think this has been discussed
# upstream yet.
Patch27: %{name}-rh769421.patch
# Not likely to be accepted upstream
Patch28: %{name}-rh787201.patch
# Not necessary to send upstream, fedora specific
Patch29: %{name}-rh688948.patch
# Build info files in the source tree, then move to the build
# tree so that they're identical for multilib builds
Patch30: %{name}-rh825061.patch
# stap, needs to be sent upstream
Patch31: %{name}-rh179072.patch
# Uli wants to see this undergo more analyis (what happens when thread B calls into malloc when
# thread A has unlocked on the error path
# There's an alternate approach using mmap after detecting an error that needs discussion
Patch27: glibc-rh757881.patch
# From upstream.
Patch28: glibc-rh740506.patch
# Not sure of upstream status
Patch29: glibc-rh730856.patch
# Follow-on to 552960's original patch to avoid losing wakeups
Patch30: glibc-rh552960-2.patch
Patch31: glibc-rh729661.patch
Patch32: glibc-rh446078.patch
Patch33: glibc-rh454629.patch
Patch34: glibc-rh784402.patch
Patch35: glibc-rh622499.patch
# Depends on systemtap infrastructure, so can't go upstream
Patch36: glibc-rh179072.patch
Patch37: glibc-rh697421.patch
Patch38: glibc-rh740682.patch
Patch39: glibc-sw13618.patch
# Fix bogus sorting code which was copied from dl-deps.
Patch40: glibc-sw13618-2.patch
Patch41: glibc-rh783979.patch
# Needs to go upstream
Patch42: glibc-rh657588.patch
Patch43: glibc-rh787201.patch
# Sent upstream, awaiting feedback
Patch44: glibc-rh741105.patch
# Sent upstream, awaiting feedback
Patch45: glibc-rh770869.patch
# Sent upstream, awaiting feedback
Patch46: glibc-rh691912.patch
# Not necessary to send upstream
Patch47: glibc-rh688948.patch
# Rakesh & Pravin will send upstream
Patch48: glibc-rh770439.patch
# Sent upstream
Patch49: glibc-rh789209.patch
# Was acked in the upstream BZ, but patch never got installed
Patch50: glibc-rh624296.patch
# Needs to be sent upstream
Patch32: %{name}-rh697421.patch
# Needs to be sent upstream
Patch33: %{name}-2.16.0-rh740682.patch
# Needs to be sent upstream
Patch34: %{name}-rh657588.patch
# Needs to be sent upstream
Patch35: %{name}-rh564528.patch
# stap, needs to be sent upstream
Patch36: %{name}-stap-libm.patch
#
# Patches submitted, but not yet approved upstream.
# Each should be associated with a BZ.
# Obviously we're not there right now, but that's the goal
#
Patch37: %{name}-rh757881.patch
# Upstream BZ 13013
Patch38: %{name}-rh730856.patch
Patch39: %{name}-rh741105.patch
Patch40: %{name}-rh770869.patch
Patch41: %{name}-rh770439.patch
Patch42: %{name}-rh789209.patch
Patch43: %{name}-rh691912.patch
# Upstream BZ 13604
Patch44: %{name}-rh790292.patch
# Upstream BZ 13603
Patch45: %{name}-rh790298.patch
# Upstream BZ 13698
Patch46: %{name}-rh791161.patch
# Upstream BZ 12377
#Patch47: %{name}-rh697149.patch
# Upstream BZ 9954
Patch48: %{name}-rh739743.patch
# Upstream BZ 13939
Patch49: %{name}-rh789238.patch
#Upstream BZ 13818
Patch50: %{name}-rh800224.patch
# Upstream BZ 14247
Patch51: %{name}-rh827510.patch
Patch52: %{name}-rh803286.patch
# Upstream BZ 13939
Patch53: %{name}-rh789238-2.patch
# Upstream BZ 13761
Patch54: %{name}-rh788989-2.patch
# Upstream BZ 13027
Patch55: %{name}-rh804630.patch
# Upstream BZ 14185
Patch56: %{name}-rh819430.patch
# See http://sourceware.org/ml/libc-alpha/2012-06/msg00074.html
Patch57: %{name}-rh767693-2.patch
Patch51: glibc-rh564528.patch
#-----------------------------------------------------------------------
# mandriva patches
Patch58: glibc-2.10.1-mdv-avx-owl-crypt.patch
Patch59: glibc-2.10.1-mdv-owl-crypt_freesec.patch
Patch52: glibc-2.10.1-mdv-avx-owl-crypt.patch
Patch53: glibc-2.10.1-mdv-owl-crypt_freesec.patch
Patch60: glibc-2.16.0-avx-relocate_fcrypt.patch
Patch61: glibc-2.16.0-avx-increase_BF_FRAME.patch
Patch62: glibc-2.16.0-mdv-wrapper_handle_sha.patch
Patch54: glibc-2.9-avx-relocate_fcrypt.patch
Patch55: glibc-2.3.6-avx-increase_BF_FRAME.patch
Patch56: glibc-2.7-mdv-wrapper_handle_sha.patch
# Requires to link thumb mode build
Patch63: glibc-2.14-arm-thumb.patch
Patch57: glibc-2.14-arm-thumb.patch
# FIXME this patch is hackish but corrects the problem for me
# in upstream bugreport, what others apparently did was to
# revert 3a2c02424d9824f5cdea4ebd32ff929b2b1f49c6
# http://sourceware.org/bugzilla/show_bug.cgi?id=13594
Patch58: glibc-2.15-chromium-browser-crash.patch
# Determine minimum kernel versions (rhbz#619538)
%define enablekernel 2.6.32
@ -344,7 +301,7 @@ Linux system will not function.
%exclude %{_prefix}/libexec/getconf/XBS5_ILP32_OFF32
%exclude %{_prefix}/libexec/getconf/XBS5_ILP32_OFFBIG
%endif
%{_slibdir}/ld-%{api}.so
%{_slibdir}/ld-%{version}.so
%ifarch %{ix86}
%{_slibdir}/ld-linux.so.2
%{_slibdir}/i686
@ -413,7 +370,7 @@ library and the standard math library. Without these two libraries, a
Linux system will not function.
%files -n %{multilibc}
%{_slibdir32}/ld-%{api}.so
%{_slibdir32}/ld-%{version}.so
%{_slibdir32}/ld-linux*.so.2
%{_slibdir32}/lib*-[.0-9]*.so
%{_slibdir32}/lib*.so.[0-9]*
@ -437,6 +394,10 @@ Linux system will not function.
%package devel
Summary: Header and object files for development using standard C libraries
Group: Development/C
Requires(post): info-install
Requires(preun):info-install
Requires(post): coreutils
Requires(postun):coreutils, awk
Requires: %{name} = %{EVRD}
%if %{build_multiarch}
Requires: %{multilibc} = %{EVRD}
@ -456,6 +417,12 @@ will use the standard C libraries, your system needs to have these
standard header and object files available in order to create the
executables.
%post devel
%_install_info libc.info
%preun devel
%_remove_install_info libc.info
%files devel
%{_mandir}/man3/*
%{_infodir}/libc.info*
@ -665,7 +632,7 @@ These are configuration files that describe possible time zones.
%patch19 -p1
%patch20 -p1
%patch21 -p1
#patch22 -p0
%patch22 -p0
%patch23 -p1
%patch24 -p1
%patch25 -p1
@ -674,7 +641,7 @@ These are configuration files that describe possible time zones.
%patch28 -p1
%patch29 -p1
%patch30 -p1
#patch31 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
@ -690,32 +657,25 @@ These are configuration files that describe possible time zones.
%patch44 -p1
%patch45 -p1
%patch46 -p1
#patch47 -p1
%patch47 -p1
%patch48 -p1
%patch49 -p1
%patch50 -p1
%patch51 -p1
%patch52 -p1
%patch53 -p1
%patch54 -p1
%patch55 -p1
%patch56 -p1
%patch57 -p1
# FIXME: owl patches are incompatible with glibc-2.16
# copy freesec source
#cp %{SOURCE52} %{SOURCE53} crypt/
#echo "Applying crypt_blowfish patch:"
#patch58 -p1
#mv crypt/crypt.h crypt/gnu-crypt.h
#cp -a crypt_blowfish-%{crypt_bf_ver}/*.[chS] crypt/
cp %{SOURCE52} %{SOURCE53} crypt/
echo "Applying crypt_blowfish patch:"
%patch52 -p1
mv crypt/crypt.h crypt/gnu-crypt.h
cp -a crypt_blowfish-%{crypt_bf_ver}/*.[chS] crypt/
## FreeSec support for extended/new-style/BSDI hashes in crypt(3)
#patch59 -p1
#patch60 -p1
#patch61 -p1
%patch53 -p1
%patch54 -p1
%patch55 -p0
# add sha256-crypt and sha512-crypt support to the Openwall wrapper
#patch62 -p0
%patch56 -p1
%if %{build_selinux}
# XXX kludge to build nscd with selinux support as it added -nostdinc
@ -725,9 +685,11 @@ These are configuration files that describe possible time zones.
%if %{build_ports}
mv %{glibcportsdir} ports
%patch63 -p1
%patch57 -p1
%endif
%patch58 -p1
find . -type f -size 0 -o -name "*.orig" -exec rm -f {} \;
# Remove patch backups from files we ship in glibc packages
@ -1053,14 +1015,14 @@ rm -rf %{buildroot}%{_includedir}/netatalk/
install -m 755 -d %{buildroot}%{_docdir}/glibc
%if %{with doc}
make -C build-%{_target_cpu}-linux html
cp -fpar build-%{product_arch}-linux/manual/libc %{buildroot}%{_docdir}/glibc/html
cp -fpar manual/libc %{buildroot}%{_docdir}/glibc/html
%endif
%if %{with pdf}
make -C build-%{_target_cpu}-linux pdf
install -m644 -D build-%{product_arch}-linux/manual/libc.pdf %{buildroot}%{_docdir}/glibc/libc.pdf
install -m644 -D manual/libc.pdf %{buildroot}%{_docdir}/glibc/libc.pdf
%endif
install -m 644 COPYING COPYING.LIB README NEWS INSTALL BUGS \
PROJECTS CONFORMANCE hesiod/README.hesiod LICENSES \
install -m 644 COPYING COPYING.LIB README NEWS INSTALL FAQ BUGS \
NOTES PROJECTS CONFORMANCE README.libm hesiod/README.hesiod \
ChangeLog* crypt/README.ufc-crypt nis/nss posix/gai.conf \
%{buildroot}%{_docdir}/glibc
xz -0 --text %{buildroot}%{_docdir}/glibc/ChangeLog*
@ -1114,4 +1076,10 @@ rm -f %{buildroot}%{_infodir}/dir
# This will make the '-g' argument to be passed to eu-strip for these libraries, so that
# some info is kept that's required to make valgrind work without depending on glibc-debug
# package to be installed.
export EXCLUDE_FROM_FULL_STRIP="ld-%{api}.so libpthread libc-%{api}.so libm-%{api}.so"
export EXCLUDE_FROM_FULL_STRIP="ld-%{version}.so libpthread libc-%{version}.so libm-%{version}.so"
%changelog
* Thu May 24 2012 Paulo Andrade <pcpa@mandriva.com.br> 6:2.15-3
+ Revision: 800481
- Correct typo in libc6 post.