This commit is contained in:
Jakub Jelinek 2008-07-08 16:46:35 +00:00
parent 98034c49e9
commit 456c7dc140
18 changed files with 10679 additions and 1 deletions

27
glibc-bz3406.patch Normal file
View File

@ -0,0 +1,27 @@
2008-02-11 Joseph Myers <joseph@codesourcery.com>
[BZ #3406]
* sysdeps/ieee754/flt-32/w_expf.c (o_threshold): Correct value.
* math/libm-test.inc (exp_test): Test 88.72269439697265625.
--- libc/math/libm-test.inc 11 Apr 2008 19:32:30 -0000 1.79
+++ libc/math/libm-test.inc 22 May 2008 19:59:10 -0000 1.81
@@ -2510,6 +2510,7 @@ exp_test (void)
TEST_f_f (exp, 3, M_E3l);
TEST_f_f (exp, 0.75L, 2.11700001661267466854536981983709561L);
TEST_f_f (exp, 50.0L, 5184705528587072464087.45332293348538L);
+ TEST_f_f (exp, 88.72269439697265625L, 3.40233126623160774937554134772290447915e38L);
#ifdef TEST_LDOUBLE
/* The result can only be represented in long double. */
TEST_f_f (exp, 1000.0L, 0.197007111401704699388887935224332313e435L);
--- libc/sysdeps/ieee754/flt-32/w_expf.c 14 Jul 1999 00:03:46 -0000 1.1
+++ libc/sysdeps/ieee754/flt-32/w_expf.c 11 May 2008 17:49:19 -0000 1.2
@@ -29,7 +29,7 @@ static const float
#else
static float
#endif
-o_threshold= 8.8721679688e+01, /* 0x42b17180 */
+o_threshold= 8.8722831726e+01, /* 0x42b17217 */
u_threshold= -1.0397208405e+02; /* 0xc2cff1b5 */
#ifdef __STDC__

39
glibc-bz6461.patch Normal file
View File

@ -0,0 +1,39 @@
2008-05-14 Ulrich Drepper <drepper@redhat.com>
[BZ #6461]
* iconv/gconv_simple.c (BODY for __gconv_transform_ascii_internal):
Add missing braces.
(BODY for __gconv_transform_internal_ascii): Likewise.
--- libc/iconv/gconv_simple.c 12 Oct 2007 04:40:33 -0000 1.67
+++ libc/iconv/gconv_simple.c 14 May 2008 22:52:44 -0000 1.68
@@ -820,9 +820,11 @@ ucs4le_internal_loop_single (struct __gc
STANDARD_FROM_LOOP_ERR_HANDLER (1); \
} \
else \
- /* It's an one byte sequence. */ \
- *((uint32_t *) outptr) = *inptr++; \
- outptr += sizeof (uint32_t); \
+ { \
+ /* It's an one byte sequence. */ \
+ *((uint32_t *) outptr) = *inptr++; \
+ outptr += sizeof (uint32_t); \
+ } \
}
#define LOOP_NEED_FLAGS
#include <iconv/loop.c>
@@ -851,9 +853,11 @@ ucs4le_internal_loop_single (struct __gc
STANDARD_TO_LOOP_ERR_HANDLER (4); \
} \
else \
- /* It's an one byte sequence. */ \
- *outptr++ = *((const uint32_t *) inptr); \
- inptr += sizeof (uint32_t); \
+ { \
+ /* It's an one byte sequence. */ \
+ *outptr++ = *((const uint32_t *) inptr); \
+ inptr += sizeof (uint32_t); \
+ } \
}
#define LOOP_NEED_FLAGS
#include <iconv/loop.c>

48
glibc-bz6472.patch Normal file
View File

@ -0,0 +1,48 @@
2008-05-14 Ulrich Drepper <drepper@redhat.com>
[BZ #6472]
* sysdeps/posix/getaddrinfo.c (get_scope): Loopback addresses have
to be treated like link-local addresses.
(match_prefix): Don't treat IPv4 loopback address special when
converting to v4 mapped addressed.
--- libc/sysdeps/posix/getaddrinfo.c 14 May 2008 21:53:40 -0000 1.129
+++ libc/sysdeps/posix/getaddrinfo.c 14 May 2008 22:46:55 -0000 1.131
@@ -1112,7 +1112,10 @@ get_scope (const struct sockaddr_in6 *in
{
if (! IN6_IS_ADDR_MULTICAST (&in6->sin6_addr))
{
- if (IN6_IS_ADDR_LINKLOCAL (&in6->sin6_addr))
+ if (IN6_IS_ADDR_LINKLOCAL (&in6->sin6_addr)
+ /* RFC 4291 2.5.3 says that the loopback address is to be
+ treated like a link-local address. */
+ || IN6_IS_ADDR_LOOPBACK (&in6->sin6_addr))
scope = 2;
else if (IN6_IS_ADDR_SITELOCAL (&in6->sin6_addr))
scope = 5;
@@ -1245,20 +1248,14 @@ match_prefix (const struct sockaddr_in6
{
const struct sockaddr_in *in = (const struct sockaddr_in *) in6;
- /* Convert to IPv6 address. */
+ /* Construct a V4-to-6 mapped address. */
in6_mem.sin6_family = PF_INET6;
in6_mem.sin6_port = in->sin_port;
in6_mem.sin6_flowinfo = 0;
- if (in->sin_addr.s_addr == htonl (0x7f000001))
- in6_mem.sin6_addr = (struct in6_addr) IN6ADDR_LOOPBACK_INIT;
- else
- {
- /* Construct a V4-to-6 mapped address. */
- memset (&in6_mem.sin6_addr, '\0', sizeof (in6_mem.sin6_addr));
- in6_mem.sin6_addr.s6_addr16[5] = 0xffff;
- in6_mem.sin6_addr.s6_addr32[3] = in->sin_addr.s_addr;
- in6_mem.sin6_scope_id = 0;
- }
+ memset (&in6_mem.sin6_addr, '\0', sizeof (in6_mem.sin6_addr));
+ in6_mem.sin6_addr.s6_addr16[5] = 0xffff;
+ in6_mem.sin6_addr.s6_addr32[3] = in->sin_addr.s_addr;
+ in6_mem.sin6_scope_id = 0;
in6 = &in6_mem;
}

101
glibc-bz6612.patch Normal file
View File

@ -0,0 +1,101 @@
2008-06-12 Ulrich Drepper <drepper@redhat.com>
* time/strftime.c: Pass reference to tzset_called around to handle
recursive calls.
[BZ #6612]
* time/strftime.c (__strftime_internal): Call tzset() only
when printing timezone-dependent values.
Based on a patch by Petr Baudis <pasky@suse.cz>.
--- libc/time/strftime_l.c 16 Oct 2007 22:50:20 -0000 1.4
+++ libc/time/strftime_l.c 13 Jun 2008 06:08:31 -0000 1.5
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2004, 2007, 2008 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
@@ -455,7 +455,8 @@ static CHAR_T const month_name[][10] =
#endif
static size_t __strftime_internal (CHAR_T *, size_t, const CHAR_T *,
- const struct tm *, bool ut_argument_spec_iso
+ const struct tm *, bool *
+ ut_argument_spec_iso
LOCALE_PARAM_PROTO) __THROW;
/* Write information from TP into S according to the format
@@ -481,7 +482,8 @@ my_strftime (s, maxsize, format, tp ut_a
tmcopy = *tp;
tp = &tmcopy;
#endif
- return __strftime_internal (s, maxsize, format, tp, false
+ bool tzset_called = false;
+ return __strftime_internal (s, maxsize, format, tp, &tzset_called
ut_argument LOCALE_ARG);
}
#ifdef _LIBC
@@ -495,7 +497,7 @@ __strftime_internal (s, maxsize, format,
size_t maxsize;
const CHAR_T *format;
const struct tm *tp;
- bool tzset_called;
+ bool *tzset_called;
ut_argument_spec
LOCALE_PARAM_DECL
{
@@ -563,16 +565,6 @@ __strftime_internal (s, maxsize, format,
if (! (zone && *zone))
zone = "GMT";
}
- else
- {
- /* POSIX.1 requires that local time zone information is used as
- though strftime called tzset. */
-# if HAVE_TZSET
- if (!tzset_called)
- tzset ();
- tzset_called = true;
-# endif
- }
#endif
if (hour12 > 12)
@@ -1325,7 +1317,18 @@ __strftime_internal (s, maxsize, format,
#if HAVE_TZNAME
/* The tzset() call might have changed the value. */
if (!(zone && *zone) && tp->tm_isdst >= 0)
- zone = tzname[tp->tm_isdst];
+ {
+ /* POSIX.1 requires that local time zone information is used as
+ though strftime called tzset. */
+# if HAVE_TZSET
+ if (!*tzset_called)
+ {
+ tzset ();
+ *tzset_called = true;
+ }
+# endif
+ zone = tzname[tp->tm_isdst];
+ }
#endif
if (! zone)
zone = "";
@@ -1361,6 +1364,16 @@ __strftime_internal (s, maxsize, format,
struct tm ltm;
time_t lt;
+ /* POSIX.1 requires that local time zone information is used as
+ though strftime called tzset. */
+# if HAVE_TZSET
+ if (!*tzset_called)
+ {
+ tzset ();
+ *tzset_called = true;
+ }
+# endif
+
ltm = *tp;
lt = mktime (&ltm);

85
glibc-bz6657.patch Normal file
View File

@ -0,0 +1,85 @@
2008-06-27 Ulrich Drepper <drepper@redhat.com>
[BZ #6657]
* time/strptime_l.c: Don't clear s.era_cnt after successful match
of %EY.
Patch by Petr Baudis.
localedata/
2008-06-27 Ulrich Drepper <drepper@redhat.com>
* tst-strptime.c (do_test): Add test of %EY.
2008-06-25 Ulrich Drepper <drepper@redhat.com>
* tst-strptime.c (do_test): Add test for parsing era year
representation.
--- libc/time/strptime_l.c 28 Jul 2007 19:10:08 -0000 1.12
+++ libc/time/strptime_l.c 27 Jun 2008 21:36:13 -0000 1.13
@@ -951,7 +942,6 @@ __strptime_internal (rp, fmt, tmp, state
else
{
s.decided = loc;
- s.era_cnt = -1;
break;
}
--- libc/localedata/tst-strptime.c 1 Aug 2007 03:42:25 -0000 1.2
+++ libc/localedata/tst-strptime.c 27 Jun 2008 17:21:24 -0000 1.5
@@ -1,22 +1,53 @@
#include <locale.h>
#include <time.h>
#include <stdio.h>
+#include <string.h>
static int
do_test (void)
{
+ int result = 0;
+
if (setlocale (LC_ALL, "vi_VN.TCVN5712-1") == NULL)
{
puts ("cannot set locale");
return 1;
}
struct tm tm;
+ memset (&tm, '\0', sizeof (tm));
/* This is November in Vietnamese encoded using TCVN5712-1. */
static const char s[] = "\
-\x54\x68\xb8\x6e\x67\x20\x6d\xad\xea\x69\x20\x6d\xe9\x74";
+\x54\x68\xb8\x6e\x67\x20\x6d\xad\xea\x69\x20\x6d\xe9\x74\0";
char *r = strptime (s, "%b", &tm);
printf ("r = %p, r-s = %tu, tm.tm_mon = %d\n", r, r - s, tm.tm_mon);
- return r == NULL || r - s != 14 || tm.tm_mon != 10;
+ result = r == NULL || r - s != 14 || tm.tm_mon != 10;
+
+ if (setlocale (LC_ALL, "ja_JP.UTF-8") == NULL)
+ {
+ puts ("cannot set locale");
+ return 1;
+ }
+ static const char s2[] = "\
+\x32\x35\x20\x30\x36\x20\xe5\xb9\xb3\xe6\x88\x90\x32\x30\0";
+ memset (&tm, '\0', sizeof (tm));
+ r = strptime (s2, "%d %m %EC%Ey", &tm);
+ printf ("\
+r = %p, r-s2 = %tu, tm.tm_mday = %d, tm.tm_mon = %d, tm.tm_year = %d\n",
+ r, r - s2, tm.tm_mday, tm.tm_mon, tm.tm_year);
+ result |= (r == NULL || r - s2 != 14 || tm.tm_mday != 25 || tm.tm_mon != 5
+ || tm.tm_year != 108);
+
+ static const char s3[] = "\
+\x32\x35\x20\x30\x36\x20\xe5\xb9\xb3\xe6\x88\x90\x32\x30\xe5\xb9\xb4\0";
+ memset (&tm, '\0', sizeof (tm));
+ r = strptime (s3, "%d %m %EY", &tm);
+ printf ("\
+r = %p, r-s3 = %tu, tm.tm_mday = %d, tm.tm_mon = %d, tm.tm_year = %d\n",
+ r, r - s3, tm.tm_mday, tm.tm_mon, tm.tm_year);
+ result |= (r == NULL || r - s3 != 17 || tm.tm_mday != 25 || tm.tm_mon != 5
+ || tm.tm_year != 108);
+
+ return result;
}
#define TEST_FUNCTION do_test ()

68
glibc-bz6719.patch Normal file
View File

@ -0,0 +1,68 @@
2008-07-08 Ulrich Drepper <drepper@redhat.com>
* stdio-common/Makefile: Add rules to build and run tst-setvbuf1.
* stdio-common/tst-setvbuf1.c: New file.
* stdio-common/tst-setvbuf1.expect: New file.
[BZ #6719]
* libio/iosetvbuf.c (_IO_setvbuf): Correctly clear buffering flags
when selecting fully-buffered stream.
Patch by Wang Xin <wxinee@gmail.com>.
--- libc/libio/iosetvbuf.c 29 Aug 2003 19:58:27 -0000 1.20
+++ libc/libio/iosetvbuf.c 8 Jul 2008 16:20:32 -0000 1.21
@@ -45,7 +45,7 @@ _IO_setvbuf (fp, buf, mode, size)
switch (mode)
{
case _IOFBF:
- fp->_IO_file_flags &= ~_IO_LINE_BUF|_IO_UNBUFFERED;
+ fp->_IO_file_flags &= ~(_IO_LINE_BUF|_IO_UNBUFFERED);
if (buf == NULL)
{
if (fp->_IO_buf_base == NULL)
--- libc/stdio-common/Makefile 24 May 2008 18:14:36 -0000 1.112
+++ libc/stdio-common/Makefile 8 Jul 2008 16:32:28 -0000 1.113
@@ -58,7 +58,7 @@ tests := tstscanf test_rdwr test-popen t
tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \
tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \
bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \
- scanf16 scanf17
+ scanf16 scanf17 tst-setvbuf1
test-srcs = tst-unbputc tst-printf
@@ -130,3 +130,7 @@ bug15-ENV = LOCPATH=$(common-objpfx)loca
ifneq (,$(filter %REENTRANT, $(defines)))
CPPFLAGS += -D_IO_MTSAFE_IO
endif
+
+$(objpfx)tst-setvbuf1.out: tst-setvbuf1.expect $(objpfx)tst-setvbuf1
+ $(built-program-cmd) > $@ 2>&1
+ cmp tst-setvbuf1.expect $@
--- libc/stdio-common/tst-setvbuf1.c 1 Jan 1970 00:00:00 -0000
+++ libc/stdio-common/tst-setvbuf1.c 8 Jul 2008 16:32:02 -0000 1.1
@@ -0,0 +1,19 @@
+#include <stdio.h>
+
+static int
+do_test (void)
+{
+ if (setvbuf (stderr, NULL, _IOFBF, BUFSIZ) != 0)
+ {
+ puts ("Set full buffer error.");
+ return 1;
+ }
+
+ fprintf (stderr, "Output #1 <stderr>.\n");
+ printf ("Output #2 <stdout>.\n");
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
--- libc/stdio-common/tst-setvbuf1.expect 1 Jan 1970 00:00:00 -0000
+++ libc/stdio-common/tst-setvbuf1.expect 8 Jul 2008 16:32:14 -0000 1.1
@@ -0,0 +1,2 @@
+Output #2 <stdout>.
+Output #1 <stderr>.

18
glibc-bz6723.patch Normal file
View File

@ -0,0 +1,18 @@
2008-07-06 Ulrich Drepper <drepper@redhat.com>
[BZ #6723]
* time/mktime.c (__mktime_internal): Normalize tp->tm_isdst value.
--- libc/time/mktime.c 12 Dec 2007 18:21:29 -0000 1.68
+++ libc/time/mktime.c 6 Jul 2008 21:17:58 -0000 1.69
@@ -293,7 +293,9 @@ __mktime_internal (struct tm *tp,
int mday = tp->tm_mday;
int mon = tp->tm_mon;
int year_requested = tp->tm_year;
- int isdst = tp->tm_isdst;
+ /* Normalize the value. */
+ int isdst = ((tp->tm_isdst >> (8 * sizeof (tp->tm_isdst) - 1))
+ | (tp->tm_isdst != 0));
/* 1 if the previous probe was DST. */
int dst2;

441
glibc-c99-scanf.patch Normal file
View File

@ -0,0 +1,441 @@
2008-05-24 Jakub Jelinek <jakub@redhat.com>
* libio/stdio.h (vscanf): Fix -std=c99 redirect.
* stdio-common/Makefile (tests): Add scanf16 and scanf17.
(CFLAGS-scanf17.c): New.
* stdio-common/scanf14.c (main): Add fscanf and scanf tests.
* stdio-common/scanf15.c (main): Likewise.
* stdio-common/scanf16.c: New file.
* stdio-common/scanf17.c: New file.
--- libc/libio/stdio.h 8 Jan 2008 01:18:40 -0000 1.92
+++ libc/libio/stdio.h 24 May 2008 18:14:36 -0000 1.93
@@ -475,7 +475,7 @@ extern int __REDIRECT (vfscanf,
__isoc99_vfscanf)
__attribute__ ((__format__ (__scanf__, 2, 0))) __wur;
extern int __REDIRECT (vscanf, (__const char *__restrict __format,
- _G_va_list __arg), __isoc99_vfscanf)
+ _G_va_list __arg), __isoc99_vscanf)
__attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
extern int __REDIRECT (vsscanf,
(__const char *__restrict __s,
--- libc/stdio-common/Makefile 10 Dec 2007 01:43:13 -0000 1.111
+++ libc/stdio-common/Makefile 24 May 2008 18:14:36 -0000 1.112
@@ -57,7 +57,8 @@ tests := tstscanf test_rdwr test-popen t
tst-perror tst-sprintf tst-rndseek tst-fdopen tst-fphex bug14 bug15 \
tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \
tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \
- bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22
+ bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \
+ scanf16 scanf17
test-srcs = tst-unbputc tst-printf
@@ -109,11 +110,13 @@ CFLAGS-isoc99_scanf.c += $(exceptions)
CFLAGS-errlist.c = $(fno-unit-at-a-time)
CFLAGS-siglist.c = $(fno-unit-at-a-time)
-# The following is a hack since we must compile scanf15.c without any
+# The following is a hack since we must compile scanf1{5,7}.c without any
# GNU extension. The latter are needed, though, when internal headers
# are used. So made sure we see the installed headers first.
CFLAGS-scanf15.c = -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \
-I../wctype
+CFLAGS-scanf17.c = -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \
+ -I../wctype
# We know the test has a format string problem.
CFLAGS-tst-sprintf.c = -Wno-format
--- libc/stdio-common/scanf14.c 18 Sep 2007 17:59:38 -0000 1.1
+++ libc/stdio-common/scanf14.c 24 May 2008 18:14:36 -0000 1.2
@@ -59,5 +59,58 @@ main (void)
else if (d != 5.25 || memcmp (c, " x", 2) != 0)
FAIL ();
+ const char *tmpdir = getenv ("TMPDIR");
+ if (tmpdir == NULL || tmpdir[0] == '\0')
+ tmpdir = "/tmp";
+
+ char fname[strlen (tmpdir) + sizeof "/tst-scanf14.XXXXXX"];
+ sprintf (fname, "%s/tst-scanf14.XXXXXX", tmpdir);
+ if (fname == NULL)
+ FAIL ();
+
+ /* Create a temporary file. */
+ int fd = mkstemp (fname);
+ if (fd == -1)
+ FAIL ();
+
+ FILE *fp = fdopen (fd, "w+");
+ if (fp == NULL)
+ FAIL ();
+ else
+ {
+ if (fputs (" 1.25s x", fp) == EOF)
+ FAIL ();
+ if (fseek (fp, 0, SEEK_SET) != 0)
+ FAIL ();
+ if (fscanf (fp, "%as%2c", &sp, c) != 2)
+ FAIL ();
+ else
+ {
+ if (strcmp (sp, "1.25s") != 0 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+ memset (sp, 'x', sizeof "1.25s");
+ free (sp);
+ }
+
+ if (freopen (fname, "r", stdin) == NULL)
+ FAIL ();
+ else
+ {
+ if (scanf ("%as%2c", &sp, c) != 2)
+ FAIL ();
+ else
+ {
+ if (strcmp (sp, "1.25s") != 0 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+ memset (sp, 'x', sizeof "1.25s");
+ free (sp);
+ }
+ }
+
+ fclose (fp);
+ }
+
+ remove (fname);
+
return result;
}
--- libc/stdio-common/scanf15.c 18 Sep 2007 17:59:38 -0000 1.1
+++ libc/stdio-common/scanf15.c 24 May 2008 18:14:36 -0000 1.2
@@ -50,5 +50,48 @@ main (void)
else if (d != 5.25 || memcmp (c, " x", 2) != 0)
FAIL ();
+ const char *tmpdir = getenv ("TMPDIR");
+ if (tmpdir == NULL || tmpdir[0] == '\0')
+ tmpdir = "/tmp";
+
+ char fname[strlen (tmpdir) + sizeof "/tst-scanf15.XXXXXX"];
+ sprintf (fname, "%s/tst-scanf15.XXXXXX", tmpdir);
+ if (fname == NULL)
+ FAIL ();
+
+ /* Create a temporary file. */
+ int fd = mkstemp (fname);
+ if (fd == -1)
+ FAIL ();
+
+ FILE *fp = fdopen (fd, "w+");
+ if (fp == NULL)
+ FAIL ();
+ else
+ {
+ if (fputs (" 1.25s x", fp) == EOF)
+ FAIL ();
+ if (fseek (fp, 0, SEEK_SET) != 0)
+ FAIL ();
+ if (fscanf (fp, "%as%2c", &f, c) != 2)
+ FAIL ();
+ else if (f != 1.25 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+
+ if (freopen (fname, "r", stdin) == NULL)
+ FAIL ();
+ else
+ {
+ if (scanf ("%as%2c", &f, c) != 2)
+ FAIL ();
+ else if (f != 1.25 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+ }
+
+ fclose (fp);
+ }
+
+ remove (fname);
+
return result;
}
--- libc/stdio-common/scanf16.c 1 Jan 1970 00:00:00 -0000
+++ libc/stdio-common/scanf16.c 24 May 2008 18:14:36 -0000 1.1
@@ -0,0 +1,147 @@
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+
+#define FAIL() \
+ do { \
+ result = 1; \
+ printf ("test at line %d failed\n", __LINE__); \
+ } while (0)
+
+static int
+xsscanf (const char *str, const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ int ret = vsscanf (str, fmt, ap);
+ va_end (ap);
+ return ret;
+}
+
+static int
+xscanf (const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ int ret = vscanf (fmt, ap);
+ va_end (ap);
+ return ret;
+}
+
+static int
+xfscanf (FILE *f, const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ int ret = vfscanf (f, fmt, ap);
+ va_end (ap);
+ return ret;
+}
+
+int
+main (void)
+{
+ wchar_t *lsp;
+ char *sp;
+ float f;
+ double d;
+ char c[8];
+ int result = 0;
+
+ if (xsscanf (" 0.25s x", "%e%3c", &f, c) != 2)
+ FAIL ();
+ else if (f != 0.25 || memcmp (c, "s x", 3) != 0)
+ FAIL ();
+ if (xsscanf (" 1.25s x", "%as%2c", &sp, c) != 2)
+ FAIL ();
+ else
+ {
+ if (strcmp (sp, "1.25s") != 0 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+ memset (sp, 'x', sizeof "1.25s");
+ free (sp);
+ }
+ if (xsscanf (" 2.25s x", "%las%2c", &d, c) != 2)
+ FAIL ();
+ else if (d != 2.25 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+ if (xsscanf (" 3.25S x", "%4aS%3c", &lsp, c) != 2)
+ FAIL ();
+ else
+ {
+ if (wcscmp (lsp, L"3.25") != 0 || memcmp (c, "S x", 3) != 0)
+ FAIL ();
+ memset (lsp, 'x', sizeof L"3.25");
+ free (lsp);
+ }
+ if (xsscanf ("4.25[0-9.] x", "%a[0-9.]%8c", &sp, c) != 2)
+ FAIL ();
+ else
+ {
+ if (strcmp (sp, "4.25") != 0 || memcmp (c, "[0-9.] x", 8) != 0)
+ FAIL ();
+ memset (sp, 'x', sizeof "4.25");
+ free (sp);
+ }
+ if (xsscanf ("5.25[0-9.] x", "%la[0-9.]%2c", &d, c) != 2)
+ FAIL ();
+ else if (d != 5.25 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+
+ const char *tmpdir = getenv ("TMPDIR");
+ if (tmpdir == NULL || tmpdir[0] == '\0')
+ tmpdir = "/tmp";
+
+ char fname[strlen (tmpdir) + sizeof "/tst-scanf16.XXXXXX"];
+ sprintf (fname, "%s/tst-scanf16.XXXXXX", tmpdir);
+ if (fname == NULL)
+ FAIL ();
+
+ /* Create a temporary file. */
+ int fd = mkstemp (fname);
+ if (fd == -1)
+ FAIL ();
+
+ FILE *fp = fdopen (fd, "w+");
+ if (fp == NULL)
+ FAIL ();
+ else
+ {
+ if (fputs (" 1.25s x", fp) == EOF)
+ FAIL ();
+ if (fseek (fp, 0, SEEK_SET) != 0)
+ FAIL ();
+ if (xfscanf (fp, "%as%2c", &sp, c) != 2)
+ FAIL ();
+ else
+ {
+ if (strcmp (sp, "1.25s") != 0 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+ memset (sp, 'x', sizeof "1.25s");
+ free (sp);
+ }
+
+ if (freopen (fname, "r", stdin) == NULL)
+ FAIL ();
+ else
+ {
+ if (xscanf ("%as%2c", &sp, c) != 2)
+ FAIL ();
+ else
+ {
+ if (strcmp (sp, "1.25s") != 0 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+ memset (sp, 'x', sizeof "1.25s");
+ free (sp);
+ }
+ }
+
+ fclose (fp);
+ }
+
+ remove (fname);
+
+ return result;
+}
--- libc/stdio-common/scanf17.c 1 Jan 1970 00:00:00 -0000
+++ libc/stdio-common/scanf17.c 24 May 2008 18:14:36 -0000 1.1
@@ -0,0 +1,128 @@
+#undef _GNU_SOURCE
+#define _XOPEN_SOURCE 600
+/* The following macro definitions are a hack. They word around disabling
+ the GNU extension while still using a few internal headers. */
+#define u_char unsigned char
+#define u_short unsigned short
+#define u_int unsigned int
+#define u_long unsigned long
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+
+#define FAIL() \
+ do { \
+ result = 1; \
+ printf ("test at line %d failed\n", __LINE__); \
+ } while (0)
+
+static int
+xsscanf (const char *str, const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ int ret = vsscanf (str, fmt, ap);
+ va_end (ap);
+ return ret;
+}
+
+static int
+xscanf (const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ int ret = vscanf (fmt, ap);
+ va_end (ap);
+ return ret;
+}
+
+static int
+xfscanf (FILE *f, const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ int ret = vfscanf (f, fmt, ap);
+ va_end (ap);
+ return ret;
+}
+
+int
+main (void)
+{
+ float f;
+ double d;
+ char c[8];
+ int result = 0;
+
+ if (xsscanf (" 0.25s x", "%e%3c", &f, c) != 2)
+ FAIL ();
+ else if (f != 0.25 || memcmp (c, "s x", 3) != 0)
+ FAIL ();
+ if (xsscanf (" 1.25s x", "%as%2c", &f, c) != 2)
+ FAIL ();
+ else if (f != 1.25 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+ if (xsscanf (" 2.25s x", "%las%2c", &d, c) != 2)
+ FAIL ();
+ else if (d != 2.25 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+ if (xsscanf (" 3.25S x", "%4aS%2c", &f, c) != 2)
+ FAIL ();
+ else if (f != 3.25 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+ if (xsscanf (" 4.25[0-9.] x", "%a[0-9.]%2c", &f, c) != 2)
+ FAIL ();
+ else if (f != 4.25 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+ if (xsscanf (" 5.25[0-9.] x", "%la[0-9.]%2c", &d, c) != 2)
+ FAIL ();
+ else if (d != 5.25 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+
+ const char *tmpdir = getenv ("TMPDIR");
+ if (tmpdir == NULL || tmpdir[0] == '\0')
+ tmpdir = "/tmp";
+
+ char fname[strlen (tmpdir) + sizeof "/tst-scanf17.XXXXXX"];
+ sprintf (fname, "%s/tst-scanf17.XXXXXX", tmpdir);
+ if (fname == NULL)
+ FAIL ();
+
+ /* Create a temporary file. */
+ int fd = mkstemp (fname);
+ if (fd == -1)
+ FAIL ();
+
+ FILE *fp = fdopen (fd, "w+");
+ if (fp == NULL)
+ FAIL ();
+ else
+ {
+ if (fputs (" 1.25s x", fp) == EOF)
+ FAIL ();
+ if (fseek (fp, 0, SEEK_SET) != 0)
+ FAIL ();
+ if (xfscanf (fp, "%as%2c", &f, c) != 2)
+ FAIL ();
+ else if (f != 1.25 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+
+ if (freopen (fname, "r", stdin) == NULL)
+ FAIL ();
+ else
+ {
+ if (xscanf ("%as%2c", &f, c) != 2)
+ FAIL ();
+ else if (f != 1.25 || memcmp (c, " x", 2) != 0)
+ FAIL ();
+ }
+
+ fclose (fp);
+ }
+
+ remove (fname);
+
+ return result;
+}

7089
glibc-lt-l10n.patch Normal file

File diff suppressed because it is too large Load Diff

1152
glibc-nscd.patch Normal file

File diff suppressed because it is too large Load Diff

147
glibc-res-hconf-init.patch Normal file
View File

@ -0,0 +1,147 @@
2008-06-13 Ulrich Drepper <drepper@redhat.com>
* sysdeps/posix/getaddrinfo.c: Move _res_hconf_init call to a
better place so it is not called when nscd is used.
2008-05-14 Ulrich Drepper <drepper@redhat.com>
* sysdeps/posix/getaddrinfo.c (getaddrinfo): Call _res_hconf_init
if necessary.
* posix/tst-rfc3484.c: Add dummy definition of _res_hconf_init.
* posix/tst-rfc3484-2.c: Likewise.
* posix/tst-rfc3484-3.c: Likewise.
--- libc/sysdeps/posix/getaddrinfo.c 10 May 2008 23:27:32 -0000 1.126
+++ libc/sysdeps/posix/getaddrinfo.c 14 May 2008 22:46:55 -0000 1.131
@@ -61,6 +61,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
#include <not-cancel.h>
#include <nscd/nscd-client.h>
#include <nscd/nscd_proto.h>
+#include <resolv/res_hconf.h>
#ifdef HAVE_LIBIDN
extern int __idna_to_ascii_lz (const char *input, char **output, int flags);
@@ -684,6 +684,9 @@ gaih_inet (const char *name, const struc
"dns [!UNAVAIL=return] files",
&nip);
+ /* Initialize configurations. */
+ if (__builtin_expect (!_res_hconf.initialized, 0))
+ _res_hconf_init ();
if (__res_maybe_init (&_res, 0) == -1)
no_more = 1;
--- libc/posix/tst-rfc3484-2.c 10 Jan 2008 20:00:37 -0000 1.11
+++ libc/posix/tst-rfc3484-2.c 15 May 2008 03:06:05 -0000 1.12
@@ -18,24 +18,35 @@ __check_pf (bool *p1, bool *p2, struct i
*in6ai = NULL;
*in6ailen = 0;
}
+
void
attribute_hidden
__check_native (uint32_t a1_index, int *a1_native,
uint32_t a2_index, int *a2_native)
{
}
+
int
+attribute_hidden
__idna_to_ascii_lz (const char *input, char **output, int flags)
{
return 0;
}
+
int
+attribute_hidden
__idna_to_unicode_lzlz (const char *input, char **output, int flags)
{
*output = NULL;
return 0;
}
+void
+attribute_hidden
+_res_hconf_init (void)
+{
+}
+
#include "../sysdeps/posix/getaddrinfo.c"
service_user *__nss_hosts_database attribute_hidden;
--- libc/posix/tst-rfc3484-3.c 10 Jan 2008 20:00:37 -0000 1.2
+++ libc/posix/tst-rfc3484-3.c 15 May 2008 03:06:05 -0000 1.3
@@ -18,24 +18,35 @@ __check_pf (bool *p1, bool *p2, struct i
*in6ai = NULL;
*in6ailen = 0;
}
+
void
attribute_hidden
__check_native (uint32_t a1_index, int *a1_native,
uint32_t a2_index, int *a2_native)
{
}
+
int
+attribute_hidden
__idna_to_ascii_lz (const char *input, char **output, int flags)
{
return 0;
}
+
int
+attribute_hidden
__idna_to_unicode_lzlz (const char *input, char **output, int flags)
{
*output = NULL;
return 0;
}
+void
+attribute_hidden
+_res_hconf_init (void)
+{
+}
+
#include "../sysdeps/posix/getaddrinfo.c"
service_user *__nss_hosts_database attribute_hidden;
--- libc/posix/tst-rfc3484.c 10 Jan 2008 20:00:37 -0000 1.11
+++ libc/posix/tst-rfc3484.c 15 May 2008 03:06:05 -0000 1.12
@@ -18,24 +18,35 @@ __check_pf (bool *p1, bool *p2, struct i
*in6ai = NULL;
*in6ailen = 0;
}
+
void
attribute_hidden
__check_native (uint32_t a1_index, int *a1_native,
uint32_t a2_index, int *a2_native)
{
}
+
int
+attribute_hidden
__idna_to_ascii_lz (const char *input, char **output, int flags)
{
return 0;
}
+
int
+attribute_hidden
__idna_to_unicode_lzlz (const char *input, char **output, int flags)
{
*output = NULL;
return 0;
}
+void
+attribute_hidden
+_res_hconf_init (void)
+{
+}
+
#include "../sysdeps/posix/getaddrinfo.c"
service_user *__nss_hosts_database attribute_hidden;

41
glibc-rh446406.patch Normal file
View File

@ -0,0 +1,41 @@
2008-06-05 Jakub Jelinek <jakub@redhat.com>
* misc/regexp.h (compile): Use __REPB_PREFIX macro.
Avoid segfault if first GETC returns eof/'\0'/'\n'.
--- libc/misc/regexp.h 19 May 2004 16:52:44 -0000 1.12
+++ libc/misc/regexp.h 6 Jun 2008 19:23:39 -0000 1.13
@@ -129,8 +130,9 @@ compile (char *__restrict instring, char
__expr_ptr = (regex_t *) expbuf;
/* The remaining space in the buffer can be used for the compiled
pattern. */
- __expr_ptr->buffer = expbuf + sizeof (regex_t);
- __expr_ptr->allocated = endbuf - (char *) __expr_ptr->buffer;
+ __expr_ptr->__REPB_PREFIX (buffer) = expbuf + sizeof (regex_t);
+ __expr_ptr->__REPB_PREFIX (allocated)
+ = endbuf - (char *) __expr_ptr->__REPB_PREFIX (buffer);
while ((__ch = (GETC ())) != eof)
{
@@ -162,7 +164,10 @@ compile (char *__restrict instring, char
}
__input_buffer[__current_size++] = __ch;
}
- __input_buffer[__current_size++] = '\0';
+ if (__current_size)
+ __input_buffer[__current_size++] = '\0';
+ else
+ __input_buffer = "";
/* Now compile the pattern. */
__error = regcomp (__expr_ptr, __input_buffer, REG_NEWLINE);
@@ -198,7 +203,8 @@ compile (char *__restrict instring, char
}
/* Everything is ok. */
- RETURN ((char *) (__expr_ptr->buffer + __expr_ptr->used));
+ RETURN ((char *) (__expr_ptr->__REPB_PREFIX (buffer)
+ + __expr_ptr->__REPB_PREFIX (used)));
}
#endif

17
glibc-rh449358.patch Normal file
View File

@ -0,0 +1,17 @@
2008-06-03 Jakub Jelinek <jakub@redhat.com>
* nscd/nscd_getserv_r.c (__nscd_getservbyport_r): Pass cp
instead of portstr to nscd_getserv_r. Patch by
Roman Kagan <rkagan@mail.ru>.
--- libc/nscd/nscd_getserv_r.c 13 Oct 2007 23:04:28 -0000 1.5
+++ libc/nscd/nscd_getserv_r.c 3 Jun 2008 10:22:52 -0000 1.6
@@ -53,7 +53,7 @@ __nscd_getservbyport_r (int port, const
portstr[sizeof (portstr) - 1] = '\0';
char *cp = _itoa_word (port, portstr + sizeof (portstr) - 1, 10, 0);
- return nscd_getserv_r (portstr, portstr + sizeof (portstr) - cp, proto,
+ return nscd_getserv_r (cp, portstr + sizeof (portstr) - cp, proto,
GETSERVBYPORT, result_buf, buf, buflen, result);
}

82
glibc-rh450790.patch Normal file
View File

@ -0,0 +1,82 @@
2008-06-12 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/fpu/s_llround.S (__llround): Avoid using
cr[34] registers.
* sysdeps/powerpc/powerpc64/fpu/s_llroundf.S (__llroundf): Likewise.
* sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S (__llround):
Likewise.
* sysdeps/powerpc/powerpc32/fpu/s_lround.S (__lround): Avoid using cr3
register.
--- libc/sysdeps/powerpc/powerpc32/fpu/s_lround.S 11 Apr 2008 19:30:46 -0000 1.8
+++ libc/sysdeps/powerpc/powerpc32/fpu/s_lround.S 13 Jun 2008 01:18:11 -0000 1.9
@@ -65,10 +65,10 @@ ENTRY (__lround)
fabs fp2, fp1 /* Get the absolute value of x. */
fsub fp12,fp10,fp10 /* Compute 0.0. */
fcmpu cr6, fp2, fp10 /* if |x| < 0.5 */
- fcmpu cr3, fp1, fp12 /* x is negative? x < 0.0 */
+ fcmpu cr7, fp1, fp12 /* x is negative? x < 0.0 */
blt- cr6,.Lretzero
fadd fp3,fp2,fp10 /* |x|+=0.5 bias to prepare to round. */
- bge cr3,.Lconvert /* x is positive so don't negate x. */
+ bge cr7,.Lconvert /* x is positive so don't negate x. */
fnabs fp3,fp3 /* -(|x|+=0.5) */
.Lconvert:
fctiwz fp4,fp3 /* Convert to Integer word lround toward 0. */
--- libc/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S 11 Apr 2008 19:31:08 -0000 1.2
+++ libc/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S 13 Jun 2008 01:18:11 -0000 1.3
@@ -75,12 +75,12 @@ ENTRY (__llround)
fabs fp2,fp1 /* Get the absolute value of x. */
fsub fp12,fp10,fp10 /* Compute 0.0 into fpr12. */
fcmpu cr6,fp2,fp10 /* if |x| < 0.5 */
- fcmpu cr4,fp2,fp9 /* if |x| >= 2^52 */
- fcmpu cr3,fp1,fp12 /* x is negative? x < 0.0 */
+ fcmpu cr7,fp2,fp9 /* if |x| >= 2^52 */
+ fcmpu cr1,fp1,fp12 /* x is negative? x < 0.0 */
blt- cr6,.Lretzero /* 0.5 > x < -0.5 so just return 0. */
- bge- cr4,.Lnobias /* 2^52 > x < -2^52 just convert with no bias. */
+ bge- cr7,.Lnobias /* 2^52 > x < -2^52 just convert with no bias. */
fadd fp3,fp2,fp10 /* |x|+=0.5 bias to prepare to round. */
- bge cr3,.Lconvert /* x is positive so don't negate x. */
+ bge cr1,.Lconvert /* x is positive so don't negate x. */
fnabs fp3,fp3 /* -(|x|+=0.5) */
.Lconvert:
fctidz fp4,fp3 /* Convert to Integer double word round toward 0. */
--- libc/sysdeps/powerpc/powerpc64/fpu/s_llround.S 11 Apr 2008 19:31:51 -0000 1.4
+++ libc/sysdeps/powerpc/powerpc64/fpu/s_llround.S 13 Jun 2008 01:18:11 -0000 1.5
@@ -52,12 +52,12 @@ ENTRY (__llround)
fabs fp2,fp1 /* Get the absolute value of x. */
fsub fp12,fp10,fp10 /* Compute 0.0 into fp12. */
fcmpu cr6,fp2,fp10 /* if |x| < 0.5 */
- fcmpu cr4,fp2,fp9 /* if |x| >= 2^52 */
- fcmpu cr3,fp1,fp12 /* x is negative? x < 0.0 */
+ fcmpu cr7,fp2,fp9 /* if |x| >= 2^52 */
+ fcmpu cr1,fp1,fp12 /* x is negative? x < 0.0 */
blt- cr6,.Lretzero /* 0.5 > x < -0.5 so just return 0. */
- bge- cr4,.Lnobias /* 2^52 > x < -2^52 just convert with no bias. */
+ bge- cr7,.Lnobias /* 2^52 > x < -2^52 just convert with no bias. */
fadd fp3,fp2,fp10 /* |x|+=0.5 bias to prepare to round. */
- bge cr3,.Lconvert /* x is positive so don't negate x. */
+ bge cr1,.Lconvert /* x is positive so don't negate x. */
fnabs fp3,fp3 /* -(|x|+=0.5) */
.Lconvert:
fctidz fp4,fp3 /* Convert to Integer double word round toward 0. */
--- libc/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S 11 Apr 2008 19:31:51 -0000 1.4
+++ libc/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S 13 Jun 2008 01:18:11 -0000 1.5
@@ -51,12 +51,12 @@ ENTRY (__llroundf)
fabs fp2,fp1 /* Get the absolute value of x. */
fsub fp12,fp10,fp10 /* Compute 0.0 into fp12. */
fcmpu cr6,fp2,fp10 /* if |x| < 0.5 */
- fcmpu cr4,fp2,fp9 /* if |x| >= 2^23 */
- fcmpu cr3,fp1,fp12 /* x is negative? x < 0.0 */
+ fcmpu cr7,fp2,fp9 /* if |x| >= 2^23 */
+ fcmpu cr1,fp1,fp12 /* x is negative? x < 0.0 */
blt- cr6,.Lretzero /* 0.5 > x < -0.5 so just return 0. */
- bge- cr4,.Lnobias /* 2^23 > x < -2^23 just convert with no bias. */
+ bge- cr7,.Lnobias /* 2^23 > x < -2^23 just convert with no bias. */
fadd fp3,fp2,fp10 /* |x|+=0.5 bias to prepare to round. */
- bge cr3,.Lconvert /* x is positive so don't negate x. */
+ bge cr1,.Lconvert /* x is positive so don't negate x. */
fnabs fp3,fp3 /* -(|x|+=0.5) */
.Lconvert:
fctidz fp4,fp3 /* Convert to Integer double word round toward 0. */

195
glibc-rwlock-pshared.patch Normal file
View File

@ -0,0 +1,195 @@
2008-05-10 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
__pshared correctly.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
Likewise.
Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
--- libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S 14 Aug 2007 02:24:49 -0000 1.15
+++ libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S 11 May 2008 05:40:33 -0000 1.16
@@ -122,7 +122,7 @@ __pthread_rwlock_rdlock:
#else
leal MUTEX(%ebx), %edx
#endif
- movl PSHARED(%ebx), %ecx
+ movzbl PSHARED(%ebx), %ecx
call __lll_lock_wait
jmp 2b
@@ -138,7 +138,7 @@ __pthread_rwlock_rdlock:
#else
leal MUTEX(%ebx), %eax
#endif
- movl PSHARED(%ebx), %ecx
+ movzbl PSHARED(%ebx), %ecx
call __lll_unlock_wake
jmp 7b
@@ -158,7 +158,7 @@ __pthread_rwlock_rdlock:
#else
leal MUTEX(%ebx), %eax
#endif
- movl PSHARED(%ebx), %ecx
+ movzbl PSHARED(%ebx), %ecx
call __lll_unlock_wake
jmp 11b
@@ -168,7 +168,7 @@ __pthread_rwlock_rdlock:
#else
leal MUTEX(%ebx), %edx
#endif
- movl PSHARED(%ebx), %ecx
+ movzbl PSHARED(%ebx), %ecx
call __lll_lock_wait
jmp 13b
.size __pthread_rwlock_rdlock,.-__pthread_rwlock_rdlock
--- libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S 14 Aug 2007 02:25:44 -0000 1.16
+++ libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S 11 May 2008 05:40:33 -0000 1.17
@@ -162,7 +162,7 @@ pthread_rwlock_timedrdlock:
#else
leal MUTEX(%ebp), %edx
#endif
- movl PSHARED(%ebp), %ecx
+ movzbl PSHARED(%ebp), %ecx
call __lll_lock_wait
jmp 2b
@@ -177,7 +177,7 @@ pthread_rwlock_timedrdlock:
#else
leal MUTEX(%ebp), %eax
#endif
- movl PSHARED(%ebp), %ecx
+ movzbl PSHARED(%ebp), %ecx
call __lll_unlock_wake
jmp 7b
@@ -197,7 +197,7 @@ pthread_rwlock_timedrdlock:
#else
leal MUTEX(%ebp), %eax
#endif
- movl PSHARED(%ebp), %ecx
+ movzbl PSHARED(%ebp), %ecx
call __lll_unlock_wake
jmp 11b
@@ -207,7 +207,7 @@ pthread_rwlock_timedrdlock:
#else
leal MUTEX(%ebp), %edx
#endif
- movl PSHARED(%ebp), %ecx
+ movzbl PSHARED(%ebp), %ecx
call __lll_lock_wait
jmp 13b
--- libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S 14 Aug 2007 02:24:58 -0000 1.17
+++ libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S 11 May 2008 05:40:33 -0000 1.18
@@ -160,7 +160,7 @@ pthread_rwlock_timedwrlock:
#else
leal MUTEX(%ebp), %edx
#endif
- movl PSHARED(%ebp), %ecx
+ movzbl PSHARED(%ebp), %ecx
call __lll_lock_wait
jmp 2b
@@ -175,7 +175,7 @@ pthread_rwlock_timedwrlock:
#else
leal MUTEX(%ebp), %eax
#endif
- movl PSHARED(%ebp), %ecx
+ movzbl PSHARED(%ebp), %ecx
call __lll_unlock_wake
jmp 7b
@@ -190,7 +190,7 @@ pthread_rwlock_timedwrlock:
#else
leal MUTEX(%ebp), %eax
#endif
- movl PSHARED(%ebp), %ecx
+ movzbl PSHARED(%ebp), %ecx
call __lll_unlock_wake
jmp 11b
@@ -200,7 +200,7 @@ pthread_rwlock_timedwrlock:
#else
leal MUTEX(%ebp), %edx
#endif
- movl PSHARED(%ebp), %ecx
+ movzbl PSHARED(%ebp), %ecx
call __lll_lock_wait
jmp 13b
--- libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S 14 Aug 2007 02:25:06 -0000 1.13
+++ libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S 11 May 2008 05:40:33 -0000 1.14
@@ -110,7 +110,7 @@ __pthread_rwlock_unlock:
#else
leal MUTEX(%edi), %edx
#endif
- movl PSHARED(%edi), %ecx
+ movzbl PSHARED(%edi), %ecx
call __lll_lock_wait
jmp 2b
@@ -120,7 +120,7 @@ __pthread_rwlock_unlock:
#else
leal MUTEX(%edi), %eax
#endif
- movl PSHARED(%edi), %ecx
+ movzbl PSHARED(%edi), %ecx
call __lll_unlock_wake
jmp 4b
@@ -130,7 +130,7 @@ __pthread_rwlock_unlock:
#else
leal MUTEX(%edi), %eax
#endif
- movl PSHARED(%edi), %ecx
+ movzbl PSHARED(%edi), %ecx
call __lll_unlock_wake
jmp 8b
--- libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S 14 Aug 2007 02:25:27 -0000 1.15
+++ libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S 11 May 2008 05:40:33 -0000 1.16
@@ -120,7 +120,7 @@ __pthread_rwlock_wrlock:
#else
leal MUTEX(%ebx), %edx
#endif
- movl PSHARED(%ebx), %ecx
+ movzbl PSHARED(%ebx), %ecx
call __lll_lock_wait
jmp 2b
@@ -135,7 +135,7 @@ __pthread_rwlock_wrlock:
#else
leal MUTEX(%ebx), %eax
#endif
- movl PSHARED(%ebx), %ecx
+ movzbl PSHARED(%ebx), %ecx
call __lll_unlock_wake
jmp 7b
@@ -149,7 +149,7 @@ __pthread_rwlock_wrlock:
#else
leal MUTEX(%ebx), %eax
#endif
- movl PSHARED(%ebx), %ecx
+ movzbl PSHARED(%ebx), %ecx
call __lll_unlock_wake
jmp 11b
@@ -159,7 +159,7 @@ __pthread_rwlock_wrlock:
#else
leal MUTEX(%ebx), %edx
#endif
- movl PSHARED(%ebx), %ecx
+ movzbl PSHARED(%ebx), %ecx
call __lll_lock_wait
jmp 13b
.size __pthread_rwlock_wrlock,.-__pthread_rwlock_wrlock

1003
glibc-sparc.patch Normal file

File diff suppressed because it is too large Load Diff

123
glibc-tls-getaddr.patch Normal file
View File

@ -0,0 +1,123 @@
2008-05-11 Ulrich Drepper <drepper@redhat.com>
* elf/dl-tls.c (__tls_get_addr): Optimize by moving slow path in
its own function. This reduces the frame setup costs and more.
--- libc/elf/dl-tls.c 8 Mar 2008 06:11:58 -0000 1.6
+++ libc/elf/dl-tls.c 12 May 2008 05:35:52 -0000 1.7
@@ -691,6 +691,61 @@ _dl_update_slotinfo (unsigned long int r
}
+static void *
+__attribute_noinline__
+tls_get_addr_tail (dtv_t *dtv, struct link_map *the_map, size_t module)
+{
+ /* The allocation was deferred. Do it now. */
+ if (the_map == NULL)
+ {
+ /* Find the link map for this module. */
+ size_t idx = module;
+ struct dtv_slotinfo_list *listp = GL(dl_tls_dtv_slotinfo_list);
+
+ while (idx >= listp->len)
+ {
+ idx -= listp->len;
+ listp = listp->next;
+ }
+
+ the_map = listp->slotinfo[idx].map;
+ }
+
+ again:
+ /* Make sure that, if a dlopen running in parallel forces the
+ variable into static storage, we'll wait until the address in the
+ static TLS block is set up, and use that. If we're undecided
+ yet, make sure we make the decision holding the lock as well. */
+ if (__builtin_expect (the_map->l_tls_offset
+ != FORCED_DYNAMIC_TLS_OFFSET, 0))
+ {
+ __rtld_lock_lock_recursive (GL(dl_load_lock));
+ if (__builtin_expect (the_map->l_tls_offset == NO_TLS_OFFSET, 1))
+ {
+ the_map->l_tls_offset = FORCED_DYNAMIC_TLS_OFFSET;
+ __rtld_lock_unlock_recursive (GL(dl_load_lock));
+ }
+ else
+ {
+ __rtld_lock_unlock_recursive (GL(dl_load_lock));
+ if (__builtin_expect (the_map->l_tls_offset
+ != FORCED_DYNAMIC_TLS_OFFSET, 1))
+ {
+ void *p = dtv[module].pointer.val;
+ if (__builtin_expect (p == TLS_DTV_UNALLOCATED, 0))
+ goto again;
+
+ return p;
+ }
+ }
+ }
+ void *p = dtv[module].pointer.val = allocate_and_init (the_map);
+ dtv[module].pointer.is_static = false;
+
+ return p;
+}
+
+
/* The generic dynamic and local dynamic model cannot be used in
statically linked applications. */
void *
@@ -703,52 +758,10 @@ __tls_get_addr (GET_ADDR_ARGS)
if (__builtin_expect (dtv[0].counter != GL(dl_tls_generation), 0))
the_map = _dl_update_slotinfo (GET_ADDR_MODULE);
- retry:
p = dtv[GET_ADDR_MODULE].pointer.val;
if (__builtin_expect (p == TLS_DTV_UNALLOCATED, 0))
- {
- /* The allocation was deferred. Do it now. */
- if (the_map == NULL)
- {
- /* Find the link map for this module. */
- size_t idx = GET_ADDR_MODULE;
- struct dtv_slotinfo_list *listp = GL(dl_tls_dtv_slotinfo_list);
-
- while (idx >= listp->len)
- {
- idx -= listp->len;
- listp = listp->next;
- }
-
- the_map = listp->slotinfo[idx].map;
- }
-
- /* Make sure that, if a dlopen running in parallel forces the
- variable into static storage, we'll wait until the address in
- the static TLS block is set up, and use that. If we're
- undecided yet, make sure we make the decision holding the
- lock as well. */
- if (__builtin_expect (the_map->l_tls_offset
- != FORCED_DYNAMIC_TLS_OFFSET, 0))
- {
- __rtld_lock_lock_recursive (GL(dl_load_lock));
- if (__builtin_expect (the_map->l_tls_offset == NO_TLS_OFFSET, 1))
- {
- the_map->l_tls_offset = FORCED_DYNAMIC_TLS_OFFSET;
- __rtld_lock_unlock_recursive (GL(dl_load_lock));
- }
- else
- {
- __rtld_lock_unlock_recursive (GL(dl_load_lock));
- if (__builtin_expect (the_map->l_tls_offset
- != FORCED_DYNAMIC_TLS_OFFSET, 1))
- goto retry;
- }
- }
- p = dtv[GET_ADDR_MODULE].pointer.val = allocate_and_init (the_map);
- dtv[GET_ADDR_MODULE].pointer.is_static = false;
- }
+ p = tls_get_addr_tail (dtv, the_map, GET_ADDR_MODULE);
return (char *) p + GET_ADDR_OFFSET;
}

View File

@ -58,6 +58,7 @@ Patch15: glibc-rh450790.patch
Patch16: glibc-rwlock-pshared.patch
Patch17: glibc-sparc.patch
Patch18: glibc-tls-getaddr.patch
Patch19: glibc-bz6719.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Obsoletes: glibc-profile < 2.4
Provides: ldconfig
@ -254,6 +255,7 @@ package or when debugging this package.
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
# A lot of programs still misuse memcpy when they have to use
# memmove. The memcpy implementation below is not tolerant at
@ -1016,7 +1018,7 @@ rm -f *.filelist*
%changelog
* Tue Jul 8 2008 Jakub Jelinek <jakub@redhat.com> 2.8-7
- assorted nscd fixes (#450704, #445656, #449358)
- misc upstream fixes (BZ#3406, BZ#6461, BZ#6472, BZ#6612, BZ#6657, BZ#6723)
- misc fixes (BZ#3406, BZ#6461, BZ#6472, BZ#6612, BZ#6657, BZ#6723, BZ#6719)
- fix *scanf in -std=c99 mode
- add lt translations
- some SPARC fixes