rpms/glibc/FC-6 glibc-bz2337.patch, NONE, 1.1 glibc-bz3320.patch, NONE, 1.1 glibc-bz3352.patch, NONE, 1.1 glibc-bz3369.patch, NONE, 1.1 glibc-bz3429.patch, NONE, 1.1 glibc-bz3451.patch, NONE, 1.1 glibc-bz3559.patch, NONE, 1.1 glibc-bz3632.patch, NONE, 1.1 glibc-bz3747.patch, NONE, 1.1 glibc-i386-syscall6.patch, NONE, 1.1 glibc-mai_IN.patch, NONE, 1.1 glibc-memusage.patch, NONE, 1.1 glibc-nis+-getenv.patch, NONE, 1.1 glibc-nptl_db-dtvp.patch, NONE, 1.1 glibc-po-update.patch, NONE, 1.1 glibc-powerpc-cpu-addon-update.patch, NONE, 1.1 glibc-r_debug-r_map.patch, NONE, 1.1 glibc-rh206483.patch, NONE, 1.1 glibc-rh210130.patch, NONE, 1.1 glibc-rh211116.patch, NONE, 1.1 glibc-rh213656.patch, NONE, 1.1 glibc-rh214569.patch, NONE, 1.1 glibc-rh215572.patch, NONE, 1.1 glibc-rh216970.patch, NONE, 1.1 glibc-rh218276.patch, NONE, 1.1 glibc-rh218782.patch, NONE, 1.1 glibc-rh218802.patch, NONE, 1.1 glibc-rh219107.patch, NONE, 1.1 glibc-rh219145.patch, NONE, 1.1 glibc-strtod.patch, NONE, 1.1 glibc-strxfrm.patch, 1.4, 1.5 glibc-sysconf-intel-core! -duo.patch, NONE, 1.1 glibc-tst-pselect.patch, NONE, 1.1 glibc-tzfile64.patch, NONE, 1.1 glibc.spec, 1.277, 1.278
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Tue Dec 19 23:23:46 UTC 2006
Author: jakub
Update of /cvs/dist/rpms/glibc/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv17201/FC-6
Modified Files:
glibc.spec
Added Files:
glibc-bz2337.patch glibc-bz3320.patch glibc-bz3352.patch
glibc-bz3369.patch glibc-bz3429.patch glibc-bz3451.patch
glibc-bz3559.patch glibc-bz3632.patch glibc-bz3747.patch
glibc-i386-syscall6.patch glibc-mai_IN.patch
glibc-memusage.patch glibc-nis+-getenv.patch
glibc-nptl_db-dtvp.patch glibc-po-update.patch
glibc-powerpc-cpu-addon-update.patch glibc-r_debug-r_map.patch
glibc-rh206483.patch glibc-rh210130.patch glibc-rh211116.patch
glibc-rh213656.patch glibc-rh214569.patch glibc-rh215572.patch
glibc-rh216970.patch glibc-rh218276.patch glibc-rh218782.patch
glibc-rh218802.patch glibc-rh219107.patch glibc-rh219145.patch
glibc-strtod.patch glibc-strxfrm.patch
glibc-sysconf-intel-core-duo.patch glibc-tst-pselect.patch
glibc-tzfile64.patch
Log Message:
auto-import glibc-2.5-8.fc6 on branch FC-6 from glibc-2.5-8.fc6.src.rpm
glibc-bz2337.patch:
Makefile | 3 ++-
fileops.c | 11 ++++-------
genops.c | 2 +-
libio.h | 1 +
tst-setvbuf1.c | 39 +++++++++++++++++++++++++++++++++++++++
wfiledoalloc.c | 29 +++++++----------------------
wgenops.c | 8 ++++----
wmemstream.c | 2 +-
wstrops.c | 6 +++---
9 files changed, 62 insertions(+), 39 deletions(-)
--- NEW FILE glibc-bz2337.patch ---
2006-12-13 Ulrich Drepper <drepper at redhat.com>
[BZ #2337]
* libio/Makefile (tests): Add tst-setvbuf1.
* libio/tst-setvbuf1.c: New file.
2006-12-08 Jakub Jelinek <jakub at redhat.com>
[BZ #2337]
* libio/genops.c (__uflow): Fix a typo.
* libio/wfiledoalloc.c (_IO_wfile_doallocate): Don't stat
nor set _IO_LINE_BUF bit here. Size the wide buffer based on
the narrow buffer size.
2006-11-24 Jakub Jelinek <jakub at redhat.com>
[BZ #2337]
* libio/libio.h (_IO_FLAGS2_USER_WBUF): Define.
* libio/wgenops.c (_IO_wsetb, _IO_wdefault_finish): Test and set
_IO_FLAGS2_USER_WBUF bit in _flags2 instead of _IO_USER_BUF bit
in _flags.
* libio/wstrops.c (_IO_wstr_overflow, enlarge_userbuf,
_IO_wstr_finish): Likewise.
* libio/wmemstream.c (open_wmemstream): Likewise.
* libio/fileops.c (_IO_new_file_close_it): Call _IO_set[bgp]
even for wide streams.
--- libc/libio/Makefile 14 Aug 2006 22:12:27 -0000 1.86
+++ libc/libio/Makefile 13 Dec 2006 23:17:48 -0000 1.87
@@ -57,7 +57,8 @@ tests = tst_swprintf tst_wprintf tst_sws
bug-ungetc2 bug-ftell bug-ungetc3 bug-ungetc4 tst-fopenloc2 \
tst-memstream1 tst-memstream2 \
tst-wmemstream1 tst-wmemstream2 \
- bug-memstream1 bug-wmemstream1
+ bug-memstream1 bug-wmemstream1 \
+ tst-setvbuf1
test-srcs = test-freopen
all: # Make this the default target; it will be defined in Rules.
--- libc/libio/fileops.c 19 Jan 2006 00:38:35 -0000 1.110
+++ libc/libio/fileops.c 13 Dec 2006 23:16:54 -0000 1.111
@@ -174,14 +174,8 @@ _IO_new_file_close_it (fp)
close_status = _IO_SYSCLOSE (fp);
/* Free buffer. */
- if (fp->_mode <= 0)
- {
- INTUSE(_IO_setb) (fp, NULL, NULL, 0);
- _IO_setg (fp, NULL, NULL, NULL);
- _IO_setp (fp, NULL, NULL);
- }
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
- else
+ if (fp->_mode > 0)
{
if (_IO_have_wbackup (fp))
INTUSE(_IO_free_wbackup_area) (fp);
@@ -190,6 +184,9 @@ _IO_new_file_close_it (fp)
_IO_wsetp (fp, NULL, NULL);
}
#endif
+ INTUSE(_IO_setb) (fp, NULL, NULL, 0);
+ _IO_setg (fp, NULL, NULL, NULL);
+ _IO_setp (fp, NULL, NULL);
INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
fp->_flags = _IO_MAGIC|CLOSED_FILEBUF_FLAGS;
--- libc/libio/genops.c 1 Mar 2006 05:32:48 -0000 1.70
+++ libc/libio/genops.c 13 Dec 2006 23:17:03 -0000 1.71
@@ -367,7 +367,7 @@ __uflow (fp)
#endif
if (fp->_mode == 0)
- _IO_fwide (fp, -11);
+ _IO_fwide (fp, -1);
if (_IO_in_put_mode (fp))
if (INTUSE(_IO_switch_to_get_mode) (fp) == EOF)
return EOF;
--- libc/libio/libio.h 14 Jan 2006 12:09:46 -0000 1.64
+++ libc/libio/libio.h 13 Dec 2006 23:15:31 -0000 1.65
@@ -142,6 +142,7 @@
#ifdef _LIBC
# define _IO_FLAGS2_FORTIFY 4
#endif
+#define _IO_FLAGS2_USER_WBUF 8
/* These are "formatting flags" matching the iostream fmtflags enum values. */
#define _IO_SKIPWS 01
--- libc/libio/tst-setvbuf1.c 1 Jan 1970 00:00:00 -0000
+++ libc/libio/tst-setvbuf1.c 13 Dec 2006 23:17:38 -0000 1.1
@@ -0,0 +1,39 @@
+/* Dereived from the test case in BZ #2337. */
+#include <errno.h>
+#include <error.h>
+#include <fcntl.h>
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <wchar.h>
+
+
+static char buf[512] __attribute__ ((aligned (4096)));
+
+
+static int
+do_test (void)
+{
+ setlocale (LC_ALL, "de_DE.UTF-8");
+
+ FILE *fp = fdopen (dup (STDOUT_FILENO), "a");
+ if (fp == NULL)
+ error (EXIT_FAILURE, errno, "fdopen(,\"a\")");
+
+ setvbuf (fp, buf, _IOFBF, sizeof (buf));
+
+ /* fwprintf to unbuffered stream. */
+ fwprintf (fp, L"hello.\n");
+
+ fclose (fp);
+
+ /* touch my buffer */
+ buf[45] = 'a';
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
--- libc/libio/wfiledoalloc.c 6 Jul 2002 06:35:54 -0000 1.6
+++ libc/libio/wfiledoalloc.c 13 Dec 2006 23:17:18 -0000 1.7
@@ -85,35 +86,20 @@ _IO_wfile_doallocate (fp)
_IO_FILE *fp;
{
_IO_size_t size;
- int couldbetty;
wchar_t *p;
- struct _G_stat64 st;
/* Allocate room for the external buffer. */
if (fp->_IO_buf_base == NULL)
INTUSE(_IO_file_doallocate) (fp);
- if (fp->_fileno < 0 || _IO_SYSSTAT (fp, &st) < 0)
- {
- couldbetty = 0;
- size = _IO_BUFSIZ;
-#if 0
- /* do not try to optimise fseek() */
- fp->_flags |= __SNPT;
-#endif
- }
- else
- {
- couldbetty = S_ISCHR (st.st_mode);
-#if _IO_HAVE_ST_BLKSIZE
- size = st.st_blksize <= 0 ? _IO_BUFSIZ : st.st_blksize;
-#else
- size = _IO_BUFSIZ;
-#endif
- }
+ /* If narrow buffer is user allocated (set by setvbuf etc.),
+ use that size as the size of the wide buffer, when it is
+ allocated by _IO_file_doallocate, multiply that by size
+ of the wide character. */
+ size = fp->_IO_buf_end - fp->_IO_buf_base;
+ if ((fp->_flags & _IO_USER_BUF))
+ size = (size + sizeof (wchar_t) - 1) / sizeof (wchar_t);
ALLOC_WBUF (p, size * sizeof (wchar_t), EOF);
INTUSE(_IO_wsetb) (fp, p, p + size, 1);
- if (couldbetty && isatty (fp->_fileno))
- fp->_flags |= _IO_LINE_BUF;
return 1;
}
--- libc/libio/wgenops.c 12 Feb 2006 21:20:57 -0000 1.14
+++ libc/libio/wgenops.c 13 Dec 2006 23:15:51 -0000 1.15
@@ -115,14 +115,14 @@ _IO_wsetb (f, b, eb, a)
wchar_t *eb;
int a;
{
- if (f->_wide_data->_IO_buf_base && !(f->_flags & _IO_USER_BUF))
+ if (f->_wide_data->_IO_buf_base && !(f->_flags2 & _IO_FLAGS2_USER_WBUF))
FREE_BUF (f->_wide_data->_IO_buf_base, _IO_wblen (f) * sizeof (wchar_t));
f->_wide_data->_IO_buf_base = b;
f->_wide_data->_IO_buf_end = eb;
if (a)
- f->_flags &= ~_IO_USER_BUF;
+ f->_flags2 &= ~_IO_FLAGS2_USER_WBUF;
else
- f->_flags |= _IO_USER_BUF;
+ f->_flags2 |= _IO_FLAGS2_USER_WBUF;
}
INTDEF(_IO_wsetb)
@@ -198,7 +198,7 @@ _IO_wdefault_finish (fp, dummy)
int dummy;
{
struct _IO_marker *mark;
- if (fp->_wide_data->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
+ if (fp->_wide_data->_IO_buf_base && !(fp->_flags2 & _IO_FLAGS2_USER_WBUF))
{
FREE_BUF (fp->_wide_data->_IO_buf_base,
_IO_wblen (fp) * sizeof (wchar_t));
--- libc/libio/wmemstream.c 30 Sep 2006 00:06:33 -0000 1.3
+++ libc/libio/wmemstream.c 13 Dec 2006 23:16:40 -0000 1.4
@@ -92,7 +92,7 @@ open_wmemstream (bufloc, sizeloc)
_IO_fwide (&new_f->fp._sf._sbf._f, 1);
_IO_wstr_init_static (&new_f->fp._sf._sbf._f, buf,
_IO_BUFSIZ / sizeof (wchar_t), buf);
- new_f->fp._sf._sbf._f._flags &= ~_IO_USER_BUF;
+ new_f->fp._sf._sbf._f._flags2 &= ~_IO_FLAGS2_USER_WBUF;
new_f->fp._sf._s._allocate_buffer = (_IO_alloc_type) malloc;
new_f->fp._sf._s._free_buffer = (_IO_free_type) free;
--- libc/libio/wstrops.c 14 Aug 2006 22:14:53 -0000 1.11
+++ libc/libio/wstrops.c 13 Dec 2006 23:16:21 -0000 1.12
@@ -88,7 +88,7 @@ _IO_wstr_overflow (fp, c)
pos = fp->_wide_data->_IO_write_ptr - fp->_wide_data->_IO_write_base;
if (pos >= (_IO_size_t) (_IO_wblen (fp) + flush_only))
{
- if (fp->_flags & _IO_USER_BUF) /* not allowed to enlarge */
+ if (fp->_flags2 & _IO_FLAGS2_USER_WBUF) /* not allowed to enlarge */
return WEOF;
else
{
@@ -182,7 +182,7 @@ enlarge_userbuf (_IO_FILE *fp, _IO_off64
_IO_ssize_t oldend = wd->_IO_write_end - wd->_IO_write_base;
/* Try to enlarge the buffer. */
- if (fp->_flags & _IO_USER_BUF)
+ if (fp->_flags2 & _IO_FLAGS2_USER_WBUF)
/* User-provided buffer. */
return 1;
@@ -335,7 +335,7 @@ _IO_wstr_finish (fp, dummy)
_IO_FILE *fp;
int dummy;
{
- if (fp->_wide_data->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
+ if (fp->_wide_data->_IO_buf_base && !(fp->_flags2 & _IO_FLAGS2_USER_WBUF))
(((_IO_strfile *) fp)->_s._free_buffer) (fp->_wide_data->_IO_buf_base);
fp->_wide_data->_IO_buf_base = NULL;
glibc-bz3320.patch:
es_ES | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
--- NEW FILE glibc-bz3320.patch ---
2006-10-12 Ulrich Drepper <drepper at redhat.com>
[BZ #3320]
* locales/es_ES (LC_TIME): Add week, first_weekday, and first_workday.
--- libc/localedata/locales/es_ES 2006-07-31 09:16:59.000000000 +0200
+++ libc/localedata/locales/es_ES 2006-10-25 20:59:21.000000000 +0200
@@ -2187,12 +2187,13 @@ 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>"
+week 7;19971130;5
+first_weekday 2
+first_workday 2
END LC_TIME
LC_PAPER
-% FIXME
height 297
-% FIXME
width 210
END LC_PAPER
glibc-bz3352.patch:
dl-minimal.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
--- NEW FILE glibc-bz3352.patch ---
2006-10-13 Ulrich Drepper <drepper at redhat.com>
* elf/dl-minimal.c (realloc): Optimize last patch.
2006-10-12 Richard Sandiford <richard at codesourcery.com>
[BZ #3352]
* elf/dl-minimal.c (realloc): Let malloc() return a new pointer,
and use memcpy() if it does.
--- libc/elf/dl-minimal.c 17 Dec 2005 23:08:29 -0000 1.50
+++ libc/elf/dl-minimal.c 13 Oct 2006 16:18:12 -0000 1.52
@@ -128,14 +129,13 @@ free (void *ptr)
void * weak_function
realloc (void *ptr, size_t n)
{
- void *new;
if (ptr == NULL)
return malloc (n);
assert (ptr == alloc_last_block);
+ size_t old_size = alloc_ptr - alloc_last_block;
alloc_ptr = alloc_last_block;
- new = malloc (n);
- assert (new == ptr);
- return new;
+ void *new = malloc (n);
+ return new != ptr ? memcpy (new, ptr, old_size) : new;
}
/* Avoid signal frobnication in setjmp/longjmp. Keeps things smaller. */
glibc-bz3369.patch:
getaddrinfo.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
--- NEW FILE glibc-bz3369.patch ---
2006-10-16 Ulrich Drepper <drepper at redhat.com>
[BZ #3369]
* sysdeps/posix/getaddrinfo.c (rfc3484_sort): Fix typos in rules 4
and 7.
--- libc/sysdeps/posix/getaddrinfo.c 2 Oct 2006 16:49:47 -0000 1.107
+++ libc/sysdeps/posix/getaddrinfo.c 16 Oct 2006 15:19:17 -0000 1.108
@@ -1395,10 +1395,10 @@ rfc3484_sort (const void *p1, const void
{
if (!(a1->source_addr_flags & in6ai_homeaddress)
&& (a2->source_addr_flags & in6ai_homeaddress))
- return -1;
+ return 1;
if ((a1->source_addr_flags & in6ai_homeaddress)
&& !(a2->source_addr_flags & in6ai_homeaddress))
- return 1;
+ return -1;
}
/* Rule 5: Prefer matching label. */
@@ -1435,11 +1435,11 @@ rfc3484_sort (const void *p1, const void
if (a1->got_source_addr)
{
if (!(a1->source_addr_flags & in6ai_temporary)
- && (a1->source_addr_flags & in6ai_temporary))
+ && (a2->source_addr_flags & in6ai_temporary))
return -1;
if ((a1->source_addr_flags & in6ai_temporary)
- && !(a1->source_addr_flags & in6ai_temporary))
- return -1;
+ && !(a2->source_addr_flags & in6ai_temporary))
+ return 1;
/* XXX Do we need to check anything beside temporary addresses? */
}
glibc-bz3429.patch:
Makefile | 4 +++-
dl-close.c | 44 +++++++++++++++++++++++++++-----------------
dl-open.c | 23 ++++++++++++-----------
tst-thrlock.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 97 insertions(+), 29 deletions(-)
--- NEW FILE glibc-bz3429.patch ---
2006-10-27 Ulrich Drepper <drepper at redhat.com>
* elf/dl-close.c (_dl_close_worker): Renamed from _dl_close and
split out locking and parameter checking.
(_dl_close): Call _dl_close_worker after locking and checking.
* elf/dl-open.c (_dl_open): Call _dl_close_worker instead of
_dl_close.
* elf/Makefile: Add rules to build and run tst-thrlock.
* elf/tst-thrlock.c: New file.
[BZ #3429]
* elf/dl-open.c (dl_open_worker): Keep holding dl_load_lock until
we are sure we do not need it anymore for _dl_close. Also move
the asserts inside the lock region.
Patch mostly by Suzuki <suzuki at in.ibm.com>.
--- libc/elf/Makefile 19 Sep 2006 14:41:41 -0000 1.315
+++ libc/elf/Makefile 27 Oct 2006 21:00:18 -0000 1.316
@@ -171,7 +171,7 @@ tests += loadtest restest1 preloadtest l
tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
unload3 unload4 unload5 unload6 unload7 tst-global1 order2 \
tst-audit1 tst-audit2 \
- tst-stackguard1 tst-addr1
+ tst-stackguard1 tst-addr1 tst-thrlock
# reldep9
test-srcs = tst-pathopt
tests-vis-yes = vismain
@@ -916,3 +916,5 @@ $(objpfx)tst-leaks1-mem: $(objpfx)tst-le
tst-leaks1-ENV = MALLOC_TRACE=$(objpfx)tst-leaks1.mtrace
$(objpfx)tst-addr1: $(libdl)
+
+$(objpfx)tst-thrlock: $(libdl) $(shared-thread-library)
--- libc/elf/dl-close.c 27 Oct 2006 15:20:17 -0000 1.121
+++ libc/elf/dl-close.c 27 Oct 2006 20:59:37 -0000 1.123
@@ -107,22 +107,9 @@ remove_slotinfo (size_t idx, struct dtv_
void
-_dl_close (void *_map)
+_dl_close_worker (struct link_map *map)
{
- struct link_map *map = _map;
Lmid_t ns = map->l_ns;
- unsigned int i;
- /* First see whether we can remove the object at all. */
- if (__builtin_expect (map->l_flags_1 & DF_1_NODELETE, 0)
- && map->l_init_called)
- /* Nope. Do nothing. */
- return;
-
- if (__builtin_expect (map->l_direct_opencount, 1) == 0)
- GLRO(dl_signal_error) (0, map->l_name, NULL, N_("shared object not open"));
-
- /* Acquire the lock. */
- __rtld_lock_lock_recursive (GL(dl_load_lock));
/* One less direct use. */
--map->l_direct_opencount;
@@ -143,7 +130,6 @@ _dl_close (void *_map)
_dl_debug_printf ("\nclosing file=%s; direct_opencount=%u\n",
map->l_name, map->l_direct_opencount);
- __rtld_lock_unlock_recursive (GL(dl_load_lock));
return;
}
@@ -246,7 +232,7 @@ _dl_close (void *_map)
#endif
bool unload_any = false;
unsigned int first_loaded = ~0;
- for (i = 0; i < nloaded; ++i)
+ for (unsigned int i = 0; i < nloaded; ++i)
{
struct link_map *imap = maps[i];
@@ -482,7 +468,7 @@ _dl_close (void *_map)
/* Check each element of the search list to see if all references to
it are gone. */
- for (i = first_loaded; i < nloaded; ++i)
+ for (unsigned int i = first_loaded; i < nloaded; ++i)
{
struct link_map *imap = maps[i];
if (!used[i])
@@ -698,6 +684,30 @@ _dl_close (void *_map)
goto retry;
dl_close_state = not_pending;
+}
+
+
+void
+_dl_close (void *_map)
+{
+ struct link_map *map = _map;
+
+ /* First see whether we can remove the object at all. */
+ if (__builtin_expect (map->l_flags_1 & DF_1_NODELETE, 0))
+ {
+ assert (map->l_init_called);
+ /* Nope. Do nothing. */
+ return;
+ }
+
+ if (__builtin_expect (map->l_direct_opencount, 1) == 0)
+ GLRO(dl_signal_error) (0, map->l_name, NULL, N_("shared object not open"));
+
+ /* Acquire the lock. */
+ __rtld_lock_lock_recursive (GL(dl_load_lock));
+
+ _dl_close_worker (map);
+
__rtld_lock_unlock_recursive (GL(dl_load_lock));
}
--- libc/elf/dl-open.c 27 Oct 2006 15:20:54 -0000 1.132
+++ libc/elf/dl-open.c 27 Oct 2006 20:14:09 -0000 1.134
@@ -567,15 +567,9 @@ no more namespaces available for dlmopen
_dl_unload_cache ();
#endif
- /* Release the lock. */
- __rtld_lock_unlock_recursive (GL(dl_load_lock));
-
+ /* See if an error occurred during loading. */
if (__builtin_expect (errstring != NULL, 0))
{
- /* Some error occurred during loading. */
- char *local_errstring;
- size_t len_errstring;
-
/* Remove the object from memory. It may be in an inconsistent
state if relocation failed, for example. */
if (args.map)
@@ -592,12 +586,18 @@ no more namespaces available for dlmopen
GL(dl_tls_dtv_gaps) = true;
#endif
- _dl_close (args.map);
+ _dl_close_worker (args.map);
}
+ assert (_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT);
+
+ /* Release the lock. */
+ __rtld_lock_unlock_recursive (GL(dl_load_lock));
+
/* Make a local copy of the error string so that we can release the
memory allocated for it. */
- len_errstring = strlen (errstring) + 1;
+ size_t len_errstring = strlen (errstring) + 1;
+ char *local_errstring;
if (objname == errstring + len_errstring)
{
size_t total_len = len_errstring + strlen (objname) + 1;
@@ -614,14 +614,15 @@ no more namespaces available for dlmopen
if (malloced)
free ((char *) errstring);
- assert (_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT);
-
/* Reraise the error. */
_dl_signal_error (errcode, objname, NULL, local_errstring);
}
assert (_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT);
+ /* Release the lock. */
+ __rtld_lock_unlock_recursive (GL(dl_load_lock));
+
#ifndef SHARED
DL_STATIC_INIT (args.map);
#endif
--- libc/elf/tst-thrlock.c 1 Jan 1970 00:00:00 -0000
+++ libc/elf/tst-thrlock.c 27 Oct 2006 20:58:57 -0000 1.1
@@ -0,0 +1,55 @@
+#include <dlfcn.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gnu/lib-names.h>
+
+static void *
+tf (void *arg)
+{
+ void *h = dlopen (LIBM_SO, RTLD_LAZY);
+ if (h == NULL)
+ {
+ printf ("dlopen failed: %s\n", dlerror ());
+ exit (1);
+ }
+ if (dlsym (h, "sin") == NULL)
+ {
+ printf ("dlsym failed: %s\n", dlerror ());
+ exit (1);
+ }
+ if (dlclose (h) != 0)
+ {
+ printf ("dlclose failed: %s\n", dlerror ());
+ exit (1);
+ }
+ return NULL;
+}
+
+int
+main (void)
+{
+#define N 10
+ pthread_t th[N];
+ for (int i = 0; i < N; ++i)
+ {
+ int e = pthread_create (&th[i], NULL, tf, NULL);
+ if (e != 0)
+ {
+ printf ("pthread_create failed with %d (%s)\n", e, strerror (e));
+ return 1;
+ }
+ }
+ for (int i = 0; i < N; ++i)
+ {
+ void *res;
+ int e = pthread_join (th[i], &res);
+ if (e != 0 || res != NULL)
+ {
+ puts ("thread failed");
+ return 1;
+ }
+ }
+ return 0;
+}
glibc-bz3451.patch:
mathinline.h | 42 ++++++++++++++++++++++++++++--------------
1 files changed, 28 insertions(+), 14 deletions(-)
--- NEW FILE glibc-bz3451.patch ---
2006-11-10 Ulrich Drepper <drepper at redhat.com>
[BZ #3451]
* sysdeps/i386/fpu/bits/mathinline.h (floor): Make rounding mode
change atomic.
(ceil): Likewise.
--- libc/sysdeps/i386/fpu/bits/mathinline.h 7 Sep 2004 22:23:42 -0000 1.58
+++ libc/sysdeps/i386/fpu/bits/mathinline.h 10 Nov 2006 20:42:00 -0000 1.60
@@ -529,24 +529,38 @@ __inline_mathcodeNP (tanh, __x, \
__inline_mathcodeNP (floor, __x, \
register long double __value; \
- __volatile unsigned short int __cw; \
- __volatile unsigned short int __cwtmp; \
- __asm __volatile ("fnstcw %0" : "=m" (__cw)); \
- __cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */ \
- __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); \
- __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); \
- __asm __volatile ("fldcw %0" : : "m" (__cw)); \
+ register int __ignore; \
+ unsigned short int __cw; \
+ unsigned short int __cwtmp; \
+ __asm __volatile ("fnstcw %3\n\t" \
+ "movzwl %3, %1\n\t" \
+ "andl $0xf3ff, %1\n\t" \
+ "orl $0x0400, %1\n\t" /* rounding down */ \
+ "movw %w1, %2\n\t" \
+ "fldcw %2\n\t" \
+ "frndint\n\t" \
+ "fldcw %3" \
+ : "=t" (__value), "=&q" (__ignore), "=m" (__cwtmp), \
+ "=m" (__cw) \
+ : "0" (__x)); \
return __value)
__inline_mathcodeNP (ceil, __x, \
register long double __value; \
- __volatile unsigned short int __cw; \
- __volatile unsigned short int __cwtmp; \
- __asm __volatile ("fnstcw %0" : "=m" (__cw)); \
- __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */ \
- __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); \
- __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); \
- __asm __volatile ("fldcw %0" : : "m" (__cw)); \
+ register int __ignore; \
+ unsigned short int __cw; \
+ unsigned short int __cwtmp; \
+ __asm __volatile ("fnstcw %3\n\t" \
+ "movzwl %3, %1\n\t" \
+ "andl $0xf3ff, %1\n\t" \
+ "orl $0x0800, %1\n\t" /* rounding up */ \
+ "movw %w1, %2\n\t" \
+ "fldcw %2\n\t" \
+ "frndint\n\t" \
+ "fldcw %3" \
+ : "=t" (__value), "=&q" (__ignore), "=m" (__cwtmp), \
+ "=m" (__cw) \
+ : "0" (__x)); \
return __value)
#ifdef __FAST_MATH__
glibc-bz3559.patch:
svc_run.c | 6 ++++++
1 files changed, 6 insertions(+)
--- NEW FILE glibc-bz3559.patch ---
2006-11-27 Jakub Jelinek <jakub at redhat.com>
[BZ #3559]
* sunrpc/svc_run.c (svc_run): Fail instead of segfaulting if
malloc crashed.
--- libc/sunrpc/svc_run.c 2002-05-15 02:21:01.000000000 +0200
+++ libc/sunrpc/svc_run.c 2006-11-28 17:06:24.000000000 +0100
@@ -60,6 +60,12 @@ svc_run (void)
return;
my_pollfd = malloc (sizeof (struct pollfd) * svc_max_pollfd);
+ if (my_pollfd == NULL)
+ {
+ perror (_("svc_run: - out of memory"));
+ return;
+ }
+
for (i = 0; i < svc_max_pollfd; ++i)
{
my_pollfd[i].fd = svc_pollfd[i].fd;
glibc-bz3632.patch:
features.h | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE glibc-bz3632.patch ---
2006-12-09 Ulrich Drepper <drepper at redhat.com>
[BZ #3632]
* include/features.h: Fix comment about default value for
_POSIX_C_SOURCE.
--- libc/include/features.h 6 Oct 2006 15:38:14 -0000 1.44
+++ libc/include/features.h 10 Dec 2006 01:54:13 -0000 1.45
@@ -49,7 +49,7 @@
The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__.
If none of these are defined, the default is to have _SVID_SOURCE,
_BSD_SOURCE, and _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to
- 199506L. If more than one of these are defined, they accumulate.
+ 200112L. If more than one of these are defined, they accumulate.
For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE
together give you ISO C, 1003.1, and 1003.2, but nothing else.
glibc-bz3747.patch:
Makefile | 2 -
jrand48_r.c | 2 -
tst-rand48-2.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
tst-rand48.c | 28 +++++++-------
4 files changed, 129 insertions(+), 16 deletions(-)
--- NEW FILE glibc-bz3747.patch ---
2006-12-18 Jakub Jelinek <jakub at redhat.com>
[BZ #3747]
* stdlib/jrand48_r.c (__jrand48_r): Make sure result is in the
[-231 .. 231) range.
* stdlib/tst-rand48.c (main): Fix expected values for 64-bit
targets.
* stdlib/tst-rand48-2.c: New test.
* stdlib/Makefile (tests): Add tst-rand48-2.
--- libc/stdlib/Makefile 11 Dec 2006 21:43:10 -0000 1.113
+++ libc/stdlib/Makefile 19 Dec 2006 08:18:11 -0000 1.114
@@ -67,7 +67,7 @@ tests := tst-strtol tst-strtod testmb t
tst-xpg-basename tst-random tst-random2 tst-bsearch \
tst-limits tst-rand48 bug-strtod tst-setcontext \
test-a64l tst-qsort tst-system testmb2 bug-strtod2 \
- tst-atof1 tst-atof2 tst-strtod2 tst-strtod3
+ tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 tst-rand48-2
include ../Makeconfig
--- libc/stdlib/jrand48_r.c 6 Jul 2001 04:55:41 -0000 1.9
+++ libc/stdlib/jrand48_r.c 19 Dec 2006 08:17:11 -0000 1.10
@@ -30,7 +30,7 @@ __jrand48_r (xsubi, buffer, result)
return -1;
/* Store the result. */
- *result = ((xsubi[2] << 16) | xsubi[1]) & 0xffffffffl;
+ *result = (int32_t) ((xsubi[2] << 16) | xsubi[1]);
return 0;
}
--- libc/stdlib/tst-rand48-2.c 1 Jan 1970 00:00:00 -0000
+++ libc/stdlib/tst-rand48-2.c 19 Dec 2006 08:17:59 -0000 1.1
@@ -0,0 +1,113 @@
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+int
+main (void)
+{
+ time_t t = time (NULL);
+ int i, ret = 0;
+ double d;
+ long int l;
+ struct drand48_data data;
+ unsigned short int buf[3];
+
+ srand48 ((long int) t);
+ for (i = 0; i < 50; i++)
+ if ((d = drand48 ()) < 0.0 || d >= 1.0)
+ {
+ printf ("drand48 %d %g\n", i, d);
+ ret = 1;
+ }
+
+ srand48_r ((long int) t, &data);
+ for (i = 0; i < 50; i++)
+ if (drand48_r (&data, &d) != 0 || d < 0.0 || d >= 1.0)
+ {
+ printf ("drand48_r %d %g\n", i, d);
+ ret = 1;
+ }
+
+ buf[2] = (t & 0xffff0000) >> 16; buf[1] = (t & 0xffff); buf[0] = 0x330e;
+ for (i = 0; i < 50; i++)
+ if ((d = erand48 (buf)) < 0.0 || d >= 1.0)
+ {
+ printf ("erand48 %d %g\n", i, d);
+ ret = 1;
+ }
+
+ buf[2] = (t & 0xffff0000) >> 16; buf[1] = (t & 0xffff); buf[0] = 0x330e;
+ for (i = 0; i < 50; i++)
+ if (erand48_r (buf, &data, &d) != 0 || d < 0.0 || d >= 1.0)
+ {
+ printf ("erand48_r %d %g\n", i, d);
+ ret = 1;
+ }
+
+ srand48 ((long int) t);
+ for (i = 0; i < 50; i++)
+ if ((l = lrand48 ()) < 0 || l > INT32_MAX)
+ {
+ printf ("lrand48 %d %ld\n", i, l);
+ ret = 1;
+ }
+
+ srand48_r ((long int) t, &data);
+ for (i = 0; i < 50; i++)
+ if (lrand48_r (&data, &l) != 0 || l < 0 || l > INT32_MAX)
+ {
+ printf ("lrand48_r %d %ld\n", i, l);
+ ret = 1;
+ }
+
+ buf[2] = (t & 0xffff0000) >> 16; buf[1] = (t & 0xffff); buf[0] = 0x330e;
+ for (i = 0; i < 50; i++)
+ if ((l = nrand48 (buf)) < 0 || l > INT32_MAX)
+ {
+ printf ("nrand48 %d %ld\n", i, l);
+ ret = 1;
+ }
+
+ buf[2] = (t & 0xffff0000) >> 16; buf[1] = (t & 0xffff); buf[0] = 0x330e;
+ for (i = 0; i < 50; i++)
+ if (nrand48_r (buf, &data, &l) != 0 || l < 0 || l > INT32_MAX)
+ {
+ printf ("nrand48_r %d %ld\n", i, l);
+ ret = 1;
+ }
+
+ srand48 ((long int) t);
+ for (i = 0; i < 50; i++)
+ if ((l = mrand48 ()) < INT32_MIN || l > INT32_MAX)
+ {
+ printf ("mrand48 %d %ld\n", i, l);
+ ret = 1;
+ }
+
+ srand48_r ((long int) t, &data);
+ for (i = 0; i < 50; i++)
+ if (mrand48_r (&data, &l) != 0 || l < INT32_MIN || l > INT32_MAX)
+ {
+ printf ("mrand48_r %d %ld\n", i, l);
+ ret = 1;
+ }
+
+ buf[2] = (t & 0xffff0000) >> 16; buf[1] = (t & 0xffff); buf[0] = 0x330e;
+ for (i = 0; i < 50; i++)
+ if ((l = jrand48 (buf)) < INT32_MIN || l > INT32_MAX)
+ {
+ printf ("jrand48 %d %ld\n", i, l);
+ ret = 1;
+ }
+
+ buf[2] = (t & 0xffff0000) >> 16; buf[1] = (t & 0xffff); buf[0] = 0x330e;
+ for (i = 0; i < 50; i++)
+ if (jrand48_r (buf, &data, &l) != 0 || l < INT32_MIN || l > INT32_MAX)
+ {
+ printf ("jrand48_r %d %ld\n", i, l);
+ ret = 1;
+ }
+
+ return ret;
+}
--- libc/stdlib/tst-rand48.c 20 Jan 2001 03:32:19 -0000 1.1
+++ libc/stdlib/tst-rand48.c 19 Dec 2006 08:17:26 -0000 1.2
@@ -44,10 +44,10 @@ main (void)
}
l = mrand48 ();
- if (l != 0xa28c1003l)
+ if (l != -0x5d73effdl)
{
printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
- __LINE__ - 4, 0xa28c1003l, l);
+ __LINE__ - 4, -0x5d73effdl, l);
result = 1;
}
@@ -60,10 +60,10 @@ main (void)
}
l = mrand48 ();
- if (l != 0x9e88f474l)
+ if (l != -0x61770b8cl)
{
printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
- __LINE__ - 4, 0x9e88f474l, l);
+ __LINE__ - 4, -0x61770b8cl, l);
result = 1;
}
@@ -92,10 +92,10 @@ main (void)
}
l = mrand48 ();
- if (l != 0xeb7a1fa3l)
+ if (l != -0x1485e05dl)
{
printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
- __LINE__ - 4, 0xeb7a1fa3l, l);
+ __LINE__ - 4, -0x1485e05dl, l);
result = 1;
}
@@ -171,10 +171,10 @@ main (void)
}
l = mrand48 ();
- if (l != 0xa28c1003l)
+ if (l != -0x5d73effdl)
{
printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
- __LINE__ - 4, 0xa28c1003l, l);
+ __LINE__ - 4, -0x5d73effdl, l);
result = 1;
}
@@ -187,10 +187,10 @@ main (void)
}
l = mrand48 ();
- if (l != 0x9e88f474l)
+ if (l != -0x61770b8cl)
{
printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
- __LINE__ - 4, 0x9e88f474l, l);
+ __LINE__ - 4, -0x61770b8cl, l);
result = 1;
}
@@ -231,10 +231,10 @@ main (void)
}
l = mrand48 ();
- if (l != 0xeb7a1fa3l)
+ if (l != -0x1485e05dl)
{
printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
- __LINE__ - 4, 0xeb7a1fa3l, l);
+ __LINE__ - 4, -0x1485e05dl, l);
result = 1;
}
@@ -287,10 +287,10 @@ main (void)
}
l = jrand48 (xs);
- if (l != 0xf568c7a0l)
+ if (l != -0xa973860l)
{
printf ("jrand48() in line %d failed: expected %lx, seen %lx\n",
- __LINE__ - 4, 0xf568c7a0l, l);
+ __LINE__ - 4, -0xa973860l, l);
result = 1;
}
glibc-i386-syscall6.patch:
sysdep.h | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE glibc-i386-syscall6.patch ---
2006-10-11 Ulrich Drepper <drepper at redhat.com>
* sysdeps/unix/sysv/linux/i386/sysdep.h (DOARGS_6): Fix offset.
--- libc/sysdeps/unix/sysv/linux/i386/sysdep.h 1 Apr 2006 19:53:51 -0000 1.66
+++ libc/sysdeps/unix/sysv/linux/i386/sysdep.h 11 Oct 2006 20:15:14 -0000 1.67
@@ -297,7 +297,7 @@
cfi_restore (edi); L(POPDI1):
#define PUSHARGS_6 _PUSHARGS_6
-#define DOARGS_6 _DOARGS_6 (36)
+#define DOARGS_6 _DOARGS_6 (40)
#define POPARGS_6 _POPARGS_6
#define _PUSHARGS_6 pushl %ebp; cfi_adjust_cfa_offset (4); \
cfi_rel_offset (ebp, 0); L(PUSHBP1): _PUSHARGS_5
glibc-mai_IN.patch:
SUPPORTED | 1
locales/mai_IN | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 85 insertions(+)
--- NEW FILE glibc-mai_IN.patch ---
2006-11-02 Ulrich Drepper <drepper at redhat.com>
* locales/mai_IN: New file.
Provided by Rajesh Ranjan <rajeshkajha at yahoo.com>.
* SUPPORTED: Add mai_IN/UTF-8.
--- libc/localedata/locales/mai_IN 1970-01-01 01:00:00.000000000 +0100
+++ libc/localedata/locales/mai_IN 2006-11-03 17:12:14.000000000 +0100
@@ -0,0 +1,84 @@
+comment_char %
+escape_char /
+% Maithili language locale for India.
+% Contributed by Rajesh Ranjan <rajeshkajha at yahoo.com> and
+% Sangeeta Kumari <sangeeta09 at gmail.com>.
+
+LC_IDENTIFICATION
+title "Maithili language locale for India"
+source "Maithili Computing Research Center, Pune, India"
+address "B-3/302, Lunkad Daffodills, Viman Nagar, Pune, India"
+contact ""
+email "rajeshkajha at yahoo.com"
+tel ""
+fax ""
+language "Maithili"
+territory "India"
+revision "1.0"
+date "2006-11-01"
+%
+category "mai_IN:2006";LC_IDENTIFICATION
+category "mai_IN:2006";LC_CTYPE
+category "mai_IN:2006";LC_COLLATE
+category "mai_IN:2006";LC_TIME
+category "mai_IN:2006";LC_NUMERIC
+category "mai_IN:2006";LC_MONETARY
+category "mai_IN:2006";LC_MESSAGES
+category "mai_IN:2006";LC_PAPER
+category "mai_IN:2006";LC_NAME
+category "mai_IN:2006";LC_ADDRESS
+category "mai_IN:2006";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
+copy "hi_IN"
+END LC_TIME
+
+
+LC_MESSAGES
+copy "hi_IN"
+END LC_MESSAGES
+
+
+LC_PAPER
+copy "hi_IN"
+END LC_PAPER
+
+
+LC_NAME
+copy "hi_IN"
+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
--- libc/localedata/SUPPORTED 2006-09-29 22:49:04.000000000 +0200
+++ libc/localedata/SUPPORTED 2006-11-03 17:12:14.000000000 +0100
@@ -255,6 +255,7 @@ lt_LT.UTF-8/UTF-8 \
lt_LT/ISO-8859-13 \
lv_LV.UTF-8/UTF-8 \
lv_LV/ISO-8859-13 \
+mai_IN/UTF-8 \
mg_MG.UTF-8/UTF-8 \
mg_MG/ISO-8859-15 \
mi_NZ.UTF-8/UTF-8 \
glibc-memusage.patch:
memusage.c | 38 ++++++++++++++++++++++++++++++++------
memusagestat.c | 4 ++--
2 files changed, 34 insertions(+), 8 deletions(-)
--- NEW FILE glibc-memusage.patch ---
2006-12-08 Ulrich Drepper <drepper at redhat.com>
* malloc/memusage.c: Handle realloc with new size of zero and
non-NULL pointer correctly.
(me): Really write first record twice.
(struct entry): Make format bi-arch safe.
(dest): Write out more realloc statistics.
* malloc/memusagestat.c (struct entry): Make format bi-arch safe.
--- libc/malloc/memusage.c 3 Nov 2006 17:00:19 -0000 1.16
+++ libc/malloc/memusage.c 8 Dec 2006 17:13:24 -0000 1.17
@@ -80,6 +80,7 @@ static memusage_cntr_t large;
static memusage_cntr_t calls_total;
static memusage_cntr_t inplace;
static memusage_cntr_t decreasing;
+static memusage_cntr_t realloc_free;
static memusage_cntr_t inplace_mremap;
static memusage_cntr_t decreasing_mremap;
static memusage_size_t current_heap;
@@ -103,8 +104,8 @@ extern const char *__progname;
struct entry
{
- size_t heap;
- size_t stack;
+ uint64_t heap;
+ uint64_t stack;
uint32_t time_low;
uint32_t time_high;
};
@@ -267,6 +268,7 @@ me (void)
GETTIME (first.time_low, first.time_high);
/* Write it two times since we need the starting and end time. */
write (fd, &first, sizeof (first));
+ write (fd, &first, sizeof (first));
/* Determine the buffer size. We use the default if the
environment variable is not present. */
@@ -411,6 +413,23 @@ realloc (void *old, size_t len)
/* Keep track of total memory requirement. */
atomic_add (&grand_total, len - old_len);
}
+
+ if (len == 0 && old != NULL)
+ {
+ /* Special case. */
+ atomic_increment (&realloc_free);
+ /* Keep track of total memory freed using `free'. */
+ atomic_add (&total[idx_free], real->length);
+
+ /* Update the allocation data and write out the records if necessary. */
+ update_data (NULL, 0, old_len);
+
+ /* Do the real work. */
+ (*freep) (real);
+
+ return NULL;
+ }
+
/* Remember the size of the request. */
if (len < 65536)
atomic_increment (&histogram[len / 16]);
@@ -770,7 +789,12 @@ dest (void)
if (fd != -1)
{
/* Write the partially filled buffer. */
- write (fd, buffer, buffer_cnt * sizeof (struct entry));
+ if (buffer_cnt > buffer_size)
+ write (fd, buffer + buffer_size,
+ (buffer_cnt - buffer_size) * sizeof (struct entry));
+ else
+ write (fd, buffer, buffer_cnt * sizeof (struct entry));
+
/* Go back to the beginning of the file. We allocated two records
here when we opened the file. */
lseek (fd, 0, SEEK_SET);
@@ -794,7 +818,7 @@ dest (void)
\e[01;32mMemory usage summary:\e[0;0m heap total: %llu, heap peak: %lu, stack peak: %lu\n\
\e[04;34m total calls total memory failed calls\e[0m\n\
\e[00;34m malloc|\e[0m %10lu %12llu %s%12lu\e[00;00m\n\
-\e[00;34mrealloc|\e[0m %10lu %12llu %s%12lu\e[00;00m (in place: %ld, dec: %ld)\n\
+\e[00;34mrealloc|\e[0m %10lu %12llu %s%12lu\e[00;00m (nomove:%ld, dec:%ld, free:%ld)\n\
\e[00;34m calloc|\e[0m %10lu %12llu %s%12lu\e[00;00m\n\
\e[00;34m free|\e[0m %10lu %12llu\n",
(unsigned long long int) grand_total, (unsigned long int) peak_heap,
@@ -807,7 +831,9 @@ dest (void)
(unsigned long long int) total[idx_realloc],
failed[idx_realloc] ? "\e[01;41m" : "",
(unsigned long int) failed[idx_realloc],
- (unsigned long int) inplace, (unsigned long int) decreasing,
+ (unsigned long int) inplace,
+ (unsigned long int) decreasing,
+ (unsigned long int) realloc_free,
(unsigned long int) calls[idx_calloc],
(unsigned long long int) total[idx_calloc],
failed[idx_calloc] ? "\e[01;41m" : "",
@@ -820,7 +846,7 @@ dest (void)
\e[00;34mmmap(r)|\e[0m %10lu %12llu %s%12lu\e[00;00m\n\
\e[00;34mmmap(w)|\e[0m %10lu %12llu %s%12lu\e[00;00m\n\
\e[00;34mmmap(a)|\e[0m %10lu %12llu %s%12lu\e[00;00m\n\
-\e[00;34m mremap|\e[0m %10lu %12llu %s%12lu\e[00;00m (in place: %ld, dec: %ld)\n\
+\e[00;34m mremap|\e[0m %10lu %12llu %s%12lu\e[00;00m (nomove: %ld, dec:%ld)\n\
\e[00;34m munmap|\e[0m %10lu %12llu %s%12lu\e[00;00m\n",
(unsigned long int) calls[idx_mmap_r],
(unsigned long long int) total[idx_mmap_r],
--- libc/malloc/memusagestat.c 10 Nov 2006 20:54:46 -0000 1.9
+++ libc/malloc/memusagestat.c 8 Dec 2006 17:13:51 -0000 1.10
@@ -81,8 +81,8 @@ static struct argp argp =
struct entry
{
- size_t heap;
- size_t stack;
+ uint64_t heap;
+ uint64_t stack;
uint32_t time_low;
uint32_t time_high;
};
glibc-nis+-getenv.patch:
nis/nis_defaults.c | 2 +-
sysdeps/generic/unsecvars.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
--- NEW FILE glibc-nis+-getenv.patch ---
2006-12-05 Jakub Jelinek <jakub at redhat.com>
* nis/nis_subr.c (nis_getnames): Revert last change.
2006-10-11 Jakub Jelinek <jakub at redhat.com>
* nis/nis_defaults.c (__nis_default_access): Don't call getenv twice.
* nis/nis_subr.c (nis_getnames): Use __secure_getenv instead of getenv.
* sysdeps/generic/unsecvars.h: Add NIS_PATH.
--- libc/nis/nis_defaults.c 10 May 2006 02:54:46 -0000 1.8
+++ libc/nis/nis_defaults.c 11 Oct 2006 16:22:34 -0000 1.9
@@ -447,7 +447,7 @@ __nis_default_access (char *param, unsig
{
cptr = getenv ("NIS_DEFAULTS");
if (cptr != NULL && strstr (cptr, "access=") != NULL)
- result = searchaccess (getenv ("NIS_DEFAULTS"), result);
+ result = searchaccess (cptr, result);
}
return result;
--- libc/sysdeps/generic/unsecvars.h 6 Jan 2005 22:40:19 -0000 1.8
+++ libc/sysdeps/generic/unsecvars.h 11 Oct 2006 16:24:05 -0000 1.9
@@ -18,6 +18,7 @@
"LOCALDOMAIN\0" \
"LOCPATH\0" \
"MALLOC_TRACE\0" \
+ "NIS_PATH\0" \
"NLSPATH\0" \
"RESOLV_HOST_CONF\0" \
"RES_OPTIONS\0" \
glibc-nptl_db-dtvp.patch:
db_info.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE glibc-nptl_db-dtvp.patch ---
2006-10-26 Pete Eberlein <eberlein at us.ibm.com>
* nptl_db/db_info.c [TLS_DTV_AT_TP]: Fixed size init for dtvp
to sizeof a pointer, instead of sizeof the union.
--- libc/nptl_db/db_info.c 14 Mar 2004 03:39:57 -0000 1.5
+++ libc/nptl_db/db_info.c 31 Oct 2006 17:33:49 -0000 1.6
@@ -59,7 +59,7 @@ typedef struct link_map link_map;
i.e. at the very end of the area covered by TLS_PRE_TCB_SIZE. */
DESC (_thread_db_pthread_dtvp,
TLS_PRE_TCB_SIZE + offsetof (tcbhead_t, dtv)
- - (TLS_TCB_SIZE == 0 ? sizeof (tcbhead_t) : 0), union dtv)
+ - (TLS_TCB_SIZE == 0 ? sizeof (tcbhead_t) : 0), union dtv *)
#endif
glibc-po-update.patch:
nl.po | 9753 ++++++++++++++++++++++++++++++++++--------------------------------
pl.po | 9355 +++++++++++++++++++++++++++++++++------------------------------
sv.po | 9608 ++++++++++++++++++++++++++++++++++-------------------------------
tr.po | 9552 +++++++++++++++++++++++++++++++++++-----------------------------
4 files changed, 20323 insertions(+), 17945 deletions(-)
--- NEW FILE glibc-po-update.patch ---
2006-11-14 Ulrich Drepper <drepper at redhat.com>
* po/nl.po: Update from translation team.
2006-11-10 Ulrich Drepper <drepper at redhat.com>
* po/sv.po: Update from translation team.
2006-11-01 Ulrich Drepper <drepper at redhat.com>
* po/sv.po: Update from translation team.
2006-10-29 Ulrich Drepper <drepper at redhat.com>
* po/sv.po: Update from translation team.
2006-10-09 Ulrich Drepper <drepper at redhat.com>
* po/sv.po: Update from translation team.
2006-10-07 Ulrich Drepper <drepper at redhat.com>
* po/tr.po: Update from translation team.
2006-10-06 Ulrich Drepper <drepper at redhat.com>
* po/pl.po: Update from translation team.
--- libc/po/nl.po 2006-09-23 12:14:26.000000000 +0200
+++ libc/po/nl.po 2006-11-20 11:03:34.000000000 +0100
@@ -1,3725 +1,4478 @@
-# Dutch translation of libc.
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Translation of libc-2.5 to Dutch.
+# Copyright (C) 2004, 2006 Free Software Foundation, Inc.
# Elros Cyriatan <cyriatan at fastmail.fm>, 2004.
-#
-#
+# Benno Schulenberg <benno at nietvergeten.nl>, 2006.
+#
msgid ""
msgstr ""
-"Project-Id-Version: libc 2.3.3\n"
+"Project-Id-Version: libc 2.5\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2004-08-05 09:16+0200\n"
-"PO-Revision-Date: 2004-08-05 15:52+0200\n"
-"Last-Translator: Elros Cyriatan <cyriatan at fastmail.fm>\n"
-"Language-Team: Dutch <vertaling at nl.linux.org>\n"
+"POT-Creation-Date: 2006-09-29 11:38-0700\n"
+"PO-Revision-Date: 2006-11-14 19:50+0100\n"
+"Last-Translator: Benno Schulenberg <benno at nietvergeten.nl>\n"
+"Language-Team: Dutch <vertaling at vrijschrift.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: sysdeps/generic/siglist.h:29 stdio-common/../sysdeps/unix/siglist.c:27
-msgid "Hangup"
-msgstr "Ophangen"
+#: argp/argp-help.c:227
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: Parameter van ARGP_HELP_FMT vereist een waarde"
-#: sysdeps/generic/siglist.h:30 stdio-common/../sysdeps/unix/siglist.c:28
-msgid "Interrupt"
-msgstr "Onderbreken"
+#: argp/argp-help.c:237
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Onbekende parameter van ARGP_HELP_FMT"
-#: sysdeps/generic/siglist.h:31 stdio-common/../sysdeps/unix/siglist.c:29
-msgid "Quit"
-msgstr "Afsluiten"
+#: argp/argp-help.c:250
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Rommel in ARGP_HELP_FMT: %s"
-#: sysdeps/generic/siglist.h:32 stdio-common/../sysdeps/unix/siglist.c:30
-msgid "Illegal instruction"
-msgstr "Ongeldige instructie"
+#: argp/argp-help.c:1214
+msgid "Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options."
+msgstr ""
+"Een argument dat verplicht of optioneel is voor een lange optie, is dat\n"
+"ook voor de overeenkomstige korte optie."
-#: sysdeps/generic/siglist.h:33 stdio-common/../sysdeps/unix/siglist.c:31
-msgid "Trace/breakpoint trap"
-msgstr "Traceer/breekpunt val"
+#: argp/argp-help.c:1600
+msgid "Usage:"
+msgstr "Gebruik: "
-#: sysdeps/generic/siglist.h:34
-msgid "Aborted"
-msgstr "Geannuleerd"
+#: argp/argp-help.c:1604
+msgid " or: "
+msgstr " of: "
-#: sysdeps/generic/siglist.h:35 stdio-common/../sysdeps/unix/siglist.c:34
-msgid "Floating point exception"
-msgstr "Zwevende-punt uitzondering"
+#: argp/argp-help.c:1616
+msgid " [OPTION...]"
+msgstr " [OPTIE...]"
-#: sysdeps/generic/siglist.h:36 stdio-common/../sysdeps/unix/siglist.c:35
-msgid "Killed"
-msgstr "Gedood"
+#: argp/argp-help.c:1643
+#, c-format
+msgid "Try `%s --help' or `%s --usage' for more information.\n"
+msgstr "Probeer '%s --help' of '%s --usage' voor meer informatie.\n"
-#: sysdeps/generic/siglist.h:37 stdio-common/../sysdeps/unix/siglist.c:36
-msgid "Bus error"
-msgstr "Bus fout"
+#: argp/argp-help.c:1671
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+"Rapporteer fouten in het programma aan %s,\n"
+"en gebreken in de vertaling aan <vertaling at vrijschrift.org>.\n"
-#: sysdeps/generic/siglist.h:38 stdio-common/../sysdeps/unix/siglist.c:37
-msgid "Segmentation fault"
-msgstr "Segmentatie fout"
+#: argp/argp-parse.c:102
+msgid "Give this help list"
+msgstr "deze hulptekst tonen"
-#. TRANS Broken pipe; there is no process reading from the other end of a pipe.
-#. TRANS Every library function that returns this error code also generates a
-#. TRANS @code{SIGPIPE} signal; this signal terminates the program if not handled
-#. TRANS or blocked. Thus, your program will never actually see @code{EPIPE}
-#. TRANS unless it has handled or blocked @code{SIGPIPE}.
-#: sysdeps/generic/siglist.h:39 stdio-common/../sysdeps/gnu/errlist.c:351
-#: stdio-common/../sysdeps/unix/siglist.c:39
-#: stdio-common/../sysdeps/unix/sysv/sysv4/solaris2/sparc/errlist.c:62
-msgid "Broken pipe"
-msgstr "Gebroken pijp"
+#: argp/argp-parse.c:103
+msgid "Give a short usage message"
+msgstr "een kort gebruiksbericht tonen"
-#: sysdeps/generic/siglist.h:40 stdio-common/../sysdeps/unix/siglist.c:40
-msgid "Alarm clock"
-msgstr "Alarmklok"
+#: argp/argp-parse.c:104
+msgid "Set the program name"
+msgstr "de programmanaam instellen"
-#: sysdeps/generic/siglist.h:41 stdio-common/../sysdeps/unix/siglist.c:41
-msgid "Terminated"
-msgstr "Afgebroken"
+#: argp/argp-parse.c:106
+msgid "Hang for SECS seconds (default 3600)"
+msgstr "dit aantal seconden pauzeren (standaard 3600)"
-#: sysdeps/generic/siglist.h:42 stdio-common/../sysdeps/unix/siglist.c:42
-msgid "Urgent I/O condition"
-msgstr "Spoedeisende I/O-omstandigheid"
+#: argp/argp-parse.c:167
+msgid "Print program version"
+msgstr "programmaversie tonen"
-#: sysdeps/generic/siglist.h:43 stdio-common/../sysdeps/unix/siglist.c:43
-msgid "Stopped (signal)"
-msgstr "Gestopt (signaal)"
+#: argp/argp-parse.c:183
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "**Interne programmafout**: geen versie bekend!?"
-#: sysdeps/generic/siglist.h:44 stdio-common/../sysdeps/unix/siglist.c:44
-msgid "Stopped"
-msgstr "Gestopt"
+#: argp/argp-parse.c:623
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Te veel argumenten\n"
-#: sysdeps/generic/siglist.h:45 stdio-common/../sysdeps/unix/siglist.c:45
-msgid "Continued"
-msgstr "Doorgegaan"
+#: argp/argp-parse.c:766
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "**Interne programmafout**: optie had herkend moeten worden!?"
-#: sysdeps/generic/siglist.h:46 stdio-common/../sysdeps/unix/siglist.c:46
-msgid "Child exited"
-msgstr "Kind is afgesloten"
+#: assert/assert-perr.c:57
[...43755 lines suppressed...]
-#: elf/ldconfig.c:832
-#, c-format
-msgid "libc4 library %s in wrong directory"
-msgstr "libc4 kitaplıÄı %s yanlıŠdizinde"
+#~ msgid "Error 136"
+#~ msgstr "Hata 136"
-#: elf/ldconfig.c:859
-#, c-format
-msgid "libraries %s and %s in directory %s have same soname but different type."
-msgstr "%s ve %s kitaplıkları %s dizininde ve aynı isme sahip oldukları halde farklı türde."
+#~ msgid "Not available"
+#~ msgstr "Ä°Åe yaramaz"
-#: elf/ldconfig.c:962
-#, c-format
-msgid "Can't open configuration file %s"
-msgstr "Yapılandırma dosyası %s açılamıyor"
+#~ msgid "Is a name file"
+#~ msgstr "Bir \"name\" dosyası"
-#: elf/ldconfig.c:1033
-#, c-format
-msgid "relative path `%s' used to build cache"
-msgstr "arabelleÄin oluÅturulduÄu göreli yol `%s'"
+#~ msgid "Reserved for future use"
+#~ msgstr "İlerde kullanmak üzere ayrıldı"
-#: elf/ldconfig.c:1057
-msgid "Can't chdir to /"
-msgstr "/ dizinine geçilemiyor"
+#~ msgid "Error 142"
+#~ msgstr "Hata 142"
-#: elf/ldconfig.c:1099
-#, c-format
-msgid "Can't open cache file directory %s\n"
-msgstr "Arabellek dosyasının dizini %s açılamıyor\n"
+#~ msgid "Cannot send after socket shutdown"
+#~ msgstr "Soket kapandıktan sonra yollanamaz"
-#: elf/readlib.c:98
-#, c-format
-msgid "Cannot fstat file %s.\n"
-msgstr "%s dosyası fstat yapılamıyor.\n"
+#~ msgid "%s: Can't unlink %s: %s\n"
+#~ msgstr "%s: %s baÄı kaldırılamıyor: %s\n"
-#: elf/readlib.c:108
-#, c-format
-msgid "File %s is too small, not checked."
-msgstr "%s dosyası çok küçük, kontrol edilemedi."
+#~ msgid "no day in month matches rule"
+#~ msgstr "ay içinde kurala uyan gün yok"
-#: elf/readlib.c:117
-#, c-format
-msgid "Cannot mmap file %s.\n"
-msgstr "%s dosyası mmap yapılamıyor.\n"
+#~ msgid "%s: line %d: expected service, found `%s'\n"
+#~ msgstr "%s: satır %d: `%s' bir servis olmalıydı\n"
-#: elf/readlib.c:155
-#, c-format
-msgid "%s is not an ELF file - it has the wrong magic bytes at the start.\n"
-msgstr "%s bir ELF dosyası deÄil - BaÅlangıcındaki dosya tanımı hatalı.\n"
+#~ msgid "%s: line %d: cannot specify more than %d services"
+#~ msgstr "%s: satır %d: en çok %d servis belirtilebilir"
-#: elf/sprof.c:72
-msgid "Output selection:"
-msgstr "Ãıktı seçimi:"
+#~ msgid "%s: line %d: list delimiter not followed by keyword"
+#~ msgstr "%s: satır %d: liste ayracından sonra bir anahtar sözcük gelmemeli"
-#: elf/sprof.c:74
-msgid "print list of count paths and their number of use"
-msgstr "sayım yollarının listesini ve kullanımdaki miktarını basar"
+#~ msgid "getent - get entries from administrative database."
+#~ msgstr "getent - yönetim veritabanından girdiler alınıyor."
-#: elf/sprof.c:76
-msgid "generate flat profile with counts and ticks"
-msgstr "sayım ve darbelerle düz kesit üretir"
+#~ msgid "get_myaddress: ioctl (get interface configuration)"
+#~ msgstr "get_myaddress: ioctl (arayüz yapılandırması alır)"
-#: elf/sprof.c:77
-msgid "generate call graph"
-msgstr "çaÄrı grafiÄi üretir"
+#~ msgid "__get_myaddress: ioctl (get interface configuration)"
+#~ msgstr "__get_myaddress: ioctl (arayüz yapılandırmasını alır)"
-#: elf/sprof.c:84
-msgid "Read and display shared object profiling data"
-msgstr "PaylaÅımlı nesne Åekillendirici verisini okur ve gösterir"
+#~ msgid "broadcast: ioctl (get interface configuration)"
+#~ msgstr "broadcast: ioctl (arayüz yapılandırmasını alır)"
-#: elf/sprof.c:87
-msgid "SHOBJ [PROFDATA]"
-msgstr "SHOBJ [PROFDATA]"
+#~ msgid "broadcast: ioctl (get interface flags)"
+#~ msgstr "broadcast: ioctl (arayüz flamalarını alır)"
-#: elf/sprof.c:398
-#, c-format
-msgid "failed to load shared object `%s'"
-msgstr "paylaÅımlı nesne `%s' yüklenemedi"
+#~ msgid "YPBINDPROC_DOMAIN: %s\n"
+#~ msgstr "YPBINDPROC_DOMAIN: %s\n"
-#: elf/sprof.c:407
-msgid "cannot create internal descriptors"
-msgstr "iç tanıtıcılar oluÅturulamıyor"
+#~ msgid "while allocating hash table entry"
+#~ msgstr "arama (hash) tablosu girdisi ayrılırken"
-#: elf/sprof.c:526
-#, c-format
-msgid "Reopening shared object `%s' failed"
-msgstr "`%s' paylaÅımlı nesnesinin yeniden açılması baÅarısız"
+#~ msgid "Cannot run nscd in secure mode as unprivileged user"
+#~ msgstr "nscd güvenli kipte yetkisiz kullanıcı olarak çalıÅtırılamaz"
-#: elf/sprof.c:534
-msgid "mapping of section headers failed"
-msgstr "bölüm baÅlıkları eÅlemi baÅarısız"
-
-#: elf/sprof.c:544
-msgid "mapping of section header string table failed"
-msgstr "bölüm baÅlık dizgeleri tablosunun eÅlemi baÅarısız"
+#~ msgid "while allocating cache: %s"
+#~ msgstr "arabellek girdisi ayrılırken: %s"
-#: elf/sprof.c:564
-#, c-format
-msgid "*** The file `%s' is stripped: no detailed analysis possible\n"
-msgstr "*** `%s' dosyası lime lime edildi: detaylı çözümleme mümkün deÄil\n"
+#~ msgid "while accepting connection: %s"
+#~ msgstr "baÄlantı kabul edilirken: %s"
-#: elf/sprof.c:594
-msgid "failed to load symbol data"
-msgstr "sembol verisi yüklenemedi"
+#~ msgid "while allocating key copy"
+#~ msgstr "tuŠkopyası ayrılırken"
-#: elf/sprof.c:664
-msgid "cannot load profiling data"
-msgstr "Åekillendirici verisi yüklenemiyor"
+#~ msgid "while allocating cache entry"
+#~ msgstr "arabellek girdisi ayrılırken"
-#: elf/sprof.c:673
-msgid "while stat'ing profiling data file"
-msgstr "Åekillendirici veri dosyası durumlanırken"
+#~ msgid "Haven't found \"%d\" in group cache!"
+#~ msgstr "\"%d\" grup arabelleÄinde yok!"
-#: elf/sprof.c:681
-#, c-format
-msgid "profiling data file `%s' does not match shared object `%s'"
-msgstr "Åekillendirme veri dosyası `%s' paylaÅımlı nesne `%s' ile uyuÅmuyor"
+#~ msgid "%15lu number of times clients had to wait\n"
+#~ msgstr "%15lu kere istemciler beklemeye alındı\n"
-#: elf/sprof.c:692
-msgid "failed to mmap the profiling data file"
-msgstr "Åekillendirme verisi dosyası mmap olamadı"
+#~ msgid " no"
+#~ msgstr " hayır"
-#: elf/sprof.c:700
-msgid "error while closing the profiling data file"
-msgstr "Åekillendirici verisi dosyası kapatılırken hata"
+#~ msgid " yes"
+#~ msgstr " evet"
-#: elf/sprof.c:709 elf/sprof.c:779
-msgid "cannot create internal descriptor"
-msgstr "iç tanıtıcı oluÅturulamıyor"
+#~ msgid "Haven't found \"%d\" in password cache!"
+#~ msgstr "\"%d\" parola arabelleÄinde yok!"
-#: elf/sprof.c:755
-#, c-format
-msgid "`%s' is no correct profile data file for `%s'"
-msgstr "`%s' `%s' için doÄru olmayan Åekillendirici verisi dosyası"
+#~ msgid "%s: profiler out of memory shadowing PLTREL of %s\n"
+#~ msgstr "%s: %s PLTREL gölgelenirken profiler bellekdıÅı\n"
-#: elf/sprof.c:936 elf/sprof.c:988
-msgid "cannot allocate symbol data"
-msgstr "sembol verisi ayrılamadı"
+#~ msgid "Read and display shared object profiling data"
+#~ msgstr "PaylaÅımlı nesne Åekillendirici verisini okur ve gösterir"
#~ msgid "shared object cannot be dlopen()ed: static TLS memory too small"
#~ msgstr "paylaÅımlı nesne dlopen()'lanamıyor: statik TLS belleÄi çok küçük"
glibc-powerpc-cpu-addon-update.patch:
ChangeLog | 83
sysdeps/powerpc/powerpc32/970/Implies | 1
sysdeps/powerpc/powerpc32/power4/Implies | 1
sysdeps/powerpc/powerpc32/power4/Makefile | 6
sysdeps/powerpc/powerpc32/power4/fpu/Makefile | 5
sysdeps/powerpc/powerpc32/power4/fpu/mpa.c | 549 ++++++
sysdeps/powerpc/powerpc32/power4/fpu/slowpow.c | 94 +
sysdeps/powerpc/powerpc32/power4/memcopy.h | 113 +
sysdeps/powerpc/powerpc32/power4/wordcopy.c | 209 ++
sysdeps/powerpc/powerpc32/power5+/Implies | 1
sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S | 60
sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S | 2
sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S | 58
sysdeps/powerpc/powerpc32/power5/Implies | 1
sysdeps/powerpc/powerpc32/power6/Implies | 1
sysdeps/powerpc/powerpc32/power6/memcpy.S | 842 ++++++++++
sysdeps/powerpc/powerpc32/power6/wordcopy.c | 287 +++
sysdeps/powerpc/powerpc32/power6x/Implies | 3
sysdeps/powerpc/powerpc32/power6x/fpu/Implies | 3
sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S | 42
sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S | 52
sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llround.S | 97 +
sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llroundf.S | 1
sysdeps/powerpc/powerpc64/970/fpu/Implies | 1
sysdeps/powerpc/powerpc64/power4/Makefile | 6
sysdeps/powerpc/powerpc64/power4/fpu/Makefile | 5
sysdeps/powerpc/powerpc64/power4/fpu/mpa.c | 549 ++++++
sysdeps/powerpc/powerpc64/power4/fpu/slowpow.c | 94 +
sysdeps/powerpc/powerpc64/power4/memcopy.h | 1
sysdeps/powerpc/powerpc64/power4/wordcopy.c | 1
sysdeps/powerpc/powerpc64/power5+/fpu/Implies | 1
sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S | 59
sysdeps/powerpc/powerpc64/power5/fpu/Implies | 1
sysdeps/powerpc/powerpc64/power6/fpu/Implies | 1
sysdeps/powerpc/powerpc64/power6/wordcopy.c | 410 ++++
sysdeps/powerpc/powerpc64/power6x/Implies | 2
sysdeps/powerpc/powerpc64/power6x/fpu/Implies | 3
sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S | 45
sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S | 55
sysdeps/unix/sysv/linux/powerpc/powerpc32/power6x/fpu/Implies | 4
sysdeps/unix/sysv/linux/powerpc/powerpc64/970/fpu/Implies | 1
sysdeps/unix/sysv/linux/powerpc/powerpc64/power4/fpu/Implies | 1
sysdeps/unix/sysv/linux/powerpc/powerpc64/power5/fpu/Implies | 1
sysdeps/unix/sysv/linux/powerpc/powerpc64/power6x/fpu/Implies | 4
44 files changed, 3756 insertions(+)
--- NEW FILE glibc-powerpc-cpu-addon-update.patch ---
--- libc/powerpc-cpu/ChangeLog 2006-09-15 16:40:36.000000000 +0200
+++ libc/powerpc-cpu/ChangeLog 2006-10-20 22:32:19.000000000 +0200
@@ -1,3 +1,86 @@
+2006-10-20 Steven Munroe <sjmunroe at us.ibm.com>
+
+ * sysdeps/powerpc/powerpc32/power4/fpu/slowpow.c: New file.
+ * sysdeps/powerpc/powerpc64/power4/fpu/slowpow.c: New file.
+
+2006-10-03 Steven Munroe <sjmunroe at us.ibm.com>
+
+ * sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llround.S: New file.
+ * sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llroundf.S: New file.
+
+ * sysdeps/powerpc/powerpc32/powerpc64/Makefile: Moved.
+ * sysdeps/powerpc/powerpc32/powerpc64/memcopy.h: Likewise.
+ * sysdeps/powerpc/powerpc32/powerpc64/wordcopy.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/Makefile: To here.
+ * sysdeps/powerpc/powerpc32/power4/memcopy.h: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/wordcopy.c: Likewise.
+
+ * sysdeps/powerpc/powerpc32/powerpc64/fpu/Makefile: Moved.
+ * sysdeps/powerpc/powerpc32/powerpc64/fpu/mpa.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/fpu/Makefile: To here.
+ * sysdeps/powerpc/powerpc32/power4/fpu/mpa.c: Likewise.
+
+2006-09-29 Steven Munroe <sjmunroe at us.ibm.com>
+
+ * sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S: New file.
+ * sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S: New file.
+ * sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S: New file.
+ * sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S: New file.
+
+2006-09-28 Steven Munroe <sjmunroe at us.ibm.com>
+
+ * sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S: New file.
+ * sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S: New file.
+ * sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S: New file.
+ * sysdeps/powerpc/powerpc32/power6x/Implies: New file.
+ * sysdeps/powerpc/powerpc32/power6x/fpu/Implies: New file.
+ * sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S: New file.
+ * sysdeps/powerpc/powerpc64/power6x/Implies: New file.
+ * sysdeps/powerpc/powerpc64/power6x/fpu/Implies: New file.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/power6x/fpu/Implies:
+ New file.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/power6x/fpu/Implies:
+ New file.
+
+2006-09-10 Steven Munroe <sjmunroe at us.ibm.com>
+
+ * sysdeps/powerpc/powerpc32/power6/memcpy.S: New file.
+
+2006-08-31 Steven Munroe <sjmunroe at us.ibm.com>
+
+ * sysdeps/powerpc/powerpc32/970/Implies: Add
+ powerpc/powerpc32/powerpc64 to pick up memcopy.h and wordcopy.c
+ * sysdeps/powerpc/powerpc32/power4/Implies: New file.
+ * sysdeps/powerpc/powerpc32/power5/Implies: Add
+ powerpc/powerpc32/powerpc64 to pick up memcopy.h and wordcopy.c
+ * sysdeps/powerpc/powerpc32/power5+/Implies: Add
+ powerpc/powerpc32/powerpc64 to pick up memcopy.h and wordcopy.c
+ * sysdeps/powerpc/powerpc32/power6/Implies: Add
+ powerpc/powerpc32/powerpc64 to pick up memcopy.h and wordcopy.c
+ * sysdeps/powerpc/powerpc32/power6/wordcopy.c: New file.
+ * sysdeps/powerpc/powerpc32/powerpc64/Makefile: New file.
+ * sysdeps/powerpc/powerpc32/powerpc64/memcopy.h: New file.
+ * sysdeps/powerpc/powerpc32/powerpc64/wordcopy.c: New file.
+ * sysdeps/powerpc/powerpc32/powerpc64/fpu/Makefile: New file.
+ * sysdeps/powerpc/powerpc32/powerpc64/fpu/mpa.c: New file.
+ * sysdeps/powerpc/powerpc64/970/fpu/Implies: New file.
+ * sysdeps/powerpc/powerpc64/power4/Makefile: New file.
+ * sysdeps/powerpc/powerpc64/power4/fpu/Makefile: New file.
+ * sysdeps/powerpc/powerpc64/power4/fpu/mpa.c: New file.
+ * sysdeps/powerpc/powerpc64/power4/memcopy.h: New file.
+ * sysdeps/powerpc/powerpc64/power4/wordcopy.c: New file.
+ * sysdeps/powerpc/powerpc64/power5+/fpu/Implies: New file.
+ * sysdeps/powerpc/powerpc64/power6/fpu/Implies: Add
+ powerpc/powerpc64/power4/fpu to pick up optimized mpa.c.
+ * sysdeps/powerpc/powerpc64/power6/wordcopy.c: New file.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/970/fpu/Implies: New file.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/malloc-machine.h: New file.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/power4/fpu/Implies: New
+ file.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/power5/fpu/Implies: New
+ file.
+
+
2006-07-06 Steven Munroe <sjmunroe at us.ibm.com>
* sysdeps/powerpc/powerpc64/power6/memcpy.S: New file.
--- libc/powerpc-cpu/sysdeps/powerpc/powerpc32/970/Implies 2006-09-15 16:40:36.000000000 +0200
+++ libc/powerpc-cpu/sysdeps/powerpc/powerpc32/970/Implies 2006-08-20 12:18:23.000000000 +0200
@@ -1 +1,2 @@
powerpc/powerpc32/power4
+powerpc/powerpc32/powerpc64
--- libc/powerpc-cpu/sysdeps/powerpc/powerpc32/power4/fpu/Makefile 1970-01-01 01:00:00.000000000 +0100
+++ libc/powerpc-cpu/sysdeps/powerpc/powerpc32/power4/fpu/Makefile 2006-10-10 16:58:56.000000000 +0200
@@ -0,0 +1,5 @@
+# Makefile fragment for POWER4/5/5+ with FPU.
+
+ifeq ($(subdir),math)
+CFLAGS-mpa.c += --param max-unroll-times=4 -funroll-loops -fpeel-loops -ftree-loop-linear
+endif
--- libc/powerpc-cpu/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c 1970-01-01 01:00:00.000000000 +0100
+++ libc/powerpc-cpu/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c 2006-10-10 16:58:56.000000000 +0200
@@ -0,0 +1,549 @@
+
+/*
+ * IBM Accurate Mathematical Library
+ * written by International Business Machines Corp.
+ * Copyright (C) 2001, 2006 Free Software Foundation
+ *
+ * This program 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.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+/************************************************************************/
+/* MODULE_NAME: mpa.c */
+/* */
+/* FUNCTIONS: */
+/* mcr */
+/* acr */
+/* cr */
+/* cpy */
+/* cpymn */
+/* norm */
+/* denorm */
+/* mp_dbl */
+/* dbl_mp */
+/* add_magnitudes */
+/* sub_magnitudes */
+/* add */
+/* sub */
+/* mul */
+/* inv */
+/* dvd */
+/* */
+/* Arithmetic functions for multiple precision numbers. */
+/* Relative errors are bounded */
+/************************************************************************/
+
+
+#include "endian.h"
+#include "mpa.h"
+#include "mpa2.h"
+#include <sys/param.h> /* For MIN() */
+/* mcr() compares the sizes of the mantissas of two multiple precision */
+/* numbers. Mantissas are compared regardless of the signs of the */
+/* numbers, even if x->d[0] or y->d[0] are zero. Exponents are also */
+/* disregarded. */
+static int mcr(const mp_no *x, const mp_no *y, int p) {
+ long i;
+ long p2 = p;
+ for (i=1; i<=p2; i++) {
+ if (X[i] == Y[i]) continue;
+ else if (X[i] > Y[i]) return 1;
+ else return -1; }
+ return 0;
+}
+
+
+
+/* acr() compares the absolute values of two multiple precision numbers */
+int __acr(const mp_no *x, const mp_no *y, int p) {
+ long i;
+
+ if (X[0] == ZERO) {
+ if (Y[0] == ZERO) i= 0;
+ else i=-1;
+ }
+ else if (Y[0] == ZERO) i= 1;
+ else {
+ if (EX > EY) i= 1;
+ else if (EX < EY) i=-1;
+ else i= mcr(x,y,p);
+ }
+
+ return i;
+}
+
+
+/* cr90 compares the values of two multiple precision numbers */
+int __cr(const mp_no *x, const mp_no *y, int p) {
+ int i;
+
+ if (X[0] > Y[0]) i= 1;
+ else if (X[0] < Y[0]) i=-1;
+ else if (X[0] < ZERO ) i= __acr(y,x,p);
+ else i= __acr(x,y,p);
+
[...3498 lines suppressed...]
+ ((op_t *) dstp)[0] = MERGE (a0, 32, a1, (64-32));
+ a2 = a0;
+
+ len -= 2;
+ }
+ while (len != 0);
+ break;
+ case 5:
+ do
+ {
+ srcp -= 2 * OPSIZ;
+ dstp -= 2 * OPSIZ;
+
+ a1 = ((op_t *) srcp)[1];
+ a0 = ((op_t *) srcp)[0];
+ ((op_t *) dstp)[1] = MERGE (a1, 40, a2, (64-40));
+ ((op_t *) dstp)[0] = MERGE (a0, 40, a1, (64-40));
+ a2 = a0;
+
+ len -= 2;
+ }
+ while (len != 0);
+ break;
+ case 6:
+ do
+ {
+ srcp -= 2 * OPSIZ;
+ dstp -= 2 * OPSIZ;
+
+ a1 = ((op_t *) srcp)[1];
+ a0 = ((op_t *) srcp)[0];
+ ((op_t *) dstp)[1] = MERGE (a1, 48, a2, (64-48));
+ ((op_t *) dstp)[0] = MERGE (a0, 48, a1, (64-48));
+ a2 = a0;
+
+ len -= 2;
+ }
+ while (len != 0);
+ break;
+ case 7:
+ do
+ {
+ srcp -= 2 * OPSIZ;
+ dstp -= 2 * OPSIZ;
+
+ a1 = ((op_t *) srcp)[1];
+ a0 = ((op_t *) srcp)[0];
+ ((op_t *) dstp)[1] = MERGE (a1, 56, a2, (64-56));
+ ((op_t *) dstp)[0] = MERGE (a0, 56, a1, (64-56));
+ a2 = a0;
+
+ len -= 2;
+ }
+ while (len != 0);
+ break;
+ }
+}
--- libc/powerpc-cpu/sysdeps/powerpc/powerpc64/power6x/fpu/Implies 1970-01-01 01:00:00.000000000 +0100
+++ libc/powerpc-cpu/sysdeps/powerpc/powerpc64/power6x/fpu/Implies 2006-10-09 21:00:22.000000000 +0200
@@ -0,0 +1,3 @@
+powerpc/powerpc64/power6/fpu
+powerpc/powerpc64/power5+/fpu
+powerpc/powerpc64/power4/fpu
--- libc/powerpc-cpu/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S 1970-01-01 01:00:00.000000000 +0100
+++ libc/powerpc-cpu/sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S 2006-10-09 21:00:56.000000000 +0200
@@ -0,0 +1,45 @@
+/* Round double to long int. POWER6x PowerPC64 version.
+ Copyright (C) 2006 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. */
+
+#include <sysdep.h>
+#include <math_ldbl_opt.h>
+
+ .machine "power6"
+/* long long int[r3] __llrint (double x[fp1]) */
+ENTRY (__llrint)
+ CALL_MCOUNT 0
+ fctid fp13,fp1
+ mftgpr r3,fp13
+ blr
+ END (__llrint)
+
+strong_alias (__llrint, __lrint)
+weak_alias (__llrint, llrint)
+weak_alias (__lrint, lrint)
+
+#ifdef NO_LONG_DOUBLE
+strong_alias (__llrint, __llrintl)
+weak_alias (__llrint, llrintl)
+strong_alias (__lrint, __lrintl)
+weak_alias (__lrint, lrintl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
+compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
+#endif
--- libc/powerpc-cpu/sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S 1970-01-01 01:00:00.000000000 +0100
+++ libc/powerpc-cpu/sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S 2006-10-09 21:00:56.000000000 +0200
@@ -0,0 +1,55 @@
+/* llround function. POWER6x PowerPC64 version.
+ Copyright (C) 2006 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. */
+
+#include <sysdep.h>
+#include <math_ldbl_opt.h>
+
+/* long long [r3] llround (float x [fp1])
+ IEEE 1003.1 llround function. IEEE specifies "round to the nearest
+ integer value, rounding halfway cases away from zero, regardless of
+ the current rounding mode." However PowerPC Architecture defines
+ "round to Nearest" as "Choose the best approximation. In case of a
+ tie, choose the one that is even (least significant bit o).".
+ So we pre-round using the V2.02 Floating Round to Integer Nearest
+ instruction before we use Floating Convert to Integer Word with
+ round to zero instruction. */
+
+ .machine "power6"
+ENTRY (__llround)
+ CALL_MCOUNT 0
+ frin fp2,fp1 /* Round to nearest +-0.5. */
+ fctidz fp3,fp2 /* Convert To Integer DW round toward 0. */
+ mftgpr r3,fp3 /* Transfer integer to R3. */
+ blr
+ END (__llround)
+
+strong_alias (__llround, __lround)
+weak_alias (__llround, llround)
+weak_alias (__lround, lround)
+
+#ifdef NO_LONG_DOUBLE
+weak_alias (__llround, llroundl)
+strong_alias (__llround, __llroundl)
+weak_alias (__lround, lroundl)
+strong_alias (__lround, __lroundl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __llround, llroundl, GLIBC_2_1)
+compat_symbol (libm, __lround, lroundl, GLIBC_2_1)
+#endif
--- libc/powerpc-cpu/sysdeps/powerpc/powerpc64/power6x/Implies 1970-01-01 01:00:00.000000000 +0100
+++ libc/powerpc-cpu/sysdeps/powerpc/powerpc64/power6x/Implies 2006-10-09 21:00:22.000000000 +0200
@@ -0,0 +1,2 @@
+powerpc/powerpc64/power6
+powerpc/powerpc64/power5+
--- libc/powerpc-cpu/sysdeps/unix/sysv/linux/powerpc/powerpc32/power6x/fpu/Implies 1970-01-01 01:00:00.000000000 +0100
+++ libc/powerpc-cpu/sysdeps/unix/sysv/linux/powerpc/powerpc32/power6x/fpu/Implies 2006-10-09 21:00:22.000000000 +0200
@@ -0,0 +1,4 @@
+# Make sure this comes before the powerpc/powerpc32/fpu that's
+# listed in unix/sysv/linux/powerpc/powerpc32/fpu/Implies.
+powerpc/powerpc32/power6x/fpu
+powerpc/powerpc32/power6/fpu
--- libc/powerpc-cpu/sysdeps/unix/sysv/linux/powerpc/powerpc64/970/fpu/Implies 1970-01-01 01:00:00.000000000 +0100
+++ libc/powerpc-cpu/sysdeps/unix/sysv/linux/powerpc/powerpc64/970/fpu/Implies 2006-08-20 16:13:50.000000000 +0200
@@ -0,0 +1 @@
+powerpc/powerpc64/power4/fpu
--- libc/powerpc-cpu/sysdeps/unix/sysv/linux/powerpc/powerpc64/power4/fpu/Implies 1970-01-01 01:00:00.000000000 +0100
+++ libc/powerpc-cpu/sysdeps/unix/sysv/linux/powerpc/powerpc64/power4/fpu/Implies 2006-08-20 16:14:01.000000000 +0200
@@ -0,0 +1 @@
+powerpc/powerpc64/power4/fpu
--- libc/powerpc-cpu/sysdeps/unix/sysv/linux/powerpc/powerpc64/power5/fpu/Implies 1970-01-01 01:00:00.000000000 +0100
+++ libc/powerpc-cpu/sysdeps/unix/sysv/linux/powerpc/powerpc64/power5/fpu/Implies 2006-08-20 16:14:05.000000000 +0200
@@ -0,0 +1 @@
+powerpc/powerpc64/power4/fpu
--- libc/powerpc-cpu/sysdeps/unix/sysv/linux/powerpc/powerpc64/power6x/fpu/Implies 1970-01-01 01:00:00.000000000 +0100
+++ libc/powerpc-cpu/sysdeps/unix/sysv/linux/powerpc/powerpc64/power6x/fpu/Implies 2006-10-09 21:00:22.000000000 +0200
@@ -0,0 +1,4 @@
+# Make sure this comes before the powerpc/powerpc64/fpu that's
+# listed in unix/sysv/linux/powerpc/powerpc64/fpu/Implies.
+powerpc/powerpc64/power6x/fpu
+powerpc/powerpc64/power6/fpu
glibc-r_debug-r_map.patch:
dl-debug.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE glibc-r_debug-r_map.patch ---
2006-10-09 Jakub Jelinek <jakub at redhat.com>
* elf/dl-debug.c (_dl_debug_initialize): Check r->r_map for 0
rather than r->r_brk.
--- libc/elf/dl-debug.c 1 Mar 2006 06:18:30 -0000 1.16
+++ libc/elf/dl-debug.c 9 Nov 2006 16:11:44 -0000 1.17
@@ -54,7 +54,7 @@ _dl_debug_initialize (ElfW(Addr) ldbase,
else
r = &GL(dl_ns)[ns]._ns_debug;
- if (r->r_brk == 0 || ldbase != 0)
+ if (r->r_map == NULL || ldbase != 0)
{
/* Tell the debugger where to find the map of loaded objects. */
r->r_version = 1 /* R_DEBUG_VERSION XXX */;
glibc-rh206483.patch:
nis_subr.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
--- NEW FILE glibc-rh206483.patch ---
2006-10-10 Ulrich Drepper <drepper at redhat.com>
* nis/nis_subr.c (nis_getnames): Add trailing dot to NIS_PATH
components which lack them.
* nis/nis_subr.c (nis_getnames): Make sure that we always return
at least one entry consisting of the parameter concatenated with
the domain.
--- libc/nis/nis_subr.c 16 Jun 2006 22:30:02 -0000 1.15
+++ libc/nis/nis_subr.c 11 Oct 2006 01:27:38 -0000 1.17
@@ -251,13 +251,16 @@ nis_getnames (const_nis_name name)
{
char *p;
- tmp = malloc (cplen + name_len + 2);
+ tmp = malloc (cplen + name_len + 3);
if (__builtin_expect (tmp == NULL, 0))
goto free_null;
- p = __stpcpy (tmp, name);
+ p = __mempcpy (tmp, name, name_len);
*p++ = '.';
- memcpy (p, cp, cplen + 1);
+ p = __mempcpy (p, cp, cplen);
+ if (p[-1] != '.')
+ *p++ = '.';
+ *p = '\0';
}
if (pos >= count)
@@ -275,6 +278,13 @@ nis_getnames (const_nis_name name)
cp = __strtok_r (NULL, ":", &saveptr);
}
+ if (pos == 0
+ && __asprintf (&getnames[pos++], "%s%s%s%s",
+ name, name[name_len - 1] == '.' ? "" : ".",
+ local_domain,
+ local_domain[local_domain_len - 1] == '.' ? "" : ".") < 0)
+ goto free_null;
+
getnames[pos] = NULL;
return getnames;
glibc-rh210130.patch:
elf/dl-close.c | 154 ++++++++++++++++++++-------
elf/dl-libc.c | 3
elf/dl-load.c | 8 -
elf/dl-lookup.c | 6 -
elf/dl-object.c | 19 ++-
elf/dl-open.c | 69 ++++++++----
elf/dl-runtime.c | 48 +++++++-
elf/dl-sym.c | 86 ++++++++++++++-
elf/rtld.c | 15 +-
include/link.h | 33 +++++
nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h | 151 ++++++++++++++++++++++++++
sysdeps/generic/ldsodefs.h | 1
sysdeps/generic/rtld-lowlevel.h | 1
13 files changed, 510 insertions(+), 84 deletions(-)
--- NEW FILE glibc-rh210130.patch ---
2006-10-18 Ulrich Drepper <drepper at redhat.com>
* elf/dl-lookup.c (_dl_lookup_symbol_x): Add warning to
_dl_lookup_symbol_x code.
2006-10-17 Jakub Jelinek <jakub at redhat.com>
* elf/dl-runtime.c: Include sysdep-cancel.h.
(_dl_fixup, _dl_profile_fixup): Use __rtld_mrlock_* and
scoperec->nusers only if !SINGLE_THREAD_P. Use atomic_*
instead of catomic_* macros.
* elf/dl-sym.c: Include sysdep-cancel.h.
(do_sym): Use __rtld_mrlock_* and scoperec->nusers only
if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros.
* elf/dl-close.c: Include sysdep-cancel.h.
(_dl_close): Use __rtld_mrlock_* and scoperec->nusers only
if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros.
* elf/dl-open.c: Include sysdep-cancel.h.
(dl_open_worker): Use __rtld_mrlock_* and scoperec->nusers only
if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros.
2006-10-09 Ulrich Drepper <drepper at redhat.com>
Jakub Jelinek <jakub at redhat.com>
Implement reference counting of scope records.
* elf/dl-close.c (_dl_close): Remove all scopes from removed objects
from the list in objects which remain. Always allocate new scope
record.
* elf/dl-open.c (dl_open_worker): When growing array for scopes,
don't resize, allocate a new one.
* elf/dl-runtime.c: Update reference counters before using a scope
array.
* elf/dl-sym.c: Likewise.
* elf/dl-libc.c: Adjust for l_scope name change.
* elf/dl-load.c: Likewise.
* elf/dl-object.c: Likewise.
* elf/rtld.c: Likewise.
* include/link.h: Include <rtld-lowlevel.h>. Define struct
r_scoperec. Replace r_scope with pointer to r_scoperec structure.
Add l_scoperec_lock.
* sysdeps/generic/ldsodefs.h: Include <rtld-lowlevel.h>.
* sysdeps/generic/rtld-lowlevel.h: New file.
nptl/
2006-10-17 Jakub Jelinek <jakub at redhat.com>
* sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
__rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
atomic_* instead of catomic_* macros.
2006-10-11 Ulrich Drepper <drepper at redhat.com>
* sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
operations instead of atomic_*.
2006-10-09 Ulrich Drepper <drepper at redhat.com>
* sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
--- libc/elf/dl-close.c 19 Sep 2006 14:39:42 -0000 1.117
+++ libc/elf/dl-close.c 18 Oct 2006 19:19:07 -0000 1.120
@@ -19,6 +19,7 @@
#include <assert.h>
#include <dlfcn.h>
+#include <errno.h>
#include <libintl.h>
#include <stddef.h>
#include <stdio.h>
@@ -29,12 +30,17 @@
#include <ldsodefs.h>
#include <sys/types.h>
#include <sys/mman.h>
+#include <sysdep-cancel.h>
/* Type of the constructor functions. */
typedef void (*fini_t) (void);
+/* Special l_idx value used to indicate which objects remain loaded. */
+#define IDX_STILL_USED -1
+
+
#ifdef USE_TLS
/* Returns true we an non-empty was found. */
static bool
@@ -188,7 +194,7 @@ _dl_close (void *_map)
done[done_index] = 1;
used[done_index] = 1;
/* Signal the object is still needed. */
- l->l_idx = -1;
+ l->l_idx = IDX_STILL_USED;
/* Mark all dependencies as used. */
if (l->l_initfini != NULL)
@@ -196,7 +202,7 @@ _dl_close (void *_map)
struct link_map **lp = &l->l_initfini[1];
while (*lp != NULL)
{
- if ((*lp)->l_idx != -1)
+ if ((*lp)->l_idx != IDX_STILL_USED)
{
assert ((*lp)->l_idx >= 0 && (*lp)->l_idx < nloaded);
@@ -217,7 +223,7 @@ _dl_close (void *_map)
{
struct link_map *jmap = l->l_reldeps[j];
- if (jmap->l_idx != -1)
+ if (jmap->l_idx != IDX_STILL_USED)
{
assert (jmap->l_idx >= 0 && jmap->l_idx < nloaded);
@@ -310,8 +316,9 @@ _dl_close (void *_map)
/* Else used[i]. */
else if (imap->l_type == lt_loaded)
{
- if (imap->l_searchlist.r_list == NULL
- && imap->l_initfini != NULL)
+ struct r_scope_elem *new_list = NULL;
+
+ if (imap->l_searchlist.r_list == NULL && imap->l_initfini != NULL)
{
/* The object is still used. But one of the objects we are
unloading right now is responsible for loading it. If
@@ -328,44 +335,119 @@ _dl_close (void *_map)
imap->l_searchlist.r_list = &imap->l_initfini[cnt + 1];
imap->l_searchlist.r_nlist = cnt;
- for (cnt = 0; imap->l_scope[cnt] != NULL; ++cnt)
- /* This relies on l_scope[] entries being always set either
- to its own l_symbolic_searchlist address, or some map's
- l_searchlist address. */
- if (imap->l_scope[cnt] != &imap->l_symbolic_searchlist)
- {
- struct link_map *tmap;
-
- tmap = (struct link_map *) ((char *) imap->l_scope[cnt]
- - offsetof (struct link_map,
- l_searchlist));
- assert (tmap->l_ns == ns);
- if (tmap->l_idx != -1)
- {
- imap->l_scope[cnt] = &imap->l_searchlist;
- break;
- }
- }
+ new_list = &imap->l_searchlist;
}
- else
+
+ /* Count the number of scopes which remain after the unload.
+ When we add the local search list count it. Always add
+ one for the terminating NULL pointer. */
+ size_t remain = (new_list != NULL) + 1;
+ bool removed_any = false;
+ for (size_t cnt = 0; imap->l_scoperec->scope[cnt] != NULL; ++cnt)
+ /* This relies on l_scope[] entries being always set either
+ to its own l_symbolic_searchlist address, or some map's
+ l_searchlist address. */
+ if (imap->l_scoperec->scope[cnt] != &imap->l_symbolic_searchlist)
+ {
+ struct link_map *tmap = (struct link_map *)
+ ((char *) imap->l_scoperec->scope[cnt]
+ - offsetof (struct link_map, l_searchlist));
+ assert (tmap->l_ns == ns);
+ if (tmap->l_idx == IDX_STILL_USED)
+ ++remain;
+ else
+ removed_any = true;
+ }
+ else
+ ++remain;
+
+ if (removed_any)
{
- unsigned int cnt = 0;
- while (imap->l_scope[cnt] != NULL)
+ /* Always allocate a new array for the scope. This is
+ necessary since we must be able to determine the last
+ user of the current array. If possible use the link map's
+ memory. */
+ size_t new_size;
+ struct r_scoperec *newp;
+ if (imap->l_scoperec != &imap->l_scoperec_mem
+ && remain < NINIT_SCOPE_ELEMS (imap)
+ && imap->l_scoperec_mem.nusers == 0)
+ {
+ new_size = NINIT_SCOPE_ELEMS (imap);
+ newp = &imap->l_scoperec_mem;
+ }
+ else
+ {
+ new_size = imap->l_scope_max;
+ newp = (struct r_scoperec *)
+ malloc (sizeof (struct r_scoperec)
+ + new_size * sizeof (struct r_scope_elem *));
+ if (newp == NULL)
+ _dl_signal_error (ENOMEM, "dlclose", NULL,
+ N_("cannot create scope list"));
+ }
+
+ newp->nusers = 0;
+ newp->remove_after_use = false;
+ newp->notify = false;
+
+ /* Copy over the remaining scope elements. */
+ remain = 0;
+ for (size_t cnt = 0; imap->l_scoperec->scope[cnt] != NULL; ++cnt)
+ {
+ if (imap->l_scoperec->scope[cnt]
+ != &imap->l_symbolic_searchlist)
+ {
+ struct link_map *tmap = (struct link_map *)
+ ((char *) imap->l_scoperec->scope[cnt]
+ - offsetof (struct link_map, l_searchlist));
+ if (tmap->l_idx != IDX_STILL_USED)
+ {
+ /* Remove the scope. Or replace with own map's
+ scope. */
+ if (new_list != NULL)
+ {
+ newp->scope[remain++] = new_list;
+ new_list = NULL;
+ }
+ continue;
+ }
+ }
+
+ newp->scope[remain++] = imap->l_scoperec->scope[cnt];
+ }
+ newp->scope[remain] = NULL;
+
+ struct r_scoperec *old = imap->l_scoperec;
+
+ if (SINGLE_THREAD_P)
+ imap->l_scoperec = newp;
+ else
{
- if (imap->l_scope[cnt] == &map->l_searchlist)
+ __rtld_mrlock_change (imap->l_scoperec_lock);
+ imap->l_scoperec = newp;
+ __rtld_mrlock_done (imap->l_scoperec_lock);
+
+ if (atomic_increment_val (&old->nusers) != 1)
{
- while ((imap->l_scope[cnt] = imap->l_scope[cnt + 1])
- != NULL)
- ++cnt;
- break;
+ old->remove_after_use = true;
+ old->notify = true;
+ if (atomic_decrement_val (&old->nusers) != 0)
+ __rtld_waitzero (old->nusers);
}
- ++cnt;
}
+
+ /* No user anymore, we can free it now. */
+ if (old != &imap->l_scoperec_mem)
+ free (old);
+
+ imap->l_scope_max = new_size;
}
/* The loader is gone, so mark the object as not having one.
- Note: l_idx != -1 -> object will be removed. */
- if (imap->l_loader != NULL && imap->l_loader->l_idx != -1)
+ Note: l_idx != IDX_STILL_USED -> object will be removed. */
+ if (imap->l_loader != NULL
+ && imap->l_loader->l_idx != IDX_STILL_USED)
imap->l_loader = NULL;
/* Remember where the first dynamically loaded object is. */
@@ -570,8 +652,8 @@ _dl_close (void *_map)
free (imap->l_initfini);
/* Remove the scope array if we allocated it. */
- if (imap->l_scope != imap->l_scope_mem)
- free (imap->l_scope);
+ if (imap->l_scoperec != &imap->l_scoperec_mem)
+ free (imap->l_scoperec);
if (imap->l_phdr_allocated)
free ((void *) imap->l_phdr);
--- libc/elf/dl-libc.c 12 Jun 2005 16:28:48 -0000 1.26
+++ libc/elf/dl-libc.c 10 Oct 2006 00:49:56 -0000 1.27
@@ -133,7 +133,8 @@ do_dlsym_private (void *ptr)
struct do_dlsym_args *args = (struct do_dlsym_args *) ptr;
args->ref = NULL;
l = GLRO(dl_lookup_symbol_x) (args->name, args->map, &args->ref,
- args->map->l_scope, &vers, 0, 0, NULL);
+ args->map->l_scoperec->scope, &vers, 0, 0,
+ NULL);
args->loadbase = l;
}
--- libc/elf/dl-load.c 29 Aug 2006 01:43:42 -0000 1.279
+++ libc/elf/dl-load.c 10 Oct 2006 00:49:56 -0000 1.280
@@ -1473,7 +1473,7 @@ cannot enable executable stack as shared
have to do this for the main map. */
if ((mode & RTLD_DEEPBIND) == 0
&& __builtin_expect (l->l_info[DT_SYMBOLIC] != NULL, 0)
- && &l->l_searchlist != l->l_scope[0])
+ && &l->l_searchlist != l->l_scoperec->scope[0])
{
/* Create an appropriate searchlist. It contains only this map.
This is the definition of DT_SYMBOLIC in SysVr4. */
@@ -1490,11 +1490,11 @@ cannot enable executable stack as shared
l->l_symbolic_searchlist.r_nlist = 1;
/* Now move the existing entries one back. */
- memmove (&l->l_scope[1], &l->l_scope[0],
- (l->l_scope_max - 1) * sizeof (l->l_scope[0]));
+ memmove (&l->l_scoperec->scope[1], &l->l_scoperec->scope[0],
+ (l->l_scope_max - 1) * sizeof (l->l_scoperec->scope[0]));
/* Now add the new entry. */
- l->l_scope[0] = &l->l_symbolic_searchlist;
+ l->l_scoperec->scope[0] = &l->l_symbolic_searchlist;
}
/* Remember whether this object must be initialized first. */
--- libc/elf/dl-lookup.c 10 Jul 2006 21:49:38 -0000 1.122
+++ libc/elf/dl-lookup.c 18 Oct 2006 19:11:33 -0000 1.123
@@ -207,7 +207,11 @@ _dl_debug_bindings (const char *undef_na
/* Search loaded objects' symbol tables for a definition of the symbol
- UNDEF_NAME, perhaps with a requested version for the symbol. */
+ UNDEF_NAME, perhaps with a requested version for the symbol.
+
+ We must never have calls to the audit functions inside this function
+ or in any function which gets called. If this would happen the audit
+ code might create a thread which can throw off all the scope locking. */
lookup_t
internal_function
_dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
--- libc/elf/dl-object.c 6 Jan 2005 22:40:26 -0000 1.40
+++ libc/elf/dl-object.c 10 Oct 2006 00:49:56 -0000 1.41
@@ -82,8 +82,14 @@ _dl_new_object (char *realname, const ch
/* Use the 'l_scope_mem' array by default for the the 'l_scope'
information. If we need more entries we will allocate a large
array dynamically. */
- new->l_scope = new->l_scope_mem;
- new->l_scope_max = sizeof (new->l_scope_mem) / sizeof (new->l_scope_mem[0]);
+ new->l_scoperec = &new->l_scoperec_mem;
+ new->l_scope_max = (sizeof (new->l_scope_realmem.scope_elems)
+ / sizeof (new->l_scope_realmem.scope_elems[0]));
+
+ /* No need to initialize the scope lock if the initializer is zero. */
+#if _RTLD_MRLOCK_INITIALIZER != 0
+ __rtld_mrlock_initialize (new->l_scoperec_mem.lock);
+#endif
/* Counter for the scopes we have to handle. */
idx = 0;
@@ -98,7 +104,8 @@ _dl_new_object (char *realname, const ch
l->l_next = new;
/* Add the global scope. */
- new->l_scope[idx++] = &GL(dl_ns)[nsid]._ns_loaded->l_searchlist;
+ new->l_scoperec->scope[idx++]
+ = &GL(dl_ns)[nsid]._ns_loaded->l_searchlist;
}
else
GL(dl_ns)[nsid]._ns_loaded = new;
@@ -114,15 +121,15 @@ _dl_new_object (char *realname, const ch
loader = loader->l_loader;
/* Insert the scope if it isn't the global scope we already added. */
- if (idx == 0 || &loader->l_searchlist != new->l_scope[0])
+ if (idx == 0 || &loader->l_searchlist != new->l_scoperec->scope[0])
{
if ((mode & RTLD_DEEPBIND) != 0 && idx != 0)
{
- new->l_scope[1] = new->l_scope[0];
+ new->l_scoperec->scope[1] = new->l_scoperec->scope[0];
idx = 0;
}
- new->l_scope[idx] = &loader->l_searchlist;
+ new->l_scoperec->scope[idx] = &loader->l_searchlist;
}
new->l_local_scope[0] = &new->l_searchlist;
--- libc/elf/dl-open.c 28 Aug 2006 22:56:50 -0000 1.128
+++ libc/elf/dl-open.c 18 Oct 2006 19:20:13 -0000 1.131
@@ -31,6 +31,7 @@
#include <ldsodefs.h>
#include <bp-sym.h>
#include <caller.h>
+#include <sysdep-cancel.h>
#include <dl-dst.h>
@@ -343,7 +344,7 @@ dl_open_worker (void *a)
start the profiling. */
struct link_map *old_profile_map = GL(dl_profile_map);
- _dl_relocate_object (l, l->l_scope, 1, 1);
+ _dl_relocate_object (l, l->l_scoperec->scope, 1, 1);
if (old_profile_map == NULL && GL(dl_profile_map) != NULL)
{
@@ -356,7 +357,7 @@ dl_open_worker (void *a)
}
else
#endif
- _dl_relocate_object (l, l->l_scope, lazy, 0);
+ _dl_relocate_object (l, l->l_scoperec->scope, lazy, 0);
}
if (l == new)
@@ -374,11 +375,13 @@ dl_open_worker (void *a)
not been loaded here and now. */
if (imap->l_init_called && imap->l_type == lt_loaded)
{
- struct r_scope_elem **runp = imap->l_scope;
+ struct r_scope_elem **runp = imap->l_scoperec->scope;
size_t cnt = 0;
while (*runp != NULL)
{
+ if (*runp == &new->l_searchlist)
+ break;
++cnt;
++runp;
}
@@ -391,35 +394,63 @@ dl_open_worker (void *a)
{
/* The 'r_scope' array is too small. Allocate a new one
dynamically. */
- struct r_scope_elem **newp;
- size_t new_size = imap->l_scope_max * 2;
+ size_t new_size;
+ struct r_scoperec *newp;
- if (imap->l_scope == imap->l_scope_mem)
+ if (imap->l_scoperec != &imap->l_scoperec_mem
+ && imap->l_scope_max < NINIT_SCOPE_ELEMS (imap)
+ && imap->l_scoperec_mem.nusers == 0)
{
- newp = (struct r_scope_elem **)
- malloc (new_size * sizeof (struct r_scope_elem *));
- if (newp == NULL)
- _dl_signal_error (ENOMEM, "dlopen", NULL,
- N_("cannot create scope list"));
- imap->l_scope = memcpy (newp, imap->l_scope,
- cnt * sizeof (imap->l_scope[0]));
+ new_size = NINIT_SCOPE_ELEMS (imap);
+ newp = &imap->l_scoperec_mem;
}
else
{
- newp = (struct r_scope_elem **)
- realloc (imap->l_scope,
- new_size * sizeof (struct r_scope_elem *));
+ new_size = imap->l_scope_max * 2;
+ newp = (struct r_scoperec *)
+ malloc (sizeof (struct r_scoperec)
+ + new_size * sizeof (struct r_scope_elem *));
if (newp == NULL)
_dl_signal_error (ENOMEM, "dlopen", NULL,
N_("cannot create scope list"));
- imap->l_scope = newp;
+ }
+
+ newp->nusers = 0;
+ newp->remove_after_use = false;
+ newp->notify = false;
+ memcpy (newp->scope, imap->l_scoperec->scope,
+ cnt * sizeof (imap->l_scoperec->scope[0]));
+ struct r_scoperec *old = imap->l_scoperec;
+
+ if (old == &imap->l_scoperec_mem)
+ imap->l_scoperec = newp;
+ else if (SINGLE_THREAD_P)
+ {
+ imap->l_scoperec = newp;
+ free (old);
+ }
+ else
+ {
+ __rtld_mrlock_change (imap->l_scoperec_lock);
+ imap->l_scoperec = newp;
+ __rtld_mrlock_done (imap->l_scoperec_lock);
+
+ atomic_increment (&old->nusers);
+ old->remove_after_use = true;
+ if (atomic_decrement_val (&old->nusers) == 0)
+ /* No user, we can free it here and now. */
+ free (old);
}
imap->l_scope_max = new_size;
}
- imap->l_scope[cnt++] = &new->l_searchlist;
- imap->l_scope[cnt] = NULL;
+ /* First terminate the extended list. Otherwise a thread
+ might use the new last element and then use the garbage
+ at offset IDX+1. */
+ imap->l_scoperec->scope[cnt + 1] = NULL;
+ atomic_write_barrier ();
+ imap->l_scoperec->scope[cnt] = &new->l_searchlist;
}
#if USE_TLS
/* Only add TLS memory if this object is loaded now and
--- libc/elf/dl-runtime.c 7 Feb 2005 22:47:00 -0000 1.69
+++ libc/elf/dl-runtime.c 18 Oct 2006 19:16:52 -0000 1.72
@@ -24,6 +24,7 @@
#include <unistd.h>
#include <sys/param.h>
#include <ldsodefs.h>
+#include <sysdep-cancel.h>
#include "dynamic-link.h"
#if (!defined ELF_MACHINE_NO_RELA && !defined ELF_MACHINE_PLT_REL) \
@@ -92,16 +93,36 @@ _dl_fixup (
version = NULL;
}
+ struct r_scoperec *scoperec = l->l_scoperec;
+ if (l->l_type == lt_loaded && !SINGLE_THREAD_P)
+ {
+ __rtld_mrlock_lock (l->l_scoperec_lock);
+ scoperec = l->l_scoperec;
+ atomic_increment (&scoperec->nusers);
+ __rtld_mrlock_unlock (l->l_scoperec_lock);
+ }
+
result = _dl_lookup_symbol_x (strtab + sym->st_name, l, &sym,
- l->l_scope, version, ELF_RTYPE_CLASS_PLT,
+ scoperec->scope, version,
+ ELF_RTYPE_CLASS_PLT,
DL_LOOKUP_ADD_DEPENDENCY, NULL);
+ if (l->l_type == lt_loaded && !SINGLE_THREAD_P
+ && atomic_decrement_val (&scoperec->nusers) == 0
+ && __builtin_expect (scoperec->remove_after_use, 0))
+ {
+ if (scoperec->notify)
+ __rtld_notify (scoperec->nusers);
+ else
+ free (scoperec);
+ }
+
/* Currently result contains the base load address (or link map)
of the object that defines sym. Now add in the symbol
offset. */
value = DL_FIXUP_MAKE_VALUE (result,
- sym ? LOOKUP_VALUE_ADDRESS (result)
- + sym->st_value : 0);
+ sym ? (LOOKUP_VALUE_ADDRESS (result)
+ + sym->st_value) : 0);
}
else
{
@@ -174,11 +195,30 @@ _dl_profile_fixup (
version = NULL;
}
+ struct r_scoperec *scoperec = l->l_scoperec;
+ if (l->l_type == lt_loaded && !SINGLE_THREAD_P)
+ {
+ __rtld_mrlock_lock (l->l_scoperec_lock);
+ scoperec = l->l_scoperec;
+ atomic_increment (&scoperec->nusers);
+ __rtld_mrlock_unlock (l->l_scoperec_lock);
+ }
+
result = _dl_lookup_symbol_x (strtab + refsym->st_name, l, &defsym,
- l->l_scope, version,
+ scoperec->scope, version,
ELF_RTYPE_CLASS_PLT,
DL_LOOKUP_ADD_DEPENDENCY, NULL);
+ if (l->l_type == lt_loaded && !SINGLE_THREAD_P
+ && atomic_decrement_val (&scoperec->nusers) == 0
+ && __builtin_expect (scoperec->remove_after_use, 0))
+ {
+ if (scoperec->notify)
+ __rtld_notify (scoperec->nusers);
+ else
+ free (scoperec);
+ }
+
/* Currently result contains the base load address (or link map)
of the object that defines sym. Now add in the symbol
offset. */
--- libc/elf/dl-sym.c 26 Feb 2006 20:48:48 -0000 1.27
+++ libc/elf/dl-sym.c 18 Oct 2006 19:18:11 -0000 1.30
@@ -17,6 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <assert.h>
#include <stddef.h>
#include <setjmp.h>
#include <libintl.h>
@@ -24,6 +25,7 @@
#include <dlfcn.h>
#include <ldsodefs.h>
#include <dl-hash.h>
+#include <sysdep-cancel.h>
#ifdef USE_TLS
# include <dl-tls.h>
#endif
@@ -58,6 +60,30 @@ _dl_tls_symaddr (struct link_map *map, c
#endif
+struct call_dl_lookup_args
+{
+ /* Arguments to do_dlsym. */
+ struct link_map *map;
+ const char *name;
+ struct r_scope_elem **scope;
+ struct r_found_version *vers;
+ int flags;
+
+ /* Return values of do_dlsym. */
+ lookup_t loadbase;
+ const ElfW(Sym) **refp;
+};
+
+static void
+call_dl_lookup (void *ptr)
+{
+ struct call_dl_lookup_args *args = (struct call_dl_lookup_args *) ptr;
+ args->map = GLRO(dl_lookup_symbol_x) (args->name, args->map, args->refp,
+ args->scope, args->vers, 0,
+ args->flags, NULL);
+}
+
+
static void *
internal_function
do_sym (void *handle, const char *name, void *who,
@@ -84,10 +110,62 @@ do_sym (void *handle, const char *name,
}
if (handle == RTLD_DEFAULT)
- /* Search the global scope. */
- result = GLRO(dl_lookup_symbol_x) (name, match, &ref, match->l_scope,
- vers, 0, flags|DL_LOOKUP_ADD_DEPENDENCY,
- NULL);
+ {
+ /* Search the global scope. We have the simple case where
+ we look up in the scope of an object which was part of
+ the initial binary. And then the more complex part
+ where the object is dynamically loaded and the scope
+ array can change. */
+ if (match->l_type != lt_loaded || SINGLE_THREAD_P)
+ result = GLRO(dl_lookup_symbol_x) (name, match, &ref,
+ match->l_scoperec->scope, vers, 0,
+ flags | DL_LOOKUP_ADD_DEPENDENCY,
+ NULL);
+ else
+ {
+ __rtld_mrlock_lock (match->l_scoperec_lock);
+ struct r_scoperec *scoperec = match->l_scoperec;
+ atomic_increment (&scoperec->nusers);
+ __rtld_mrlock_unlock (match->l_scoperec_lock);
+
+ struct call_dl_lookup_args args;
+ args.name = name;
+ args.map = match;
+ args.scope = scoperec->scope;
+ args.vers = vers;
+ args.flags = flags | DL_LOOKUP_ADD_DEPENDENCY;
+ args.refp = &ref;
+
+ const char *objname;
+ const char *errstring = NULL;
+ bool malloced;
+ int err = GLRO(dl_catch_error) (&objname, &errstring, &malloced,
+ call_dl_lookup, &args);
+
+ if (atomic_decrement_val (&scoperec->nusers) == 0
+ && __builtin_expect (scoperec->remove_after_use, 0))
+ {
+ if (scoperec->notify)
+ __rtld_notify (scoperec->nusers);
+ else
+ free (scoperec);
+ }
+
+ if (__builtin_expect (errstring != NULL, 0))
+ {
+ /* The lookup was unsuccessful. Rethrow the error. */
+ char *errstring_dup = strdupa (errstring);
+ char *objname_dup = strdupa (objname);
+ if (malloced)
+ free ((char *) errstring);
+
+ GLRO(dl_signal_error) (err, objname_dup, NULL, errstring_dup);
+ /* NOTREACHED */
+ }
+
+ result = args.map;
+ }
+ }
else if (handle == RTLD_NEXT)
{
if (__builtin_expect (match == GL(dl_ns)[LM_ID_BASE]._ns_loaded, 0))
--- libc/elf/rtld.c 2 Oct 2006 18:24:37 -0000 1.364
+++ libc/elf/rtld.c 10 Oct 2006 00:49:56 -0000 1.365
@@ -609,7 +609,7 @@ relocate_doit (void *a)
{
struct relocate_args *args = (struct relocate_args *) a;
- _dl_relocate_object (args->l, args->l->l_scope, args->lazy, 0);
+ _dl_relocate_object (args->l, args->l->l_scoperec->scope, args->lazy, 0);
}
static void
@@ -1963,8 +1963,8 @@ ERROR: ld.so: object '%s' cannot be load
lookup_t result;
result = _dl_lookup_symbol_x (INTUSE(_dl_argv)[i], main_map,
- &ref, main_map->l_scope, NULL,
- ELF_RTYPE_CLASS_PLT,
+ &ref, main_map->l_scoperec->scope,
+ NULL, ELF_RTYPE_CLASS_PLT,
DL_LOOKUP_ADD_DEPENDENCY, NULL);
loadbase = LOOKUP_VALUE_ADDRESS (result);
@@ -2006,8 +2006,8 @@ ERROR: ld.so: object '%s' cannot be load
{
/* Mark the link map as not yet relocated again. */
GL(dl_rtld_map).l_relocated = 0;
- _dl_relocate_object (&GL(dl_rtld_map), main_map->l_scope,
- 0, 0);
+ _dl_relocate_object (&GL(dl_rtld_map),
+ main_map->l_scoperec->scope, 0, 0);
}
}
#define VERNEEDTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERNEED))
@@ -2227,7 +2227,7 @@ ERROR: ld.so: object '%s' cannot be load
}
if (l != &GL(dl_rtld_map))
- _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy),
+ _dl_relocate_object (l, l->l_scoperec->scope, GLRO(dl_lazy),
consider_profiling);
#ifdef USE_TLS
@@ -2303,7 +2303,8 @@ ERROR: ld.so: object '%s' cannot be load
HP_TIMING_NOW (start);
/* Mark the link map as not yet relocated again. */
GL(dl_rtld_map).l_relocated = 0;
- _dl_relocate_object (&GL(dl_rtld_map), main_map->l_scope, 0, 0);
+ _dl_relocate_object (&GL(dl_rtld_map), main_map->l_scoperec->scope,
+ 0, 0);
HP_TIMING_NOW (stop);
HP_TIMING_DIFF (add, start, stop);
HP_TIMING_ACCUM_NT (relocate_time, add);
--- libc/include/link.h 20 Sep 2006 20:28:55 -0000 1.40
+++ libc/include/link.h 10 Oct 2006 00:39:30 -0000 1.41
@@ -43,6 +43,8 @@ extern unsigned int la_objopen (struct l
#include <bits/linkmap.h>
#include <dl-lookupcfg.h>
#include <tls.h> /* Defines USE_TLS. */
+#include <bits/libc-lock.h>
+#include <rtld-lowlevel.h>
/* Some internal data structures of the dynamic linker used in the
@@ -73,6 +75,18 @@ struct r_search_path_struct
};
+/* Structure for a scope. Each such data structure has a lock. The
+ lock allows many readers. It can be invalidated by setting bit 31
+ which means that no more lockers are allowe */
+struct r_scoperec
+{
+ bool remove_after_use;
+ bool notify;
+ int nusers;
+ struct r_scope_elem *scope[0];
+};
+
+
/* Structure describing a loaded shared object. The `l_next' and `l_prev'
members form a chain of all the shared objects loaded at startup.
@@ -212,12 +226,27 @@ struct link_map
ElfW(Addr) l_text_end;
/* Default array for 'l_scope'. */
- struct r_scope_elem *l_scope_mem[4];
+ union
+ {
+ struct r_scoperec l_scoperec_mem;
+ struct
+ {
+ struct r_scoperec scoperec_struct;
+ /* XXX This number should be increased once the scope memory
+ handling has been tested. */
+ struct r_scope_elem *scope_elems[4];
+#define NINIT_SCOPE_ELEMS(map) \
+ (sizeof ((map)->l_scope_realmem.scope_elems) \
+ / sizeof ((map)->l_scope_realmem.scope_elems[0]))
+ } l_scope_realmem;
+ };
/* Size of array allocated for 'l_scope'. */
size_t l_scope_max;
/* This is an array defining the lookup scope for this link map.
There are initially at most three different scope lists. */
- struct r_scope_elem **l_scope;
+ struct r_scoperec *l_scoperec;
+ /* We need to protect using the SCOPEREC. */
+ __rtld_mrlock_define (, l_scoperec_lock)
/* A similar array, this time only with the local scope. This is
used occasionally. */
--- libc/nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h 1 Jan 1970 00:00:00 -0000
+++ libc/nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h 18 Oct 2006 19:14:38 -0000 1.4
@@ -0,0 +1,151 @@
+/* Defintions for lowlevel handling in ld.so.
+ Copyright (C) 2006 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 _RTLD_LOWLEVEL_H
+#define _RTLD_LOWLEVEL_H 1
+
+#include <atomic.h>
+#include <lowlevellock.h>
+
+
+/* Special multi-reader lock used in ld.so. */
+#define __RTLD_MRLOCK_WRITER 1
+#define __RTLD_MRLOCK_RWAIT 2
+#define __RTLD_MRLOCK_WWAIT 4
+#define __RTLD_MRLOCK_RBITS \
+ ~(__RTLD_MRLOCK_WRITER | __RTLD_MRLOCK_RWAIT | __RTLD_MRLOCK_WWAIT)
+#define __RTLD_MRLOCK_INC 8
+#define __RTLD_MRLOCK_TRIES 5
+
+
+typedef int __rtld_mrlock_t;
+
+
+#define __rtld_mrlock_define(CLASS,NAME) \
+ CLASS __rtld_mrlock_t NAME;
+
+
+#define _RTLD_MRLOCK_INITIALIZER 0
+#define __rtld_mrlock_initialize(NAME) \
+ (void) ((NAME) = 0
+
+
+#define __rtld_mrlock_lock(lock) \
+ do { \
+ __label__ out; \
+ while (1) \
+ { \
+ int oldval; \
+ for (int tries = 0; tries < __RTLD_MRLOCK_TRIES; ++tries) \
+ { \
+ oldval = lock; \
+ while (__builtin_expect ((oldval \
+ & (__RTLD_MRLOCK_WRITER \
+ | __RTLD_MRLOCK_WWAIT)) \
+ == 0, 1)) \
+ { \
+ int newval = ((oldval & __RTLD_MRLOCK_RBITS) \
+ + __RTLD_MRLOCK_INC); \
+ int ret = atomic_compare_and_exchange_val_acq (&(lock), \
+ newval, \
+ oldval); \
+ if (__builtin_expect (ret == oldval, 1)) \
+ goto out; \
+ } \
+ atomic_delay (); \
+ } \
+ if ((oldval & __RTLD_MRLOCK_RWAIT) == 0) \
+ { \
+ atomic_or (&(lock), __RTLD_MRLOCK_RWAIT); \
+ oldval |= __RTLD_MRLOCK_RWAIT; \
+ } \
+ lll_futex_wait (lock, oldval); \
+ } \
+ out:; \
+ } while (0)
+
+
+#define __rtld_mrlock_unlock(lock) \
+ do { \
+ int oldval = atomic_exchange_and_add (&(lock), -__RTLD_MRLOCK_INC); \
+ if (__builtin_expect ((oldval \
+ & (__RTLD_MRLOCK_RBITS | __RTLD_MRLOCK_WWAIT)) \
+ == (__RTLD_MRLOCK_INC | __RTLD_MRLOCK_WWAIT), 0)) \
+ /* We have to wake all threads since there might be some queued \
+ readers already. */ \
+ lll_futex_wake (&(lock), 0x7fffffff); \
+ } while (0)
+
+
+/* There can only ever be one thread trying to get the exclusive lock. */
+#define __rtld_mrlock_change(lock) \
+ do { \
+ __label__ out; \
+ while (1) \
+ { \
+ int oldval; \
+ for (int tries = 0; tries < __RTLD_MRLOCK_TRIES; ++tries) \
+ { \
+ oldval = lock; \
+ while (__builtin_expect ((oldval & __RTLD_MRLOCK_RBITS) == 0, 1)) \
+ { \
+ int newval = ((oldval & __RTLD_MRLOCK_RWAIT) \
+ + __RTLD_MRLOCK_WRITER); \
+ int ret = atomic_compare_and_exchange_val_acq (&(lock), \
+ newval, \
+ oldval); \
+ if (__builtin_expect (ret == oldval, 1)) \
+ goto out; \
+ } \
+ atomic_delay (); \
+ } \
+ atomic_or (&(lock), __RTLD_MRLOCK_WWAIT); \
+ oldval |= __RTLD_MRLOCK_WWAIT; \
+ lll_futex_wait (lock, oldval); \
+ } \
+ out:; \
+ } while (0)
+
+
+#define __rtld_mrlock_done(lock) \
+ do { \
+ int oldval = atomic_exchange_and_add (&(lock), -__RTLD_MRLOCK_WRITER); \
+ if (__builtin_expect ((oldval & __RTLD_MRLOCK_RWAIT) != 0, 0)) \
+ lll_futex_wake (&(lock), 0x7fffffff); \
+ } while (0)
+
+
+/* Function to wait for variable become zero. Used in ld.so for
+ reference counters. */
+#define __rtld_waitzero(word) \
+ do { \
+ while (1) \
+ { \
+ int val = word; \
+ if (val == 0) \
+ break; \
+ lll_futex_wait (&(word), val); \
+ } \
+ } while (0)
+
+
+#define __rtld_notify(word) \
+ lll_futex_wake (&(word), 1)
+
+#endif
--- libc/sysdeps/generic/ldsodefs.h 24 Aug 2006 20:27:05 -0000 1.129
+++ libc/sysdeps/generic/ldsodefs.h 10 Oct 2006 00:27:22 -0000 1.130
@@ -38,6 +38,7 @@
#include <bits/libc-lock.h>
#include <hp-timing.h>
#include <tls.h>
+#include <rtld-lowlevel.h>
__BEGIN_DECLS
--- libc/sysdeps/generic/rtld-lowlevel.h 1 Jan 1970 00:00:00 -0000
+++ libc/sysdeps/generic/rtld-lowlevel.h 10 Oct 2006 00:20:42 -0000 1.1
@@ -0,0 +1 @@
+#error "Lowlevel primitives for ld.so not implemented"
glibc-rh211116.patch:
Makefile | 2 -
tst-xdrmem2.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
xdr_mem.c | 10 +++--
3 files changed, 121 insertions(+), 5 deletions(-)
--- NEW FILE glibc-rh211116.patch ---
2006-10-17 Jakub Jelinek <jakub at redhat.com>
* sunrpc/xdr_mem.c (xdrmem_setpos): Don't compare addresses
as signed longs, check for x_base + pos overflow.
* sunrpc/Makefile (tests): Add tst-xdrmem2.
* sunrpc/tst-xdrmem2.c: New test.
--- libc/sunrpc/xdr_mem.c 16 Dec 2002 10:25:27 -0000 1.15
+++ libc/sunrpc/xdr_mem.c 18 Oct 2006 19:25:01 -0000 1.16
@@ -177,13 +177,15 @@ xdrmem_setpos (xdrs, pos)
{
caddr_t newaddr = xdrs->x_base + pos;
caddr_t lastaddr = xdrs->x_private + xdrs->x_handy;
+ size_t handy = lastaddr - newaddr;
- if ((long) newaddr > (long) lastaddr
- || (UINT_MAX < LONG_MAX
- && (long) UINT_MAX < (long) lastaddr - (long) newaddr))
+ if (newaddr > lastaddr
+ || newaddr < xdrs->x_base
+ || handy != (u_int) handy)
return FALSE;
+
xdrs->x_private = newaddr;
- xdrs->x_handy = (long) lastaddr - (long) newaddr;
+ xdrs->x_handy = (u_int) handy;
return TRUE;
}
--- libc/sunrpc/Makefile 26 Jun 2005 18:24:19 -0000 1.84
+++ libc/sunrpc/Makefile 18 Oct 2006 19:25:38 -0000 1.85
@@ -85,7 +85,7 @@ all: # Make this the default target; it
include ../Makeconfig
-tests = tst-xdrmem
+tests = tst-xdrmem tst-xdrmem2
xtests := tst-getmyaddr
ifeq ($(have-thread-library),yes)
--- libc/sunrpc/tst-xdrmem2.c 1 Jan 1970 00:00:00 -0000
+++ libc/sunrpc/tst-xdrmem2.c 18 Oct 2006 19:24:16 -0000 1.1
@@ -0,0 +1,114 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub at redhat.com>, 2006.
+
+ 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. */
+
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+#include <rpc/rpc.h>
+#include <sys/mman.h>
+#include <unistd.h>
+
+static int
+do_test (void)
+{
+ XDR xdrs;
+ void *buf;
+ size_t ps = sysconf (_SC_PAGESIZE);
+ uintptr_t half = -1;
+ int v_int;
+ u_short v_u_short;
+
+ half = (half >> 1) & ~(uintptr_t) (ps - 1);
+ buf = mmap ((void *) half, 2 * ps, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (buf == MAP_FAILED || buf != (void *) half)
+ {
+ puts ("Couldn't mmap 2 pages in the middle of address space");
+ return 0;
+ }
+
+ xdrmem_create (&xdrs, (char *) buf, 2 * ps, XDR_ENCODE);
+
+#define T(type, val) \
+ v_##type = val; \
+ if (! xdr_##type (&xdrs, &v_##type)) \
+ { \
+ puts ("encoding of " #type \
+ " " #val " failed"); \
+ return 1; \
+ }
+
+ T(int, 127)
+
+ u_int pos = xdr_getpos (&xdrs);
+
+ T(u_short, 31)
+
+ if (! xdr_setpos (&xdrs, pos))
+ {
+ puts ("xdr_setpos during encoding failed");
+ return 1;
+ }
+
+ T(u_short, 36)
+
+#undef T
+
+ xdr_destroy (&xdrs);
+
+ xdrmem_create (&xdrs, (char *) buf, 2 * ps, XDR_DECODE);
+
+#define T(type, val) \
+ v_##type = 0x15; \
+ if (! xdr_##type (&xdrs, &v_##type)) \
+ { \
+ puts ("decoding of " #type \
+ " " #val " failed"); \
+ return 1; \
+ } \
+ if (v_##type != val) \
+ { \
+ puts ("decoded value differs, " \
+ "type " #type " " #val); \
+ return 1; \
+ }
+
+ T(int, 127)
+
+ pos = xdr_getpos (&xdrs);
+
+ T(u_short, 36)
+
+ if (! xdr_setpos (&xdrs, pos))
+ {
+ puts ("xdr_setpos during encoding failed");
+ return 1;
+ }
+
+ T(u_short, 36)
+
+#undef T
+
+ xdr_destroy (&xdrs);
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
glibc-rh213656.patch:
memusage.c | 6 ++++++
1 files changed, 6 insertions(+)
--- NEW FILE glibc-rh213656.patch ---
2006-11-02 Jakub Jelinek <jakub at redhat.com>
* malloc/memusage.c (dest): Reset not_me back to false after
printing statistics.
--- libc/malloc/memusage.c 11 Oct 2006 08:59:28 -0000 1.15
+++ libc/malloc/memusage.c 3 Nov 2006 17:00:19 -0000 1.16
@@ -887,4 +887,10 @@ dest (void)
fputc ('=', stderr);
fputs ("\e[0;0m\n", stderr);
}
+
+ /* Any following malloc/free etc. calls should generate statistics again,
+ because otherwise freeing something that has been malloced before
+ this destructor (including struct header in front of it) wouldn't
+ be properly freed. */
+ not_me = false;
}
glibc-rh214569.patch:
dl-load.c | 31 ++++++++++++-------------------
1 files changed, 12 insertions(+), 19 deletions(-)
--- NEW FILE glibc-rh214569.patch ---
2006-11-08 Jakub Jelinek <jakub at redhat.com>
* elf/dl-load.c (decompose_rpath): Return bool rather than void.
If l->l_name is on inhibit_rpath list, set sps->dirs to -1 and
return false, otherwise return true.
(cache_rpath): Return decompose_rpath return value.
--- libc/elf/dl-load.c 28 Oct 2006 06:44:04 -0000 1.283
+++ libc/elf/dl-load.c 9 Nov 2006 16:08:30 -0000 1.284
@@ -511,7 +511,7 @@ fillin_rpath (char *rpath, struct r_sear
}
-static void
+static bool
internal_function
decompose_rpath (struct r_search_path_struct *sps,
const char *rpath, struct link_map *l, const char *what)
@@ -546,19 +546,8 @@ decompose_rpath (struct r_search_path_st
{
/* This object is on the list of objects for which the
RUNPATH and RPATH must not be used. */
- result = calloc (1, sizeof *result);
- if (result == NULL)
- {
- signal_error_cache:
- errstring = N_("cannot create cache for search path");
- signal_error:
- _dl_signal_error (ENOMEM, NULL, NULL, errstring);
- }
-
- sps->dirs = result;
- sps->malloced = 1;
-
- return;
+ sps->dirs = (void *) -1;
+ return false;
}
while (*inhp != '\0')
@@ -588,7 +577,11 @@ decompose_rpath (struct r_search_path_st
result = (struct r_search_path_elem **) malloc ((nelems + 1 + 1)
* sizeof (*result));
if (result == NULL)
- goto signal_error_cache;
+ {
+ errstring = N_("cannot create cache for search path");
+ signal_error:
+ _dl_signal_error (ENOMEM, NULL, NULL, errstring);
+ }
fillin_rpath (copy, result, ":", 0, what, where);
@@ -599,6 +592,7 @@ decompose_rpath (struct r_search_path_st
sps->dirs = result;
/* The caller will change this value if we haven't used a real malloc. */
sps->malloced = 1;
+ return true;
}
/* Make sure cached path information is stored in *SP
@@ -623,10 +617,9 @@ cache_rpath (struct link_map *l,
}
/* Make sure the cache information is available. */
- decompose_rpath (sp, (const char *) (D_PTR (l, l_info[DT_STRTAB])
- + l->l_info[tag]->d_un.d_val),
- l, what);
- return true;
+ return decompose_rpath (sp, (const char *) (D_PTR (l, l_info[DT_STRTAB])
+ + l->l_info[tag]->d_un.d_val),
+ l, what);
}
glibc-rh215572.patch:
files-alias.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
--- NEW FILE glibc-rh215572.patch ---
2006-11-14 Jakub Jelinek <jakub at redhat.com>
* nss/nss_files/files-alias.c (get_next_alias): Set line back
to first_unused after parsing :include: file.
--- libc/nss/nss_files/files-alias.c 1 Sep 2002 12:38:05 -0000 1.15
+++ libc/nss/nss_files/files-alias.c 15 Nov 2006 22:23:20 -0000 1.16
@@ -298,8 +298,8 @@ get_next_alias (const char *match, struc
first_unused[room_left - 1] = '\0';
strncpy (first_unused, old_line, room_left);
- if (old_line != NULL)
- free (old_line);
+ free (old_line);
+ line = first_unused;
if (first_unused[room_left - 1] != '\0')
goto no_more_room;
glibc-rh216970.patch:
elf/dl-support.c | 1
sysdeps/powerpc/dl-procinfo.c | 13 ++++++++---
sysdeps/powerpc/dl-procinfo.h | 48 ++++++++++++++++++++++++++++++------------
sysdeps/powerpc/sysdep.h | 9 +++++--
4 files changed, 52 insertions(+), 19 deletions(-)
--- NEW FILE glibc-rh216970.patch ---
2006-11-28 Jakub Jelinek <jakub at redhat.com>
* elf/dl-support.c: Include dl-procinfo.h.
* sysdeps/powerpc/dl-procinfo.h (PPC_PLATFORM_POWER4,
PPC_PLATFORM_PPC970, PPC_PLATFORM_POWER5, PPC_PLATFORM_POWER5_PLUS,
PPC_PLATFORM_POWER6, PPC_PLATFORM_CELL_BE, PPC_PLATFORM_POWER6X):
Define.
(_dl_string_platform): Use PPC_PLATFORM_* macros instead of
hardcoded constants.
* sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_platform): Use
PPC_PLATFORM_* macros for array designators.
2006-11-11 Steven Munroe <sjmunroe at us.ibm.com>
* sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_cap_flags): Add 3 new cap
names to the beginning.
(_dl_powerpc_platforms): Add "power6x".
* sysdeps/powerpc/dl-procinfo.h (_DL_HWCAP_FIRST): Decrease.
(HWCAP_IMPORTANT): Add PPC_FEATURE_HAS_DFP.
(_DL_PLATFORMS_COUNT): Increase.
(_dl_string_platform): Handle power6x case.
* sysdeps/powerpc/sysdep.h (PPC_FEATURE_PA6T, PPC_FEATURE_HAS_DFP,
PPC_FEATURE_POWER6_EXT): Define.
(PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS): Correct Comment.
--- libc/elf/dl-support.c 27 Oct 2006 23:11:42 -0000 1.90
+++ libc/elf/dl-support.c 19 Dec 2006 15:23:02 -0000 1.91
@@ -29,6 +29,7 @@
#include <bits/libc-lock.h>
#include <dl-cache.h>
#include <dl-librecon.h>
+#include <dl-procinfo.h>
#include <unsecvars.h>
#include <hp-timing.h>
--- libc/sysdeps/powerpc/dl-procinfo.c 15 Sep 2006 07:47:28 -0000 1.2
+++ libc/sysdeps/powerpc/dl-procinfo.c 19 Dec 2006 15:21:49 -0000 1.3
@@ -46,10 +46,11 @@
#if !defined PROCINFO_DECL && defined SHARED
._dl_powerpc_cap_flags
#else
-PROCINFO_CLASS const char _dl_powerpc_cap_flags[20][10]
+PROCINFO_CLASS const char _dl_powerpc_cap_flags[23][10]
#endif
#ifndef PROCINFO_DECL
= {
+ "power6x", "dfp", "pa6t",
"arch_2_05", "ic_snoop", "smt", "booke",
"cellbe", "power5+", "power5", "power4",
"notb", "efpdouble", "efpsingle", "spe",
@@ -66,11 +67,17 @@ PROCINFO_CLASS const char _dl_powerpc_ca
#if !defined PROCINFO_DECL && defined SHARED
._dl_powerpc_platforms
#else
-PROCINFO_CLASS const char _dl_powerpc_platforms[6][12]
+PROCINFO_CLASS const char _dl_powerpc_platforms[7][12]
#endif
#ifndef PROCINFO_DECL
= {
- "power4", "ppc970", "power5", "power5+", "power6", "ppc-cell-be"
+ [PPC_PLATFORM_POWER4] = "power4",
+ [PPC_PLATFORM_PPC970] = "ppc970",
+ [PPC_PLATFORM_POWER5] = "power5",
+ [PPC_PLATFORM_POWER5_PLUS] = "power5+",
+ [PPC_PLATFORM_POWER6] = "power6",
+ [PPC_PLATFORM_CELL_BE] = "ppc-cell-be",
+ [PPC_PLATFORM_POWER6X] = "power6x"
}
#endif
#if !defined SHARED || defined PROCINFO_DECL
--- libc/sysdeps/powerpc/dl-procinfo.h 15 Sep 2006 07:47:45 -0000 1.2
+++ libc/sysdeps/powerpc/dl-procinfo.h 19 Dec 2006 15:30:32 -0000 1.4
@@ -24,19 +24,29 @@
#include <sysdep.h> /* This defines the PPC_FEATURE_* macros. */
/* There are 20 bits used, but they are bits 12..31. */
-#define _DL_HWCAP_FIRST 12
+#define _DL_HWCAP_FIRST 9
#define _DL_HWCAP_COUNT 32
/* These bits influence library search. */
-#define HWCAP_IMPORTANT (PPC_FEATURE_HAS_ALTIVEC)
+#define HWCAP_IMPORTANT (PPC_FEATURE_HAS_ALTIVEC \
+ + PPC_FEATURE_HAS_DFP)
-#define _DL_PLATFORMS_COUNT 6
+#define _DL_PLATFORMS_COUNT 7
#define _DL_FIRST_PLATFORM 32
/* Mask to filter out platforms. */
#define _DL_HWCAP_PLATFORM (((1ULL << _DL_PLATFORMS_COUNT) - 1) \
<< _DL_FIRST_PLATFORM)
+/* Platform bits (relative to _DL_FIRST_PLATFORM). */
+#define PPC_PLATFORM_POWER4 0
+#define PPC_PLATFORM_PPC970 1
+#define PPC_PLATFORM_POWER5 2
+#define PPC_PLATFORM_POWER5_PLUS 3
+#define PPC_PLATFORM_POWER6 4
+#define PPC_PLATFORM_CELL_BE 5
+#define PPC_PLATFORM_POWER6X 6
+
static inline const char *
__attribute__ ((unused))
_dl_hwcap_string (int idx)
@@ -68,22 +78,30 @@ _dl_string_platform (const char *str)
if (str == NULL)
return -1;
- if (strncmp (str, GLRO(dl_powerpc_platforms)[0], 5) == 0)
+ if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_POWER4], 5) == 0)
{
int ret;
str += 5;
switch (*str)
{
case '4':
- ret = _DL_FIRST_PLATFORM + 0;
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER4;
break;
case '5':
- ret = _DL_FIRST_PLATFORM + 2;
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5;
if (str[1] == '+')
- ++ret, ++str;
+ {
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5_PLUS;
+ ++str;
+ }
break;
case '6':
- ret = _DL_FIRST_PLATFORM + 4;
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6;
+ if (str[1] == 'x')
+ {
+ ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6X;
+ ++str;
+ }
break;
default:
return -1;
@@ -91,12 +109,16 @@ _dl_string_platform (const char *str)
if (str[1] == '\0')
return ret;
}
- else if (strncmp (str, GLRO(dl_powerpc_platforms)[1], 3) == 0)
+ else if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970],
+ 3) == 0)
{
- if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[1] + 3) == 0)
- return _DL_FIRST_PLATFORM + 1;
- else if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[5] + 3) == 0)
- return _DL_FIRST_PLATFORM + 5;
+ if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970]
+ + 3) == 0)
+ return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC970;
+ else if (strcmp (str + 3,
+ GLRO(dl_powerpc_platforms)[PPC_PLATFORM_CELL_BE] + 3)
+ == 0)
+ return _DL_FIRST_PLATFORM + PPC_PLATFORM_CELL_BE;
}
return -1;
--- libc/sysdeps/powerpc/sysdep.h 15 Sep 2006 07:48:04 -0000 1.8
+++ libc/sysdeps/powerpc/sysdep.h 19 Dec 2006 15:22:48 -0000 1.9
@@ -34,13 +34,16 @@
#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 /* SPE Double. */
#define PPC_FEATURE_NO_TB 0x00100000 /* 601/403gx have no timebase */
#define PPC_FEATURE_POWER4 0x00080000 /* POWER4 ISA 2.00 */
-#define PPC_FEATURE_POWER5 0x00040000 /* POWER5 ISA 2.01 */
-#define PPC_FEATURE_POWER5_PLUS 0x00020000 /* POWER5+ ISA 2.02 */
+#define PPC_FEATURE_POWER5 0x00040000 /* POWER5 ISA 2.02 */
+#define PPC_FEATURE_POWER5_PLUS 0x00020000 /* POWER5+ ISA 2.03 */
#define PPC_FEATURE_CELL_BE 0x00010000 /* CELL Broadband Engine */
#define PPC_FEATURE_BOOKE 0x00008000
-#define PPC_FEATURE_SMT 0x00004000
+#define PPC_FEATURE_SMT 0x00004000 /* Simultaneous Multi-Threading */
#define PPC_FEATURE_ICACHE_SNOOP 0x00002000
#define PPC_FEATURE_ARCH_2_05 0x00001000 /* ISA 2.05 */
+#define PPC_FEATURE_PA6T 0x00000800 /* PA Semi 6T Core */
+#define PPC_FEATURE_HAS_DFP 0x00000400 /* Decimal FP Unit */
+#define PPC_FEATURE_POWER6_EXT 0x00000200 /* P6 + mffgpr/mftgpr */
#define PPC_FEATURE_970 (PPC_FEATURE_POWER4 + PPC_FEATURE_HAS_ALTIVEC)
#ifdef __ASSEMBLER__
glibc-rh218276.patch:
io/Makefile | 2 -
io/tst-ttyname_r.c | 42 ++++++++++++++++++++++++++++++++++++
sysdeps/unix/sysv/linux/ttyname.c | 11 +++++----
sysdeps/unix/sysv/linux/ttyname_r.c | 11 +++++----
4 files changed, 55 insertions(+), 11 deletions(-)
--- NEW FILE glibc-rh218276.patch ---
2006-12-04 Jakub Jelinek <jakub at redhat.com>
* sysdeps/unix/sysv/linux/ttyname.c: Include termios.h.
(ttyname): Use tcgetattr instead of isatty, don't set errno to ENOTTY.
* sysdeps/unix/sysv/linux/ttyname_r.c: Include termios.h.
(__ttyname_r): Use tcgetattr instead of isatty, don't set errno to
ENOTTY.
* io/Makefile: Add rules to build and run tst-ttyname_r test.
* io/tst-ttyname_r.c: New test.
--- libc/sysdeps/unix/sysv/linux/ttyname.c 19 Apr 2006 07:26:48 -0000 1.20
+++ libc/sysdeps/unix/sysv/linux/ttyname.c 5 Dec 2006 21:25:29 -0000 1.21
@@ -22,6 +22,7 @@
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <termios.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
@@ -118,12 +119,12 @@ ttyname (int fd)
int dostat = 0;
char *name;
int save = errno;
+ struct termios term;
- if (__builtin_expect (!__isatty (fd), 0))
- {
- __set_errno (ENOTTY);
- return NULL;
- }
+ /* isatty check, tcgetattr is used because it sets the correct
+ errno (EBADF resp. ENOTTY) on error. */
+ if (__builtin_expect (__tcgetattr (fd, &term) < 0, 0))
+ return NULL;
/* We try using the /proc filesystem. */
*_fitoa_word (fd, __stpcpy (procname, "/proc/self/fd/"), 10, 0) = '\0';
--- libc/sysdeps/unix/sysv/linux/ttyname_r.c 19 Apr 2006 07:26:48 -0000 1.17
+++ libc/sysdeps/unix/sysv/linux/ttyname_r.c 5 Dec 2006 21:25:42 -0000 1.18
@@ -22,6 +22,7 @@
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <termios.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
@@ -115,11 +116,11 @@ __ttyname_r (int fd, char *buf, size_t b
return ERANGE;
}
- if (__builtin_expect (!__isatty (fd), 0))
- {
- __set_errno (ENOTTY);
- return ENOTTY;
- }
+ /* isatty check, tcgetattr is used because it sets the correct
+ errno (EBADF resp. ENOTTY) on error. */
+ struct termios term;
+ if (__builtin_expect (__tcgetattr (fd, &term) < 0, 0))
+ return errno;
/* We try using the /proc filesystem. */
*_fitoa_word (fd, __stpcpy (procname, "/proc/self/fd/"), 10, 0) = '\0';
--- libc/io/Makefile 28 Oct 2006 06:44:04 -0000 1.67
+++ libc/io/Makefile 5 Dec 2006 21:26:11 -0000 1.68
@@ -66,7 +66,7 @@ tests := test-utime test-stat test-stat
tst-openat tst-unlinkat tst-fstatat tst-futimesat \
tst-renameat tst-fchownat tst-fchmodat tst-faccessat \
tst-symlinkat tst-linkat tst-readlinkat tst-mkdirat \
- tst-mknodat tst-mkfifoat
+ tst-mknodat tst-mkfifoat tst-ttyname_r
distribute := ftwtest-sh
--- libc/io/tst-ttyname_r.c 1 Jan 1970 00:00:00 -0000
+++ libc/io/tst-ttyname_r.c 5 Dec 2006 21:26:01 -0000 1.1
@@ -0,0 +1,42 @@
+#include <errno.h>
+#include <error.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <unistd.h>
+
+static void do_prepare (void);
+#define PREPARE(argc, argv) do_prepare ()
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+#include <test-skeleton.c>
+
+static int temp_fd;
+
+static void
+do_prepare (void)
+{
+ char *temp_file;
+ temp_fd = create_temp_file ("tst-ttyname_r.", &temp_file);
+ if (temp_fd == -1)
+ error (1, errno, "cannot create temporary file");
+}
+
+static int
+do_test (void)
+{
+ int ret = 0;
+ char buf[sysconf (_SC_TTY_NAME_MAX) + 1];
+ int res = ttyname_r (-1, buf, sizeof (buf));
+ if (res != EBADF)
+ {
+ printf ("1st ttyname_r returned with res %d\n", res);
+ ret++;
+ }
+ res = ttyname_r (temp_fd, buf, sizeof (buf));
+ if (res != ENOTTY)
+ {
+ printf ("2nd ttyname_r returned with res %d\n", res);
+ ret++;
+ }
+ return ret;
+}
glibc-rh218782.patch:
getusershell.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
--- NEW FILE glibc-rh218782.patch ---
2006-12-09 Jakub Jelinek <jakub at redhat.com>
* misc/getusershell.c (initshells): Check for integer overflows.
Make strings buffer one bigger as fgets always succeeds when second
argument is 1. Don't use calloc for shells array. Disallow
/ as shell.
--- libc/misc/getusershell.c 15 May 2006 18:56:36 -0000 1.16
+++ libc/misc/getusershell.c 9 Dec 2006 22:25:00 -0000 1.17
@@ -98,7 +98,7 @@ initshells()
register char **sp, *cp;
register FILE *fp;
struct stat64 statb;
- int flen;
+ size_t flen;
free(shells);
shells = NULL;
@@ -114,9 +114,11 @@ initshells()
okshells[1] = _PATH_CSHELL;
return (char **) okshells;
}
- if ((strings = malloc((u_int)statb.st_size + 1)) == NULL)
+ if (statb.st_size > ~(size_t)0 / sizeof (char *) * 3)
goto init_okshells;
- shells = calloc((unsigned)statb.st_size / 3, sizeof (char *));
+ if ((strings = malloc(statb.st_size + 2)) == NULL)
+ goto init_okshells;
+ shells = malloc(statb.st_size / 3 * sizeof (char *));
if (shells == NULL) {
free(strings);
strings = NULL;
@@ -124,11 +126,11 @@ initshells()
}
sp = shells;
cp = strings;
- flen = statb.st_size;
+ flen = statb.st_size + 2;
while (fgets_unlocked(cp, flen - (cp - strings), fp) != NULL) {
while (*cp != '#' && *cp != '/' && *cp != '\0')
cp++;
- if (*cp == '#' || *cp == '\0')
+ if (*cp == '#' || *cp == '\0' || cp[1] == '\0')
continue;
*sp++ = cp;
while (!isspace(*cp) && *cp != '#' && *cp != '\0')
glibc-rh218802.patch:
Makefile | 2 +-
mntent_r.c | 9 +++------
tst-mntent2.c | 41 +++++++++++++++++++++++++++++++++++++++++
3 files changed, 45 insertions(+), 7 deletions(-)
--- NEW FILE glibc-rh218802.patch ---
2006-12-09 Jakub Jelinek <jakub at redhat.com>
* misc/mntent_r.c (__hasmntopt): Check p[optlen] even when p == rest.
Start searching for next comma at p rather than rest.
* misc/Makefile (tests): Add tst-mntent2.
* misc/tst-mntent2.c: New test.
--- libc/misc/Makefile 17 Jun 2006 17:00:58 -0000 1.119
+++ libc/misc/Makefile 9 Dec 2006 22:06:40 -0000 1.120
@@ -78,7 +78,7 @@ endif
gpl2lgpl := error.c error.h
tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \
- tst-error1 tst-pselect tst-insremque
+ tst-error1 tst-pselect tst-insremque tst-mntent2
ifeq (no,$(cross-compiling))
tests: $(objpfx)tst-error1-mem
endif
--- libc/misc/mntent_r.c 17 Dec 2003 23:29:02 -0000 1.20
+++ libc/misc/mntent_r.c 9 Dec 2006 22:05:59 -0000 1.21
@@ -278,14 +279,11 @@ __hasmntopt (const struct mntent *mnt, c
while ((p = strstr (rest, opt)) != NULL)
{
- if (p == rest
- || (p[-1] == ','
- && (p[optlen] == '\0' ||
- p[optlen] == '=' ||
- p[optlen] == ',')))
+ if ((p == rest || p[-1] == ',')
+ && (p[optlen] == '\0' || p[optlen] == '=' || p[optlen] == ','))
return p;
- rest = strchr (rest, ',');
+ rest = strchr (p, ',');
if (rest == NULL)
break;
++rest;
--- libc/misc/tst-mntent2.c 1 Jan 1970 00:00:00 -0000
+++ libc/misc/tst-mntent2.c 9 Dec 2006 22:06:27 -0000 1.1
@@ -0,0 +1,41 @@
+#include <mntent.h>
+#include <stdio.h>
+#include <string.h>
+
+
+int
+main (void)
+{
+ int result = 0;
+ struct mntent mef;
+
+ mef.mnt_fsname = strdupa ("/dev/sdf6");
+ mef.mnt_dir = strdupa ("/some dir");
+ mef.mnt_type = strdupa ("ext3");
+ mef.mnt_opts = strdupa ("opt1,opt2,noopt=6,rw,norw,brw");
+ mef.mnt_freq = 1;
+ mef.mnt_passno = 2;
+
+#define TEST(opt, found) \
+ if (!!hasmntopt (&mef, (opt)) != (found)) \
+ { \
+ printf ("Option %s was %sfound\n", (opt), (found) ? "not " : ""); \
+ result = 1; \
+ }
+
+ TEST ("opt1", 1)
+ TEST ("opt2", 1)
+ TEST ("noopt", 1)
+ TEST ("rw", 1)
+ TEST ("norw", 1)
+ TEST ("brw", 1)
+ TEST ("opt", 0)
+ TEST ("oopt", 0)
+ TEST ("w", 0)
+ TEST ("r", 0)
+ TEST ("br", 0)
+ TEST ("nor", 0)
+ TEST ("or", 0)
+
+ return result;
+}
glibc-rh219107.patch:
stdlib/Makefile | 3
stdlib/tst-makecontext.c | 57 ++++++++++++++++
sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S | 4 -
sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S | 1
4 files changed, 61 insertions(+), 4 deletions(-)
--- NEW FILE glibc-rh219107.patch ---
2006-12-19 Jakub Jelinek <jakub at redhat.com>
* stdlib/Makefile (tests): Add tst-makecontext.
* stdlib/tst-makecontext.c: New test.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
(__makecontext): Don't realign uc_mcontext.uc_regs.
2006-12-13 Jakub Jelinek <jakub at redhat.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S: Include
kernel-features.h.
--- libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S 29 Dec 2005 21:03:38 -0000 1.12
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S 13 Dec 2006 09:09:24 -0000 1.13
@@ -20,6 +20,7 @@
#include <sysdep.h>
#include <rtld-global-offsets.h>
#include <shlib-compat.h>
+#include <kernel-features.h>
#define __ASSEMBLY__
#include <asm/ptrace.h>
--- libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S 7 Jan 2006 03:51:11 -0000 1.6
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S 19 Dec 2006 15:33:10 -0000 1.7
@@ -26,9 +26,7 @@
ENTRY(__makecontext)
/* Set up the first 7 args to the function in its registers */
- addi r11,r3,_UC_REG_SPACE+12
- clrrwi r11,r11,4
- stw r11,_UC_REGS_PTR(r3)
+ lwz r11,_UC_REGS_PTR(r3)
stw r6,_UC_GREGS+(PT_R3*4)(r11)
stw r7,_UC_GREGS+(PT_R4*4)(r11)
stw r8,_UC_GREGS+(PT_R5*4)(r11)
--- libc/stdlib/Makefile 11 Dec 2006 21:43:10 -0000 1.113
+++ libc/stdlib/Makefile 19 Dec 2006 15:34:08 -0000 1.115
@@ -67,7 +67,8 @@ tests := tst-strtol tst-strtod testmb t
tst-xpg-basename tst-random tst-random2 tst-bsearch \
tst-limits tst-rand48 bug-strtod tst-setcontext \
test-a64l tst-qsort tst-system testmb2 bug-strtod2 \
- tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 tst-rand48-2
+ tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 tst-rand48-2 \
+ tst-makecontext
include ../Makeconfig
--- libc/stdlib/tst-makecontext.c 1 Jan 1970 00:00:00 -0000
+++ libc/stdlib/tst-makecontext.c 19 Dec 2006 15:33:58 -0000 1.1
@@ -0,0 +1,57 @@
+/* Copyright (C) 2006 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. */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ucontext.h>
+
+ucontext_t ucp;
+char st1[8192];
+__thread int thr;
+
+void
+cf (int i)
+{
+ if (i != 78 || thr != 94)
+ {
+ printf ("i %d thr %d\n", i, thr);
+ exit (1);
+ }
+ exit (0);
+}
+
+int
+main (void)
+{
+ if (getcontext (&ucp) != 0)
+ {
+ puts ("getcontext failed");
+ return 1;
+ }
+ thr = 94;
+ ucp.uc_link = NULL;
+ ucp.uc_stack.ss_sp = st1;
+ ucp.uc_stack.ss_size = sizeof st1;
+ makecontext (&ucp, (void (*) ()) cf, 1, 78);
+ if (setcontext (&ucp) != 0)
+ {
+ puts ("setcontext failed");
+ return 1;
+ }
+ return 2;
+}
glibc-rh219145.patch:
getXXbyYY_r.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
--- NEW FILE glibc-rh219145.patch ---
2006-12-19 Jakub Jelinek <jakub at redhat.com>
* nss/getXXbyYY_r.c: Include atomic.h.
(INTERNAL (REENTRANT_NAME)): Write startp after start_fct,
add atomic_write_barrier () in between.
--- libc/nss/getXXbyYY_r.c 16 Sep 2004 22:24:09 -0000 1.61
+++ libc/nss/getXXbyYY_r.c 19 Dec 2006 15:45:08 -0000 1.62
@@ -18,6 +18,7 @@
02111-1307 USA. */
#include <assert.h>
+#include <atomic.h>
#include <errno.h>
#include <stdbool.h>
#include "nsswitch.h"
@@ -173,9 +174,6 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, L
startp = (service_user *) -1l;
else
{
- startp = nip;
- start_fct = fct.l;
-
#ifdef NEED__RES
/* The resolver code will really be used so we have to
initialize it. */
@@ -190,6 +188,11 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, L
if (!_res_hconf.initialized)
_res_hconf_init ();
#endif /* need _res_hconf */
+
+ start_fct = fct.l;
+ /* Make sure start_fct is written before startp. */
+ atomic_write_barrier ();
+ startp = nip;
}
}
else
glibc-strtod.patch:
Makefile | 3 ++-
strtod_l.c | 38 ++++++++++++++++++++------------------
tst-atof1.c | 19 +++++++++++++++++++
tst-atof2.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
tst-strtod2.c | 25 +++++++++++++++++++++++++
tst-strtod3.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 176 insertions(+), 19 deletions(-)
--- NEW FILE glibc-strtod.patch ---
2006-12-11 Ulrich Drepper <drepper at redhat.com>
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Parse thousand
separators also if no non-zero digits found.
* stdlib/Makefile (tests): Add tst-strtod3.
2006-12-09 Ulrich Drepper <drepper at redhat.com>
[BZ #3664]
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix test to recognize
empty parsed strings.
* stdlib/Makefile (tests): Add tst-strtod2.
* stdlib/tst-strtod2.c: New file.
[BZ #3673]
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix exp_limit
computation.
* stdlib/Makefile (tests): Add tst-atof2.
* stdlib/tst-atof2.c: New file.
[BZ #3674]
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Adjust exponent value
correctly if removing trailing zero of hex-float.
* stdlib/Makefile (tests): Add tst-atof1.
* stdlib/tst-atof1.c: New file.
--- libc/stdlib/strtod_l.c 14 Jan 2006 12:09:09 -0000 1.14
+++ libc/stdlib/strtod_l.c 11 Dec 2006 21:43:48 -0000 1.19
@@ -662,20 +662,20 @@ ____STRTOF_INTERNAL (nptr, endptr, group
/* If no other digit but a '0' is found the result is 0.0.
Return current read pointer. */
- if ((c < L_('0') || c > L_('9'))
- && (base == 16 && (c < (CHAR_TYPE) TOLOWER (L_('a'))
- || c > (CHAR_TYPE) TOLOWER (L_('f'))))
+ if (!((c >= L_('0') && c <= L_('9'))
+ || (base == 16 && ((CHAR_TYPE) TOLOWER (c) >= L_('a')
+ && (CHAR_TYPE) TOLOWER (c) <= L_('f')))
#ifdef USE_WIDE_CHAR
- && c != (wint_t) decimal
+ || c == (wint_t) decimal
#else
- && ({ for (cnt = 0; decimal[cnt] != '\0'; ++cnt)
+ || ({ for (cnt = 0; decimal[cnt] != '\0'; ++cnt)
if (decimal[cnt] != cp[cnt])
break;
- decimal[cnt] != '\0'; })
+ decimal[cnt] == '\0'; })
#endif
- && (base == 16 && (cp == start_of_digits
- || (CHAR_TYPE) TOLOWER (c) != L_('p')))
- && (base != 16 && (CHAR_TYPE) TOLOWER (c) != L_('e')))
+ || (base == 16 && (cp != start_of_digits
+ && (CHAR_TYPE) TOLOWER (c) == L_('p')))
+ || (base != 16 && (CHAR_TYPE) TOLOWER (c) == L_('e'))))
{
#ifdef USE_WIDE_CHAR
tp = __correctly_grouped_prefixwc (start_of_digits, cp, thousands,
@@ -721,7 +721,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group
c = *++cp;
}
- if (grouping && dig_no > 0)
+ if (grouping && cp > start_of_digits)
{
/* Check the grouping of the digits. */
#ifdef USE_WIDE_CHAR
@@ -759,13 +759,15 @@ ____STRTOF_INTERNAL (nptr, endptr, group
}
}
- /* We have the number digits in the integer part. Whether these are all or
- any is really a fractional digit will be decided later. */
+ /* We have the number of digits in the integer part. Whether these
+ are all or any is really a fractional digit will be decided
+ later. */
int_no = dig_no;
lead_zero = int_no == 0 ? -1 : 0;
- /* Read the fractional digits. A special case are the 'american style'
- numbers like `16.' i.e. with decimal but without trailing digits. */
+ /* Read the fractional digits. A special case are the 'american
+ style' numbers like `16.' i.e. with decimal point but without
+ trailing digits. */
if (
#ifdef USE_WIDE_CHAR
c == (wint_t) decimal
@@ -815,15 +817,16 @@ ____STRTOF_INTERNAL (nptr, endptr, group
if (base == 16)
exp_limit = (exp_negative ?
-MIN_EXP + MANT_DIG + 4 * int_no :
- MAX_EXP - 4 * int_no + lead_zero);
+ MAX_EXP - 4 * int_no + 4 * lead_zero + 3);
else
exp_limit = (exp_negative ?
-MIN_10_EXP + MANT_DIG + int_no :
- MAX_10_EXP - int_no + lead_zero);
+ MAX_10_EXP - int_no + lead_zero + 1);
do
{
exponent *= 10;
+ exponent += c - L_('0');
if (exponent > exp_limit)
/* The exponent is too large/small to represent a valid
@@ -853,7 +856,6 @@ ____STRTOF_INTERNAL (nptr, endptr, group
/* NOTREACHED */
}
- exponent += c - L_('0');
c = *++cp;
}
while (c >= L_('0') && c <= L_('9'));
@@ -888,7 +890,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group
--expp;
--dig_no;
--int_no;
- ++exponent;
+ exponent += base == 16 ? 4 : 1;
}
while (dig_no > 0 && exponent < 0);
--- libc/stdlib/Makefile 28 Oct 2006 06:44:04 -0000 1.110
+++ libc/stdlib/Makefile 11 Dec 2006 21:43:10 -0000 1.113
@@ -66,7 +66,8 @@ tests := tst-strtol tst-strtod testmb t
test-canon test-canon2 tst-strtoll tst-environ \
tst-xpg-basename tst-random tst-random2 tst-bsearch \
tst-limits tst-rand48 bug-strtod tst-setcontext \
- test-a64l tst-qsort tst-system testmb2 bug-strtod2
+ test-a64l tst-qsort tst-system testmb2 bug-strtod2 \
+ tst-atof1 tst-atof2 tst-strtod2 tst-strtod3
include ../Makeconfig
--- libc/stdlib/tst-atof1.c 1 Jan 1970 00:00:00 -0000
+++ libc/stdlib/tst-atof1.c 10 Dec 2006 09:54:35 -0000 1.1
@@ -0,0 +1,19 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static int
+do_test (void)
+{
+ char buf[100];
+ snprintf (buf, sizeof (buf), "%g", atof ("0x10p-1"));
+ if (strcmp (buf, "8") != 0)
+ {
+ printf ("got \"%s\", expected \"8\"\n", buf);
+ return 1;
+ }
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
--- libc/stdlib/tst-atof2.c 1 Jan 1970 00:00:00 -0000
+++ libc/stdlib/tst-atof2.c 10 Dec 2006 01:10:17 -0000 1.1
@@ -0,0 +1,55 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+static const struct
+{
+ const char *str;
+ const char *expected;
+} tests[] =
+ {
+ { "1e308", "1e+308" },
+ { "100000000e300", "1e+308" },
+ { "0x1p1023", "8.98847e+307" },
+ { "0x1000p1011", "8.98847e+307" },
+ { "0x1p1020", "1.12356e+307" },
+ { "0x0.00001p1040", "1.12356e+307" },
+ { "1e-307", "1e-307" },
+ { "0.000001e-301", "1e-307" },
+ { "0.0000001e-300", "1e-307" },
+ { "0.00000001e-299", "1e-307" },
+ { "1000000e-313", "1e-307" },
+ { "10000000e-314", "1e-307" },
+ { "100000000e-315", "1e-307" },
+ { "0x1p-1021", "4.45015e-308" },
+ { "0x1000p-1033", "4.45015e-308" },
+ { "0x10000p-1037", "4.45015e-308" },
+ { "0x0.001p-1009", "4.45015e-308" },
+ { "0x0.0001p-1005", "4.45015e-308" },
+ };
+#define NTESTS (sizeof (tests) / sizeof (tests[0]))
+
+
+static int
+do_test (void)
+{
+ int status = 0;
+
+ for (int i = 0; i < NTESTS; ++i)
+ {
+ char buf[100];
+ snprintf (buf, sizeof (buf), "%g", atof (tests[i].str));
+ if (strcmp (buf, tests[i].expected) != 0)
+ {
+ printf ("%d: got \"%s\", expected \"%s\"\n",
+ i, buf, tests[i].expected);
+ status = 1;
+ }
+ }
+
+ return status;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
--- libc/stdlib/tst-strtod2.c 1 Jan 1970 00:00:00 -0000
+++ libc/stdlib/tst-strtod2.c 11 Dec 2006 21:36:30 -0000 1.2
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+static int
+do_test (void)
+{
+ int status = 0;
+ const char s[] = "0x";
+ char *ep;
+ double r = strtod (s, &ep);
+ if (r != 0)
+ {
+ printf ("r = %g, expect 0\n", r);
+ status = 1;
+ }
+ if (ep != s + 1)
+ {
+ printf ("strtod parsed %ju characters, expected 1\n", ep - s);
+ status = 1;
+ }
+ return status;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
--- libc/stdlib/tst-strtod3.c 1 Jan 1970 00:00:00 -0000
+++ libc/stdlib/tst-strtod3.c 11 Dec 2006 21:43:01 -0000 1.1
@@ -0,0 +1,55 @@
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static const struct
+{
+ const char *in;
+ const char *out;
+ double expected;
+} tests[] =
+ {
+ { "000,,,e1", ",,,e1", 0.0 },
+ { "000e1", "", 0.0 },
+ { "000,1e1", ",1e1", 0.0 }
+ };
+#define NTESTS (sizeof (tests) / sizeof (tests[0]))
+
+
+static int
+do_test (void)
+{
+ if (setlocale (LC_ALL, "en_US.ISO-8859-1") == NULL)
+ {
+ puts ("could not set locale");
+ return 1;
+ }
+
+ int status = 0;
+
+ for (int i = 0; i < NTESTS; ++i)
+ {
+ char *ep;
+ double r = __strtod_internal (tests[i].in, &ep, 1);
+
+ if (strcmp (ep, tests[i].out) != 0)
+ {
+ printf ("%d: got rest string \"%s\", expected \"%s\"\n",
+ i, ep, tests[i].out);
+ status = 1;
+ }
+
+ if (r != tests[i].expected)
+ {
+ printf ("%d: got wrong results %g, expected %g\n",
+ i, r, tests[i].expected);
+ status = 1;
+ }
+ }
+
+ return status;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
glibc-strxfrm.patch:
Makefile | 2 -
strxfrm_l.c | 8 +++--
tst-strxfrm2.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 89 insertions(+), 4 deletions(-)
Index: glibc-strxfrm.patch
===================================================================
RCS file: glibc-strxfrm.patch
diff -N glibc-strxfrm.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ glibc-strxfrm.patch 19 Dec 2006 23:23:44 -0000 1.5
@@ -0,0 +1,149 @@
+2006-11-10 Jakub Jelinek <jakub at redhat.com>
+
+ * string/strxfrm_l.c (STRXFRM): Fix trailing \1 optimization
+ if N is one bigger than return value.
+ * string/tst-strxfrm2.c (do_test): Also test strxfrm with l1 + 1
+ and l1 last arguments, if buf is defined, verify the return value
+ equals to strlen (buf) and verify no byte beyond passed length
+ is modified.
+
+2006-11-09 Ulrich Drepper <drepper at redhat.com>
+
+ * string/Makefile (tests): Add tst-strxfrm2.
+ * string/tst-strxfrm2.c: New file.
+
+2006-11-08 Jakub Jelinek <jakub at redhat.com>
+
+ * string/strxfrm_l.c (STRXFRM): Do the trailing \1 removal
+ optimization even if needed > n.
+
+--- libc/string/Makefile 4 Jun 2006 16:35:25 -0000 1.69
++++ libc/string/Makefile 9 Nov 2006 20:19:24 -0000 1.70
+@@ -54,7 +54,7 @@ tests := tester inl-tester noinl-tester
+ bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap \
+ tst-strtok tst-strxfrm bug-strcoll1 tst-strfry \
+ bug-strtok1 $(addprefix test-,$(strop-tests)) \
+- bug-envz1
++ bug-envz1 tst-strxfrm2
+ distribute := memcopy.h pagecopy.h tst-svc.expect test-string.h
+
+
+--- libc/string/strxfrm_l.c 15 Oct 2005 20:49:18 -0000 1.5
++++ libc/string/strxfrm_l.c 10 Nov 2006 15:18:46 -0000 1.7
+@@ -96,6 +97,7 @@ STRXFRM (STRING_TYPE *dest, const STRING
+ const int32_t *indirect;
+ uint_fast32_t pass;
+ size_t needed;
++ size_t last_needed;
+ const USTRING_TYPE *usrc;
+ size_t srclen = STRLEN (src);
+ int32_t *idxarr;
+@@ -197,6 +199,7 @@ STRXFRM (STRING_TYPE *dest, const STRING
+ this is true for all of them. */
+ int position = rule & sort_position;
+
++ last_needed = needed;
+ if (position == 0)
+ {
+ for (idxcnt = 0; idxcnt < idxmax; ++idxcnt)
+@@ -426,11 +429,11 @@ STRXFRM (STRING_TYPE *dest, const STRING
+ a `position' rule at the end and if no non-ignored character
+ is found the last \1 byte is immediately followed by a \0 byte
+ signalling this. We can avoid the \1 byte(s). */
+- if (needed <= n && needed > 2 && dest[needed - 2] == L('\1'))
++ if (needed > 2 && needed == last_needed + 1)
+ {
+ /* Remove the \1 byte. */
+- --needed;
+- dest[needed - 1] = L('\0');
++ if (--needed <= n)
++ dest[needed - 1] = L('\0');
+ }
+
+ /* Free the memory if needed. */
+--- libc/string/tst-strxfrm2.c 1 Jan 1970 00:00:00 -0000
++++ libc/string/tst-strxfrm2.c 10 Nov 2006 15:20:23 -0000 1.2
+@@ -0,0 +1,83 @@
++#include <locale.h>
++#include <stdio.h>
++#include <string.h>
++
++static int
++do_test (void)
++{
++ int res = 0;
++
++ char buf[20];
++ size_t l1 = strxfrm (NULL, "ab", 0);
++ size_t l2 = strxfrm (buf, "ab", 1);
++ size_t l3 = strxfrm (buf, "ab", sizeof (buf));
++ if (l3 < sizeof (buf) && strlen (buf) != l3)
++ {
++ puts ("C locale l3 test failed");
++ res = 1;
++ }
++
++ size_t l4 = strxfrm (buf, "ab", l1 + 1);
++ if (l4 < l1 + 1 && strlen (buf) != l4)
++ {
++ puts ("C locale l4 test failed");
++ res = 1;
++ }
++
++ buf[l1] = 'Z';
++ size_t l5 = strxfrm (buf, "ab", l1);
++ if (buf[l1] != 'Z')
++ {
++ puts ("C locale l5 test failed");
++ res = 1;
++ }
++
++ if (l1 != l2 || l1 != l3 || l1 != l4 || l1 != l5)
++ {
++ puts ("C locale retval test failed");
++ res = 1;
++ }
++
++ if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL)
++ {
++ puts ("setlocale failed");
++ res = 1;
++ }
++ else
++ {
++ l1 = strxfrm (NULL, "ab", 0);
++ l2 = strxfrm (buf, "ab", 1);
++ l3 = strxfrm (buf, "ab", sizeof (buf));
++ if (l3 < sizeof (buf) && strlen (buf) != l3)
++ {
++ puts ("UTF-8 locale l3 test failed");
++ res = 1;
++ }
++
++ l4 = strxfrm (buf, "ab", l1 + 1);
++ if (l4 < l1 + 1 && strlen (buf) != l4)
++ {
++ puts ("UTF-8 locale l4 test failed");
++ res = 1;
++ }
++
++ buf[l1] = 'Z';
++ l5 = strxfrm (buf, "ab", l1);
++ if (buf[l1] != 'Z')
++ {
++ puts ("UTF-8 locale l5 test failed");
++ res = 1;
++ }
++
++ if (l1 != l2 || l1 != l3 || l1 != l4 || l1 != l5)
++ {
++ puts ("UTF-8 locale retval test failed");
++ res = 1;
++ }
++ }
++
++ return res;
++}
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
glibc-sysconf-intel-core-duo.patch:
i386/sysconf.c | 30 +++++++++++++++++++++++++++++-
x86_64/sysconf.c | 30 +++++++++++++++++++++++++++++-
2 files changed, 58 insertions(+), 2 deletions(-)
--- NEW FILE glibc-sysconf-intel-core-duo.patch ---
2006-11-09 Ulrich Drepper <drepper at redhat.com>
* sysdeps/unix/sysv/linux/x86_64/sysconf.c (intel_check_word): Add
noinline attribute.
2006-11-10 Jakub Jelinek <jakub at redhat.com>
* sysdeps/unix/sysv/linux/i386/sysconf.c (intel_check_word): Add
noinline attribute.
2006-11-05 Ulrich Drepper <drepper at redhat.com>
* sysdeps/unix/sysv/linux/i386/sysconf.c (intel_check_word):
Update handling of cache descriptor 0x49 for new models.
* sysdeps/unix/sysv/linux/x86_64/sysconf.c (intel_check_word):
Likewise.
--- libc/sysdeps/unix/sysv/linux/i386/sysconf.c 6 Mar 2006 08:25:57 -0000 1.7
+++ libc/sysdeps/unix/sysv/linux/i386/sysconf.c 10 Nov 2006 07:30:31 -0000 1.9
@@ -97,7 +97,7 @@ static const struct intel_02_cache_info
{ 0x45, _SC_LEVEL2_CACHE_SIZE, 2097152, 4, 32 },
{ 0x46, _SC_LEVEL3_CACHE_SIZE, 4194304, 4, 64 },
{ 0x47, _SC_LEVEL3_CACHE_SIZE, 8388608, 8, 64 },
- { 0x49, _SC_LEVEL3_CACHE_SIZE, 4194304, 16, 64 },
+ { 0x49, _SC_LEVEL2_CACHE_SIZE, 4194304, 16, 64 },
{ 0x4a, _SC_LEVEL3_CACHE_SIZE, 6291456, 12, 64 },
{ 0x4b, _SC_LEVEL3_CACHE_SIZE, 8388608, 16, 64 },
{ 0x4c, _SC_LEVEL3_CACHE_SIZE, 12582912, 12, 64 },
@@ -140,6 +140,7 @@ intel_02_known_compare (const void *p1,
static long int
+__attribute__ ((noinline))
intel_check_word (int name, unsigned int value, bool *has_level_2,
bool *no_level_2_or_3)
{
@@ -166,6 +167,33 @@ intel_check_word (int name, unsigned int
}
else
{
+ if (byte == 0x49 && folded_name == _SC_LEVEL3_CACHE_SIZE)
+ {
+ /* Intel reused this value. For family 15, model 6 it
+ specifies the 3rd level cache. Otherwise the 2nd
+ level cache. */
+ unsigned int eax;
+ unsigned int ebx;
+ unsigned int ecx;
+ unsigned int edx;
+ asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1"
+ : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx)
+ : "0" (1));
+
+ unsigned int family = ((eax >> 20) & 0xff) + ((eax >> 8) & 0xf);
+ unsigned int model = ((((eax >>16) & 0xf) << 4)
+ + ((eax >> 4) & 0xf));
+ if (family == 15 && model == 6)
+ {
+ /* The level 3 cache is encoded for this model like
+ the level 2 cache is for other models. Pretend
+ the caller asked for the level 2 cache. */
+ name = (_SC_LEVEL2_CACHE_SIZE
+ + (name - _SC_LEVEL3_CACHE_SIZE));
+ folded_name = _SC_LEVEL3_CACHE_SIZE;
+ }
+ }
+
struct intel_02_cache_info *found;
struct intel_02_cache_info search;
--- libc/sysdeps/unix/sysv/linux/x86_64/sysconf.c 6 Mar 2006 08:25:57 -0000 1.5
+++ libc/sysdeps/unix/sysv/linux/x86_64/sysconf.c 10 Nov 2006 07:31:55 -0000 1.7
@@ -58,7 +58,7 @@ static const struct intel_02_cache_info
{ 0x45, _SC_LEVEL2_CACHE_SIZE, 2097152, 4, 32 },
{ 0x46, _SC_LEVEL3_CACHE_SIZE, 4194304, 4, 64 },
{ 0x47, _SC_LEVEL3_CACHE_SIZE, 8388608, 8, 64 },
- { 0x49, _SC_LEVEL3_CACHE_SIZE, 4194304, 16, 64 },
+ { 0x49, _SC_LEVEL2_CACHE_SIZE, 4194304, 16, 64 },
{ 0x4a, _SC_LEVEL3_CACHE_SIZE, 6291456, 12, 64 },
{ 0x4b, _SC_LEVEL3_CACHE_SIZE, 8388608, 16, 64 },
{ 0x4c, _SC_LEVEL3_CACHE_SIZE, 12582912, 12, 64 },
@@ -101,6 +101,7 @@ intel_02_known_compare (const void *p1,
static long int
+__attribute__ ((noinline))
intel_check_word (int name, unsigned int value, bool *has_level_2,
bool *no_level_2_or_3)
{
@@ -127,6 +128,33 @@ intel_check_word (int name, unsigned int
}
else
{
+ if (byte == 0x49 && folded_name == _SC_LEVEL3_CACHE_SIZE)
+ {
+ /* Intel reused this value. For family 15, model 6 it
+ specifies the 3rd level cache. Otherwise the 2nd
+ level cache. */
+ unsigned int eax;
+ unsigned int ebx;
+ unsigned int ecx;
+ unsigned int edx;
+ asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1"
+ : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx)
+ : "0" (1));
+
+ unsigned int family = ((eax >> 20) & 0xff) + ((eax >> 8) & 0xf);
+ unsigned int model = ((((eax >>16) & 0xf) << 4)
+ + ((eax >> 4) & 0xf));
+ if (family == 15 && model == 6)
+ {
+ /* The level 3 cache is encoded for this model like
+ the level 2 cache is for other models. Pretend
+ the caller asked for the level 2 cache. */
+ name = (_SC_LEVEL2_CACHE_SIZE
+ + (name - _SC_LEVEL3_CACHE_SIZE));
+ folded_name = _SC_LEVEL3_CACHE_SIZE;
+ }
+ }
+
struct intel_02_cache_info *found;
struct intel_02_cache_info search;
glibc-tst-pselect.patch:
tst-pselect.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
--- NEW FILE glibc-tst-pselect.patch ---
2006-12-14 Jakub Jelinek <jakub at redhat.com>
* misc/tst-pselect.c (do_test): Fix sigblock argument.
2006-12-14 Ulrich Drepper <drepper at redhat.com>
* misc/tst-pselect.c (do_test): Make sure the helper process is
terminating when the test is aborted.
--- libc/misc/tst-pselect.c 21 Jan 2006 19:58:31 -0000 1.2
+++ libc/misc/tst-pselect.c 14 Dec 2006 20:03:47 -0000 1.4
@@ -29,7 +29,16 @@ do_test (void)
return 1;
}
- if (sigblock (SIGUSR1) != 0)
+ sa.sa_handler = SIG_IGN;
+ sa.sa_flags = SA_NOCLDWAIT;
+
+ if (sigaction (SIGCHLD, &sa, NULL) != 0)
+ {
+ puts ("2nd sigaction failed");
+ return 1;
+ }
+
+ if (sigblock (sigmask (SIGUSR1)) != 0)
{
puts ("sigblock failed");
return 1;
@@ -52,6 +61,7 @@ do_test (void)
struct timespec to = { .tv_sec = 0, .tv_nsec = 500000000 };
+ pid_t parent = getpid ();
pid_t p = fork ();
if (p == 0)
{
@@ -63,6 +73,9 @@ do_test (void)
int e;
do
{
+ if (getppid () != parent)
+ exit (2);
+
errno = 0;
e = pselect (fds[0][0] + 1, &rfds, NULL, NULL, &to, &ss);
}
@@ -108,12 +121,6 @@ do_test (void)
return 1;
}
- if (TEMP_FAILURE_RETRY (waitpid (p, NULL, 0)) != p)
- {
- puts ("waitpid failed");
- return 1;
- }
-
return 0;
}
glibc-tzfile64.patch:
time/tzfile.c | 111 ++++++--
timezone/private.h | 83 +++++-
timezone/tzfile.h | 23 +
timezone/zdump.c | 37 +-
timezone/zic.c | 707 +++++++++++++++++++++++++++++++++++++++++------------
5 files changed, 728 insertions(+), 233 deletions(-)
--- NEW FILE glibc-tzfile64.patch ---
2006-11-14 Ulrich Drepper <drepper at redhat.com>
* timezone/zdump.c: Redo fix for BZ #3137.
2006-11-10 Ulrich Drepper <drepper at redhat.com>
* time/tzfile.c (__tzfile_read): Extend to handle new file format
on machines with 64-bit time_t.
* timezone/private.h: Update from tzcode2006o.
* timezone/tzfile.h: Likewise.
* timezone/zdump.c: Likewise.
* timezone/zic.c: Likewise.
--- libc/time/tzfile.c 20 Nov 2004 20:23:03 -0000 1.60
+++ libc/time/tzfile.c 12 Nov 2006 04:33:19 -0000 1.62
@@ -71,24 +72,34 @@ static inline int
__attribute ((always_inline))
decode (const void *ptr)
{
- if ((BYTE_ORDER == BIG_ENDIAN) && sizeof (int) == 4)
+ if (BYTE_ORDER == BIG_ENDIAN && sizeof (int) == 4)
return *(const int *) ptr;
- else if (BYTE_ORDER == LITTLE_ENDIAN && sizeof (int) == 4)
+ if (sizeof (int) == 4)
return bswap_32 (*(const int *) ptr);
- else
- {
- const unsigned char *p = ptr;
- int result = *p & (1 << (CHAR_BIT - 1)) ? ~0 : 0;
- result = (result << 8) | *p++;
- result = (result << 8) | *p++;
- result = (result << 8) | *p++;
- result = (result << 8) | *p++;
+ const unsigned char *p = ptr;
+ int result = *p & (1 << (CHAR_BIT - 1)) ? ~0 : 0;
- return result;
- }
+ result = (result << 8) | *p++;
+ result = (result << 8) | *p++;
+ result = (result << 8) | *p++;
+ result = (result << 8) | *p++;
+
+ return result;
}
+
+static inline int64_t
+__attribute ((always_inline))
+decode64 (const void *ptr)
+{
+ if ((BYTE_ORDER == BIG_ENDIAN))
+ return *(const int64_t *) ptr;
+
+ return bswap_64 (*(const int64_t *) ptr);
+}
+
+
void
__tzfile_read (const char *file, size_t extra, char **extrap)
{
@@ -102,6 +113,10 @@ __tzfile_read (const char *file, size_t
size_t types_idx;
size_t leaps_idx;
int was_using_tzfile = __use_tzfile;
+ int trans_width = 4;
+
+ if (sizeof (time_t) != 4 && sizeof (time_t) != 8)
+ abort ();
__use_tzfile = 0;
@@ -185,8 +200,10 @@ __tzfile_read (const char *file, size_t
/* No threads reading this stream. */
__fsetlocking (f, FSETLOCKING_BYCALLER);
+ read_again:
if (__builtin_expect (fread_unlocked ((void *) &tzhead, sizeof (tzhead),
- 1, f) != 1, 0))
+ 1, f) != 1, 0)
+ || memcmp (tzhead.tzh_magic, TZ_MAGIC, sizeof (tzhead.tzh_magic)) != 0)
goto lose;
num_transitions = (size_t) decode (tzhead.tzh_timecnt);
@@ -196,6 +213,26 @@ __tzfile_read (const char *file, size_t
num_isstd = (size_t) decode (tzhead.tzh_ttisstdcnt);
num_isgmt = (size_t) decode (tzhead.tzh_ttisgmtcnt);
+ /* For platforms with 64-bit time_t we use the new format if available. */
+ if (sizeof (time_t) == 8 && trans_width == 4
+ && tzhead.tzh_version[0] != '\0')
+ {
+ /* We use the 8-byte format. */
+ trans_width = 8;
+
+ /* Position the stream before the second header. */
+ size_t to_skip = (num_transitions * (4 + 1)
+ + num_types * 6
+ + chars
+ + num_leaps * 8
+ + num_isstd
+ + num_isgmt);
+ if (fseek (f, to_skip, SEEK_CUR) != 0)
+ goto lose;
+
+ goto read_again;
+ }
+
total_size = num_transitions * (sizeof (time_t) + 1);
total_size = ((total_size + __alignof__ (struct ttinfo) - 1)
& ~(__alignof__ (struct ttinfo) - 1));
@@ -205,10 +242,10 @@ __tzfile_read (const char *file, size_t
& ~(__alignof__ (struct leap) - 1));
leaps_idx = total_size;
total_size += num_leaps * sizeof (struct leap);
- /* This is for the extra memory required by the caller. */
- total_size += extra;
- transitions = (time_t *) malloc (total_size);
+ /* Allocate enough memory including the extra block requested by the
+ caller. */
+ transitions = (time_t *) malloc (total_size + extra);
if (transitions == NULL)
goto lose;
@@ -220,14 +257,11 @@ __tzfile_read (const char *file, size_t
if (extra > 0)
*extrap = (char *) &leaps[num_leaps];
- if (sizeof (time_t) < 4)
- abort ();
-
- if (sizeof (time_t) == 4)
+ if (sizeof (time_t) == 4 || trans_width == 8)
{
- if (__builtin_expect (fread_unlocked (transitions, 1,
- (4 + 1) * num_transitions, f)
- != (4 + 1) * num_transitions, 0))
+ if (__builtin_expect (fread_unlocked (transitions, trans_width + 1,
+ num_transitions, f)
+ != num_transitions, 0))
goto lose;
}
else
@@ -245,7 +279,9 @@ __tzfile_read (const char *file, size_t
if (__builtin_expect (type_idxs[i] >= num_types, 0))
goto lose;
- if (BYTE_ORDER != BIG_ENDIAN || sizeof (time_t) != 4)
+ if ((BYTE_ORDER != BIG_ENDIAN && (sizeof (time_t) == 4 || trans_width == 4))
+ || (BYTE_ORDER == BIG_ENDIAN && sizeof (time_t) == 8
+ && trans_width == 4))
{
/* Decode the transition times, stored as 4-byte integers in
network (big-endian) byte order. We work from the end of
@@ -255,6 +291,13 @@ __tzfile_read (const char *file, size_t
while (i-- > 0)
transitions[i] = decode ((char *) transitions + i * 4);
}
+ else if (BYTE_ORDER != BIG_ENDIAN && sizeof (time_t) == 8)
+ {
+ /* Decode the transition times, stored as 8-byte integers in
+ network (big-endian) byte order. */
+ for (i = 0; i < num_transitions; ++i)
+ transitions[i] = decode64 ((char *) transitions + i * 8);
+ }
for (i = 0; i < num_types; ++i)
{
@@ -280,13 +323,16 @@ __tzfile_read (const char *file, size_t
for (i = 0; i < num_leaps; ++i)
{
- unsigned char x[4];
- if (__builtin_expect (fread_unlocked (x, 1, sizeof (x), f) != sizeof (x),
- 0))
+ unsigned char x[8];
+ if (__builtin_expect (fread_unlocked (x, 1, trans_width, f)
+ != trans_width, 0))
goto lose;
- leaps[i].transition = (time_t) decode (x);
- if (__builtin_expect (fread_unlocked (x, 1, sizeof (x), f) != sizeof (x),
- 0))
+ if (sizeof (time_t) == 4 || trans_width == 4)
+ leaps[i].transition = (time_t) decode (x);
+ else
+ leaps[i].transition = (time_t) decode64 (x);
+
+ if (__builtin_expect (fread_unlocked (x, 1, 4, f) != 4, 0))
goto lose;
leaps[i].change = (long int) decode (x);
}
@@ -311,6 +357,12 @@ __tzfile_read (const char *file, size_t
while (i < num_types)
types[i++].isgmt = 0;
+ /* XXX When a version 2 file is available it can contain a POSIX TZ-style
+ formatted string which specifies how times past the last one specified
+ are supposed to be handled. We might want to handle this at some
+ point. But it might be overhead since most/all? files have an
+ open-ended last entry. */
+
fclose (f);
/* First "register" all timezone names. */
--- libc/timezone/private.h 2 Feb 2006 09:03:43 -0000 1.12
+++ libc/timezone/private.h 11 Nov 2006 02:04:43 -0000 1.13
@@ -21,7 +21,7 @@
#ifndef lint
#ifndef NOID
-static char privatehid[] = "@(#)private.h 7.55";
+static char privatehid[] = "@(#)private.h 8.2";
#endif /* !defined NOID */
#endif /* !defined lint */
@@ -89,7 +89,7 @@ static char privatehid[] = "@(#)private.
#include "stdio.h"
#include "errno.h"
#include "string.h"
-#include "limits.h" /* for CHAR_BIT */
+#include "limits.h" /* for CHAR_BIT et al. */
#include "time.h"
#include "stdlib.h"
@@ -125,20 +125,51 @@ static char privatehid[] = "@(#)private.
#define is_digit(c) ((unsigned)(c) - '0' <= 9)
/*
+** Define HAVE_STDINT_H's default value here, rather than at the
+** start, since __GLIBC__'s value depends on previously-included
+** files.
+** (glibc 2.1 and later have stdint.h, even with pre-C99 compilers.)
+*/
+#ifndef HAVE_STDINT_H
+#define HAVE_STDINT_H \
+ (199901 <= __STDC_VERSION__ || \
+ 2 < (__GLIBC__ + (0 < __GLIBC_MINOR__)))
+#endif /* !defined HAVE_STDINT_H */
+
+#if HAVE_STDINT_H
+#include "stdint.h"
+#endif /* !HAVE_STDINT_H */
+
+#ifndef INT_FAST64_MAX
+/* Pre-C99 GCC compilers define __LONG_LONG_MAX__ instead of LLONG_MAX. */
+#if defined LLONG_MAX || defined __LONG_LONG_MAX__
+typedef long long int_fast64_t;
+#else /* ! (defined LLONG_MAX || defined __LONG_LONG_MAX__) */
+#if (LONG_MAX >> 31) < 0xffffffff
+Please use a compiler that supports a 64-bit integer type (or wider);
+you may need to compile with "-DHAVE_STDINT_H".
+#endif /* (LONG_MAX >> 31) < 0xffffffff */
+typedef long int_fast64_t;
+#endif /* ! (defined LLONG_MAX || defined __LONG_LONG_MAX__) */
+#endif /* !defined INT_FAST64_MAX */
+
+#ifndef INT32_MAX
+#define INT32_MAX 0x7fffffff
+#endif /* !defined INT32_MAX */
+#ifndef INT32_MIN
+#define INT32_MIN (-1 - INT32_MAX)
+#endif /* !defined INT32_MIN */
+
+/*
** Workarounds for compilers/systems.
*/
/*
-** SunOS 4.1.1 cc lacks prototypes.
+** If your compiler lacks prototypes, "#define P(x) ()".
*/
#ifndef P
-#ifdef __STDC__
#define P(x) x
-#endif /* defined __STDC__ */
-#ifndef __STDC__
-#define P(x) ()
-#endif /* !defined __STDC__ */
#endif /* !defined P */
/*
@@ -211,14 +242,14 @@ extern char * asctime_r();
** Private function declarations.
*/
-char * icalloc P((int nelem, int elsize));
-char * icatalloc P((char * old, const char * new));
-char * icpyalloc P((const char * string));
-char * imalloc P((int n));
-void * irealloc P((void * pointer, int size));
-void icfree P((char * pointer));
-void ifree P((char * pointer));
-const char *scheck P((const char *string, const char *format));
+char * icalloc P((int nelem, int elsize));
+char * icatalloc P((char * old, const char * new));
+char * icpyalloc P((const char * string));
+char * imalloc P((int n));
+void * irealloc P((void * pointer, int size));
+void icfree P((char * pointer));
+void ifree P((char * pointer));
+const char * scheck P((const char * string, const char * format));
/*
** Finally, some convenience items.
@@ -310,6 +341,26 @@ char *asctime_r P((struct tm const *, ch
char *ctime_r P((time_t const *, char *));
#endif /* HAVE_INCOMPATIBLE_CTIME_R */
+#ifndef YEARSPERREPEAT
+#define YEARSPERREPEAT 400 /* years before a Gregorian repeat */
+#endif /* !defined YEARSPERREPEAT */
+
+/*
+** The Gregorian year averages 365.2425 days, which is 31556952 seconds.
+*/
+
+#ifndef AVGSECSPERYEAR
+#define AVGSECSPERYEAR 31556952L
+#endif /* !defined AVGSECSPERYEAR */
+
+#ifndef SECSPERREPEAT
+#define SECSPERREPEAT ((int_fast64_t) YEARSPERREPEAT * (int_fast64_t) AVGSECSPERYEAR)
+#endif /* !defined SECSPERREPEAT */
+
+#ifndef SECSPERREPEAT_BITS
+#define SECSPERREPEAT_BITS 34 /* ceil(log2(SECSPERREPEAT)) */
+#endif /* !defined SECSPERREPEAT_BITS */
+
/*
** UNIX was a registered trademark of The Open Group in 2003.
*/
--- libc/timezone/tzfile.h 10 Jan 2006 07:55:37 -0000 1.4
+++ libc/timezone/tzfile.h 11 Nov 2006 02:04:43 -0000 1.5
@@ -21,7 +21,7 @@
#ifndef lint
#ifndef NOID
-static char tzfilehid[] = "@(#)tzfile.h 7.18";
+static char tzfilehid[] = "@(#)tzfile.h 8.1";
#endif /* !defined NOID */
#endif /* !defined lint */
@@ -49,7 +49,8 @@ static char tzfilehid[] = "@(#)tzfile.h
struct tzhead {
char tzh_magic[4]; /* TZ_MAGIC */
- char tzh_reserved[16]; /* reserved for future use */
+ char tzh_version[1]; /* '\0' or '2' as of 2005 */
+ char tzh_reserved[15]; /* reserved--must be zero */
char tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
@@ -84,18 +85,22 @@ struct tzhead {
*/
/*
+** If tzh_version is '2' or greater, the above is followed by a second instance
+** of tzhead and a second instance of the data in which each coded transition
+** time uses 8 rather than 4 chars,
+** then a POSIX-TZ-environment-variable-style string for use in handling
+** instants after the last transition time stored in the file
+** (with nothing between the newlines if there is no POSIX representation for
+** such instants).
+*/
+
+/*
** In the current implementation, "tzset()" refuses to deal with files that
** exceed any of the limits below.
*/
#ifndef TZ_MAX_TIMES
-/*
-** The TZ_MAX_TIMES value below is enough to handle a bit more than a
-** year's worth of solar time (corrected daily to the nearest second) or
-** 138 years of Pacific Presidential Election time
-** (where there are three time zone transitions every fourth year).
-*/
-#define TZ_MAX_TIMES 370
+#define TZ_MAX_TIMES 1200
#endif /* !defined TZ_MAX_TIMES */
#ifndef TZ_MAX_TYPES
--- libc/timezone/zdump.c 21 Sep 2006 03:57:30 -0000 1.14
+++ libc/timezone/zdump.c 14 Nov 2006 16:04:43 -0000 1.16
@@ -1,4 +1,4 @@
-static char elsieid[] = "@(#)zdump.c 7.74";
+static char elsieid[] = "@(#)zdump.c 8.2";
/*
** This code has been made independent of the rest of the time
@@ -15,7 +15,7 @@ static char elsieid[] = "@(#)zdump.c 7.7
#include "ctype.h" /* for isalpha et al. */
#ifndef isascii
#define isascii(x) 1
-#endif
+#endif /* !defined isascii */
#ifndef ZDUMP_LO_YEAR
#define ZDUMP_LO_YEAR (-500)
@@ -130,11 +130,7 @@ static char elsieid[] = "@(#)zdump.c 7.7
#endif /* !defined TZ_DOMAIN */
#ifndef P
-#ifdef __STDC__
#define P(x) x
-#else /* !defined __STDC__ */
-#define P(x) ()
-#endif /* !defined __STDC__ */
#endif /* !defined P */
extern char ** environ;
@@ -418,14 +414,21 @@ _("%s: use of -v on system with floating
}
} else if (0 > (time_t) -1) {
/*
- ** time_t is signed.
+ ** time_t is signed. Assume overflow wraps around.
*/
- register time_t hibit;
+ time_t t = 0;
+ time_t t1 = 1;
- for (hibit = 1; (hibit * 2) != 0; hibit *= 2)
- continue;
- absolute_min_time = hibit;
- absolute_max_time = -(hibit + 1);
+ while (t < t1) {
+ t = t1;
+ t1 = 2 * t1 + 1;
+ }
+
+ absolute_max_time = t;
+ t = -t;
+ absolute_min_time = t - 1;
+ if (t < absolute_min_time)
+ absolute_min_time = t;
} else {
/*
** time_t is unsigned.
@@ -468,10 +471,7 @@ const long y;
}
static time_t
-hunt(name, lot, hit)
-char * name;
-time_t lot;
-time_t hit;
+hunt(char *name, time_t lot, time_t hit)
{
time_t t;
long diff;
@@ -541,10 +541,7 @@ struct tm * oldp;
}
static void
-show(zone, t, v)
-char * zone;
-time_t t;
-int v;
+show(char *zone, time_t t, int v)
{
register struct tm * tmp;
--- libc/timezone/zic.c 10 Jan 2006 07:55:37 -0000 1.22
+++ libc/timezone/zic.c 11 Nov 2006 02:04:43 -0000 1.23
@@ -1,15 +1,18 @@
-static char elsieid[] = "@(#)zic.c 7.128";
-
/*
-** Regardless of the type of time_t, we do our work using this type.
+** This file is in the public domain, so clarified as of
+** 2006-07-17 by Arthur David Olson.
*/
-typedef int zic_t;
+static char elsieid[] = "@(#)zic.c 8.7";
#include "private.h"
#include "locale.h"
#include "tzfile.h"
+#define ZIC_VERSION '2'
+
+typedef int_fast64_t zic_t;
+
#ifndef ZIC_MAX_ABBR_LEN_WO_WARN
#define ZIC_MAX_ABBR_LEN_WO_WARN 6
#endif /* !defined ZIC_MAX_ABBR_LEN_WO_WARN */
@@ -36,6 +39,11 @@ typedef int zic_t;
#define isascii(x) 1
#endif
+#define OFFSET_STRLEN_MAXIMUM (7 + INT_STRLEN_MAXIMUM(long))
+#define RULE_STRLEN_MAXIMUM 8 /* "Mdd.dd.d" */
+
+#define end(cp) (strchr((cp), '\0'))
+
struct rule {
const char * r_filename;
int r_linenum;
@@ -44,6 +52,8 @@ struct rule {
int r_loyear; /* for example, 1986 */
int r_hiyear; /* for example, 1986 */
const char * r_yrtype;
+ int r_lowasnum;
+ int r_hiwasnum;
int r_month; /* 0..11 */
@@ -103,9 +113,10 @@ static void adjleap P((void));
static void associate P((void));
static int ciequal P((const char * ap, const char * bp));
static void convert P((long val, char * buf));
+static void convert64 P((zic_t val, char * buf));
static void dolink P((const char * fromfile, const char * tofile));
static void doabbr P((char * abbr, const char * format,
- const char * letters, int isdst));
+ const char * letters, int isdst, int doquotes));
static void eat P((const char * name, int num));
static void eats P((const char * name, int num,
const char * rname, int rnum));
@@ -121,6 +132,7 @@ static void inrule P((char ** fields, in
static int inzcont P((char ** fields, int nfields));
static int inzone P((char ** fields, int nfields));
static int inzsub P((char ** fields, int nfields, int iscont));
+static int is32 P((zic_t x));
static int itsabbr P((const char * abbr, const char * word));
static int itsdir P((const char * name));
static int lowerit P((int c));
@@ -130,16 +142,22 @@ static void newabbr P((const char * abbr
static long oadd P((long t1, long t2));
static void outzone P((const struct zone * zp, int ntzones));
static void puttzcode P((long code, FILE * fp));
+static void puttzcode64 P((zic_t code, FILE * fp));
static int rcomp P((const void * leftp, const void * rightp));
static zic_t rpytime P((const struct rule * rp, int wantedy));
static void rulesub P((struct rule * rp,
const char * loyearp, const char * hiyearp,
const char * typep, const char * monthp,
const char * dayp, const char * timep));
+static int stringoffset P((char * result, long offset));
+static int stringrule P((char * result, const struct rule * rp,
+ long dstoff, long gmtoff));
+static void stringzone P((char * result,
+ const struct zone * zp, int ntzones));
static void setboundaries P((void));
static zic_t tadd P((zic_t t1, long t2));
static void usage P((void));
-static void writezone P((const char * name));
+static void writezone P((const char * name, const char * string));
static int yearistype P((int year, const char * type));
#if !HAVE_STRERROR
@@ -150,13 +168,16 @@ static int charcnt;
static int errors;
static const char * filename;
static int leapcnt;
+static int leapseen;
+static int leapminyear;
+static int leapmaxyear;
static int linenum;
+static int max_abbrvar_len;
+static int max_format_len;
static zic_t max_time;
static int max_year;
-static int max_year_representable;
static zic_t min_time;
static int min_year;
-static int min_year_representable;
static int noise;
static const char * rfilename;
static int rlinenum;
@@ -453,7 +474,7 @@ static void
usage P((void))
{
(void) fprintf(stderr, _("%s: usage is %s \
-[ --version ] [ -s ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
+[ --version ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
\t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n"),
progname, progname);
exit(EXIT_FAILURE);
@@ -464,7 +485,6 @@ static const char * lcltime;
static const char * directory;
static const char * leapsec;
static const char * yitcommand;
-static int sflag = FALSE;
int
main(argc, argv)
@@ -486,6 +506,11 @@ char * argv[];
(void) textdomain(TZ_DOMAIN);
#endif /* HAVE_GETTEXT */
progname = argv[0];
+ if (TYPE_BIT(zic_t) < 64) {
+ (void) fprintf(stderr, "%s: %s\n", progname,
+ _("wild compilation-time specification of zic_t"));
+ exit(EXIT_FAILURE);
+ }
for (i = 1; i < argc; ++i)
if (strcmp(argv[i], "--version") == 0) {
(void) printf("%s\n", elsieid);
@@ -549,7 +574,7 @@ _("%s: More than one -L option specified
noise = TRUE;
break;
case 's':
- sflag = TRUE;
+ (void) printf("%s: -s ignored\n", progname);
break;
}
if (optind == argc - 1 && strcmp(argv[optind], "=") == 0)
@@ -671,54 +696,17 @@ warning(_("hard link failed, symbolic li
ifree(toname);
}
-#ifndef INT_MAX
-#define INT_MAX ((int) (((unsigned)~0)>>1))
-#endif /* !defined INT_MAX */
-
-#ifndef INT_MIN
-#define INT_MIN ((int) ~(((unsigned)~0)>>1))
-#endif /* !defined INT_MIN */
-
-/*
-** The tz file format currently allows at most 32-bit quantities.
-** This restriction should be removed before signed 32-bit values
-** wrap around in 2038, but unfortunately this will require a
-** change to the tz file format.
-*/
-
-#define MAX_BITS_IN_FILE 32
-#define TIME_T_BITS_IN_FILE ((TYPE_BIT(zic_t) < MAX_BITS_IN_FILE) ? \
- TYPE_BIT(zic_t) : MAX_BITS_IN_FILE)
+#define TIME_T_BITS_IN_FILE 64
static void
setboundaries P((void))
{
register int i;
- if (TYPE_SIGNED(zic_t)) {
- min_time = -1;
- for (i = 0; i < TIME_T_BITS_IN_FILE - 1; ++i)
- min_time *= 2;
- max_time = -(min_time + 1);
- if (sflag)
- min_time = 0;
- } else {
- min_time = 0;
- max_time = 2 - sflag;
- for (i = 0; i < TIME_T_BITS_IN_FILE - 1; ++i)
- max_time *= 2;
- --max_time;
- }
- {
- time_t t;
-
- t = (time_t) min_time;
- min_year = TM_YEAR_BASE + gmtime(&t)->tm_year;
- t = (time_t) max_time;
- max_year = TM_YEAR_BASE + gmtime(&t)->tm_year;
- }
- min_year_representable = min_year;
- max_year_representable = max_year;
+ min_time = -1;
+ for (i = 0; i < TIME_T_BITS_IN_FILE - 1; ++i)
+ min_time *= 2;
+ max_time = -(min_time + 1);
}
static int
@@ -993,6 +981,8 @@ const int nfields;
fields[RF_MONTH], fields[RF_DAY], fields[RF_TOD]);
r.r_name = ecpyalloc(fields[RF_NAME]);
r.r_abbrvar = ecpyalloc(fields[RF_ABBRVAR]);
+ if (max_abbrvar_len < strlen(r.r_abbrvar))
+ max_abbrvar_len = strlen(r.r_abbrvar);
rules = (struct rule *) (void *) erealloc((char *) rules,
(int) ((nrules + 1) * sizeof *rules));
rules[nrules++] = r;
@@ -1098,6 +1088,8 @@ const int iscont;
}
z.z_rule = ecpyalloc(fields[i_rule]);
z.z_format = ecpyalloc(fields[i_format]);
+ if (max_format_len < strlen(z.z_format))
+ max_format_len = strlen(z.z_format);
hasuntil = nfields > i_untilyear;
if (hasuntil) {
z.z_untilrule.r_filename = filename;
@@ -1159,6 +1151,11 @@ const int nfields;
error(_("invalid leaping year"));
return;
}
+ if (!leapseen || leapmaxyear < year)
+ leapmaxyear = year;
+ if (!leapseen || leapminyear > year)
+ leapminyear = year;
+ leapseen = TRUE;
j = EPOCH_YEAR;
while (j != year) {
if (year > j) {
@@ -1313,7 +1310,8 @@ const char * const timep;
*/
cp = loyearp;
lp = byword(cp, begin_years);
- if (lp != NULL) switch ((int) lp->l_value) {
+ rp->r_lowasnum = lp == NULL;
+ if (!rp->r_lowasnum) switch ((int) lp->l_value) {
case YR_MINIMUM:
rp->r_loyear = INT_MIN;
break;
@@ -1328,14 +1326,11 @@ const char * const timep;
} else if (sscanf(cp, scheck(cp, "%d"), &rp->r_loyear) != 1) {
error(_("invalid starting year"));
return;
- } else if (noise) {
- if (rp->r_loyear < min_year_representable)
- warning(_("starting year too low to be represented"));
- else if (rp->r_loyear > max_year_representable)
- warning(_("starting year too high to be represented"));
}
cp = hiyearp;
- if ((lp = byword(cp, end_years)) != NULL) switch ((int) lp->l_value) {
+ lp = byword(cp, end_years);
+ rp->r_hiwasnum = lp == NULL;
+ if (!rp->r_hiwasnum) switch ((int) lp->l_value) {
case YR_MINIMUM:
rp->r_hiyear = INT_MIN;
break;
@@ -1353,11 +1348,6 @@ const char * const timep;
} else if (sscanf(cp, scheck(cp, "%d"), &rp->r_hiyear) != 1) {
error(_("invalid ending year"));
return;
- } else if (noise) {
- if (rp->r_loyear < min_year_representable)
- warning(_("ending year too low to be represented"));
- else if (rp->r_loyear > max_year_representable)
- warning(_("ending year too high to be represented"));
}
if (rp->r_loyear > rp->r_hiyear) {
error(_("starting year greater than ending year"));
@@ -1372,8 +1362,6 @@ const char * const timep;
}
rp->r_yrtype = ecpyalloc(typep);
}
- if (rp->r_loyear < min_year && rp->r_loyear > 0)
- min_year = rp->r_loyear;
/*
** Day work.
** Accept things such as:
@@ -1427,13 +1415,25 @@ const long val;
char * const buf;
{
register int i;
- register long shift;
+ register int shift;
for (i = 0, shift = 24; i < 4; ++i, shift -= 8)
buf[i] = val >> shift;
}
static void
+convert64(val, buf)
+const zic_t val;
+char * const buf;
+{
+ register int i;
+ register int shift;
+
+ for (i = 0, shift = 56; i < 8; ++i, shift -= 8)
+ buf[i] = val >> shift;
+}
+
+static void
puttzcode(val, fp)
const long val;
FILE * const fp;
@@ -1444,28 +1444,50 @@ FILE * const fp;
(void) fwrite((void *) buf, (size_t) sizeof buf, (size_t) 1, fp);
}
+static void
+puttzcode64(val, fp)
+const zic_t val;
+FILE * const fp;
+{
+ char buf[8];
+
+ convert64(val, buf);
+ (void) fwrite((void *) buf, (size_t) sizeof buf, (size_t) 1, fp);
+}
+
static int
atcomp(avp, bvp)
-void * avp;
-void * bvp;
+const void * avp;
+const void * bvp;
{
- if (((struct attype *) avp)->at < ((struct attype *) bvp)->at)
- return -1;
- else if (((struct attype *) avp)->at > ((struct attype *) bvp)->at)
- return 1;
- else return 0;
+ const zic_t a = ((const struct attype *) avp)->at;
+ const zic_t b = ((const struct attype *) bvp)->at;
+
+ return (a < b) ? -1 : (a > b);
+}
+
+static int
+is32(x)
+const zic_t x;
+{
+ return INT32_MIN <= x && x <= INT32_MAX;
}
static void
-writezone(name)
+writezone(name, string)
const char * const name;
+const char * const string;
{
- register FILE * fp;
- register int i, j;
- static char * fullname;
- static struct tzhead tzh;
- zic_t ats[TZ_MAX_TIMES];
- unsigned char types[TZ_MAX_TIMES];
+ register FILE * fp;
+ register int i, j;
+ register int leapcnt32, leapi32;
+ register int timecnt32, timei32;
+ register int pass;
+ static char * fullname;
+ static const struct tzhead tzh0;
+ static struct tzhead tzh;
+ zic_t ats[TZ_MAX_TIMES];
+ unsigned char types[TZ_MAX_TIMES];
/*
** Sort.
@@ -1509,6 +1531,36 @@ const char * const name;
ats[i] = attypes[i].at;
types[i] = attypes[i].type;
}
+ /*
+ ** Correct for leap seconds.
+ */
+ for (i = 0; i < timecnt; ++i) {
+ j = leapcnt;
+ while (--j >= 0)
+ if (ats[i] > trans[j] - corr[j]) {
+ ats[i] = tadd(ats[i], corr[j]);
+ break;
+ }
+ }
+ /*
+ ** Figure out 32-bit-limited starts and counts.
+ */
+ timecnt32 = timecnt;
+ timei32 = 0;
+ leapcnt32 = leapcnt;
+ leapi32 = 0;
+ while (timecnt32 > 0 && !is32(ats[timecnt32 - 1]))
+ --timecnt32;
+ while (timecnt32 > 0 && !is32(ats[timei32])) {
+ --timecnt32;
+ ++timei32;
+ }
+ while (leapcnt32 > 0 && !is32(trans[leapcnt32 - 1]))
+ --leapcnt32;
+ while (leapcnt32 > 0 && !is32(trans[leapi32])) {
+ --leapcnt32;
+ ++leapi32;
+ }
fullname = erealloc(fullname,
(int) (strlen(directory) + 1 + strlen(name) + 1));
(void) sprintf(fullname, "%s/%s", directory, name);
@@ -1533,67 +1585,150 @@ const char * const name;
exit(EXIT_FAILURE);
}
}
- convert(eitol(typecnt), tzh.tzh_ttisgmtcnt);
- convert(eitol(typecnt), tzh.tzh_ttisstdcnt);
- convert(eitol(leapcnt), tzh.tzh_leapcnt);
- convert(eitol(timecnt), tzh.tzh_timecnt);
- convert(eitol(typecnt), tzh.tzh_typecnt);
- convert(eitol(charcnt), tzh.tzh_charcnt);
- (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ for (pass = 1; pass <= 2; ++pass) {
+ register int thistimei, thistimecnt;
+ register int thisleapi, thisleapcnt;
+ register int thistimelim, thisleaplim;
+ int writetype[TZ_MAX_TIMES];
+ int typemap[TZ_MAX_TYPES];
+ register int thistypecnt;
+ char thischars[TZ_MAX_CHARS];
+ char thischarcnt;
+ int indmap[TZ_MAX_CHARS];
+
+ if (pass == 1) {
+ thistimei = timei32;
+ thistimecnt = timecnt32;
+ thisleapi = leapi32;
+ thisleapcnt = leapcnt32;
+ } else {
+ thistimei = 0;
+ thistimecnt = timecnt;
+ thisleapi = 0;
+ thisleapcnt = leapcnt;
+ }
+ thistimelim = thistimei + thistimecnt;
+ thisleaplim = thisleapi + thisleapcnt;
+ for (i = 0; i < typecnt; ++i)
+ writetype[i] = thistimecnt == timecnt;
+ if (thistimecnt == 0) {
+ /*
+ ** No transition times fall in the current
+ ** (32- or 64-bit) window.
+ */
+ if (typecnt != 0)
+ writetype[typecnt - 1] = TRUE;
+ } else {
+ for (i = thistimei - 1; i < thistimelim; ++i)
+ if (i >= 0)
+ writetype[types[i]] = TRUE;
+ /*
+ ** For America/Godthab and Antarctica/Palmer
+ */
+ if (thistimei == 0)
+ writetype[0] = TRUE;
+ }
+ thistypecnt = 0;
+ for (i = 0; i < typecnt; ++i)
+ typemap[i] = writetype[i] ? thistypecnt++ : -1;
+ for (i = 0; i < sizeof indmap / sizeof indmap[0]; ++i)
+ indmap[i] = -1;
+ thischarcnt = 0;
+ for (i = 0; i < typecnt; ++i) {
+ register char * thisabbr;
+
+ if (!writetype[i])
+ continue;
+ if (indmap[abbrinds[i]] >= 0)
+ continue;
+ thisabbr = &chars[abbrinds[i]];
+ for (j = 0; j < thischarcnt; ++j)
+ if (strcmp(&thischars[j], thisabbr) == 0)
+ break;
+ if (j == thischarcnt) {
+ (void) strcpy(&thischars[(int) thischarcnt],
+ thisabbr);
+ thischarcnt += strlen(thisabbr) + 1;
+ }
+ indmap[abbrinds[i]] = j;
+ }
#define DO(field) (void) fwrite((void *) tzh.field, \
(size_t) sizeof tzh.field, (size_t) 1, fp)
- DO(tzh_magic);
- DO(tzh_reserved);
- DO(tzh_ttisgmtcnt);
- DO(tzh_ttisstdcnt);
- DO(tzh_leapcnt);
- DO(tzh_timecnt);
- DO(tzh_typecnt);
- DO(tzh_charcnt);
+ tzh = tzh0;
+ (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = ZIC_VERSION;
+ convert(eitol(thistypecnt), tzh.tzh_ttisgmtcnt);
+ convert(eitol(thistypecnt), tzh.tzh_ttisstdcnt);
+ convert(eitol(thisleapcnt), tzh.tzh_leapcnt);
+ convert(eitol(thistimecnt), tzh.tzh_timecnt);
+ convert(eitol(thistypecnt), tzh.tzh_typecnt);
+ convert(eitol(thischarcnt), tzh.tzh_charcnt);
+ DO(tzh_magic);
+ DO(tzh_version);
+ DO(tzh_reserved);
+ DO(tzh_ttisgmtcnt);
+ DO(tzh_ttisstdcnt);
+ DO(tzh_leapcnt);
+ DO(tzh_timecnt);
+ DO(tzh_typecnt);
+ DO(tzh_charcnt);
#undef DO
- for (i = 0; i < timecnt; ++i) {
- j = leapcnt;
- while (--j >= 0)
- if (ats[i] >= trans[j]) {
- ats[i] = tadd(ats[i], corr[j]);
- break;
+ for (i = thistimei; i < thistimelim; ++i)
+ if (pass == 1)
+ puttzcode((long) ats[i], fp);
+ else puttzcode64(ats[i], fp);
+ for (i = thistimei; i < thistimelim; ++i) {
+ unsigned char uc;
+
+ uc = typemap[types[i]];
+ (void) fwrite((void *) &uc,
+ (size_t) sizeof uc,
+ (size_t) 1,
+ fp);
+ }
+ for (i = 0; i < typecnt; ++i)
+ if (writetype[i]) {
+ puttzcode(gmtoffs[i], fp);
+ (void) putc(isdsts[i], fp);
+ (void) putc((unsigned char) indmap[abbrinds[i]], fp);
}
- puttzcode((long) ats[i], fp);
+ if (thischarcnt != 0)
+ (void) fwrite((void *) thischars,
+ (size_t) sizeof thischars[0],
+ (size_t) thischarcnt, fp);
+ for (i = thisleapi; i < thisleaplim; ++i) {
+ register zic_t todo;
+
+ if (roll[i]) {
+ if (timecnt == 0 || trans[i] < ats[0]) {
+ j = 0;
+ while (isdsts[j])
+ if (++j >= typecnt) {
+ j = 0;
+ break;
+ }
+ } else {
+ j = 1;
+ while (j < timecnt &&
+ trans[i] >= ats[j])
+ ++j;
+ j = types[j - 1];
+ }
+ todo = tadd(trans[i], -gmtoffs[j]);
+ } else todo = trans[i];
+ if (pass == 1)
+ puttzcode((long) todo, fp);
+ else puttzcode64(todo, fp);
+ puttzcode(corr[i], fp);
+ }
+ for (i = 0; i < typecnt; ++i)
+ if (writetype[i])
+ (void) putc(ttisstds[i], fp);
+ for (i = 0; i < typecnt; ++i)
+ if (writetype[i])
+ (void) putc(ttisgmts[i], fp);
}
- if (timecnt > 0)
- (void) fwrite((void *) types, (size_t) sizeof types[0],
- (size_t) timecnt, fp);
- for (i = 0; i < typecnt; ++i) {
- puttzcode((long) gmtoffs[i], fp);
- (void) putc(isdsts[i], fp);
- (void) putc(abbrinds[i], fp);
- }
- if (charcnt != 0)
- (void) fwrite((void *) chars, (size_t) sizeof chars[0],
- (size_t) charcnt, fp);
- for (i = 0; i < leapcnt; ++i) {
- if (roll[i]) {
- if (timecnt == 0 || trans[i] < ats[0]) {
- j = 0;
- while (isdsts[j])
- if (++j >= typecnt) {
- j = 0;
- break;
- }
- } else {
- j = 1;
- while (j < timecnt && trans[i] >= ats[j])
- ++j;
- j = types[j - 1];
- }
- puttzcode((long) tadd(trans[i], -gmtoffs[j]), fp);
- } else puttzcode((long) trans[i], fp);
- puttzcode((long) corr[i], fp);
- }
- for (i = 0; i < typecnt; ++i)
- (void) putc(ttisstds[i], fp);
- for (i = 0; i < typecnt; ++i)
- (void) putc(ttisgmts[i], fp);
+ (void) fprintf(fp, "\n%s\n", string);
if (ferror(fp) || fclose(fp)) {
(void) fprintf(stderr, _("%s: Error writing %s\n"),
progname, fullname);
@@ -1602,21 +1737,223 @@ const char * const name;
}
static void
-doabbr(abbr, format, letters, isdst)
+doabbr(abbr, format, letters, isdst, doquotes)
char * const abbr;
const char * const format;
const char * const letters;
const int isdst;
+const int doquotes;
{
- if (strchr(format, '/') == NULL) {
+ register char * cp;
+ register char * slashp;
+ register int len;
+
+ slashp = strchr(format, '/');
+ if (slashp == NULL) {
if (letters == NULL)
(void) strcpy(abbr, format);
else (void) sprintf(abbr, format, letters);
- } else if (isdst)
- (void) strcpy(abbr, strchr(format, '/') + 1);
- else {
- (void) strcpy(abbr, format);
- *strchr(abbr, '/') = '\0';
+ } else if (isdst) {
+ (void) strcpy(abbr, slashp + 1);
+ } else {
+ if (slashp > format)
+ (void) strncpy(abbr, format,
+ (unsigned) (slashp - format));
+ abbr[slashp - format] = '\0';
+ }
+ if (!doquotes)
+ return;
+ for (cp = abbr; *cp != '\0'; ++cp)
+ if (strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", *cp) == NULL &&
+ strchr("abcdefghijklmnopqrstuvwxyz", *cp) == NULL)
+ break;
+ len = strlen(abbr);
+ if (len > 0 && *cp == '\0')
+ return;
+ abbr[len + 2] = '\0';
+ abbr[len + 1] = '>';
+ for ( ; len > 0; --len)
+ abbr[len] = abbr[len - 1];
+ abbr[0] = '<';
+}
+
+static void
+updateminmax(x)
+const int x;
+{
+ if (min_year > x)
+ min_year = x;
+ if (max_year < x)
+ max_year = x;
+}
+
+static int
+stringoffset(result, offset)
+char * result;
+long offset;
+{
+ register int hours;
+ register int minutes;
+ register int seconds;
+
+ result[0] = '\0';
+ if (offset < 0) {
+ (void) strcpy(result, "-");
+ offset = -offset;
+ }
+ seconds = offset % SECSPERMIN;
+ offset /= SECSPERMIN;
+ minutes = offset % MINSPERHOUR;
+ offset /= MINSPERHOUR;
+ hours = offset;
+ if (hours >= HOURSPERDAY) {
+ result[0] = '\0';
+ return -1;
+ }
+ (void) sprintf(end(result), "%d", hours);
+ if (minutes != 0 || seconds != 0) {
+ (void) sprintf(end(result), ":%02d", minutes);
+ if (seconds != 0)
+ (void) sprintf(end(result), ":%02d", seconds);
+ }
+ return 0;
+}
+
+static int
+stringrule(result, rp, dstoff, gmtoff)
+char * result;
+const struct rule * const rp;
+const long dstoff;
+const long gmtoff;
+{
+ register long tod;
+
+ result = end(result);
+ if (rp->r_dycode == DC_DOM) {
+ register int month, total;
+
+ if (rp->r_dayofmonth == 29 && rp->r_month == TM_FEBRUARY)
+ return -1;
+ total = 0;
+ for (month = 0; month < rp->r_month; ++month)
+ total += len_months[0][month];
+ (void) sprintf(result, "J%d", total + rp->r_dayofmonth);
+ } else {
+ register int week;
+
+ if (rp->r_dycode == DC_DOWGEQ) {
+ week = 1 + rp->r_dayofmonth / DAYSPERWEEK;
+ if ((week - 1) * DAYSPERWEEK + 1 != rp->r_dayofmonth)
+ return -1;
+ } else if (rp->r_dycode == DC_DOWLEQ) {
+ if (rp->r_dayofmonth == len_months[1][rp->r_month])
+ week = 5;
+ else {
+ week = 1 + rp->r_dayofmonth / DAYSPERWEEK;
+ if (week * DAYSPERWEEK - 1 != rp->r_dayofmonth)
+ return -1;
+ }
+ } else return -1; /* "cannot happen" */
+ (void) sprintf(result, "M%d.%d.%d",
+ rp->r_month + 1, week, rp->r_wday);
+ }
+ tod = rp->r_tod;
+ if (rp->r_todisgmt)
+ tod += gmtoff;
+ if (rp->r_todisstd && rp->r_stdoff == 0)
+ tod += dstoff;
+ if (tod < 0) {
+ result[0] = '\0';
+ return -1;
+ }
+ if (tod != 2 * SECSPERMIN * MINSPERHOUR) {
+ (void) strcat(result, "/");
+ if (stringoffset(end(result), tod) != 0)
+ return -1;
+ }
+ return 0;
+}
+
+static void
+stringzone(result, zpfirst, zonecount)
+char * result;
+const struct zone * const zpfirst;
+const int zonecount;
+{
+ register const struct zone * zp;
+ register struct rule * rp;
+ register struct rule * stdrp;
+ register struct rule * dstrp;
+ register int i;
+ register const char * abbrvar;
+
+ result[0] = '\0';
+ zp = zpfirst + zonecount - 1;
+ stdrp = dstrp = NULL;
+ for (i = 0; i < zp->z_nrules; ++i) {
+ rp = &zp->z_rules[i];
+ if (rp->r_hiwasnum || rp->r_hiyear != INT_MAX)
+ continue;
+ if (rp->r_yrtype != NULL)
+ continue;
+ if (rp->r_stdoff == 0) {
+ if (stdrp == NULL)
+ stdrp = rp;
+ else return;
+ } else {
+ if (dstrp == NULL)
+ dstrp = rp;
+ else return;
+ }
+ }
+ if (stdrp == NULL && dstrp == NULL) {
+ /*
+ ** There are no rules running through "max".
+ ** Let's find the latest rule.
+ */
+ for (i = 0; i < zp->z_nrules; ++i) {
+ rp = &zp->z_rules[i];
+ if (stdrp == NULL || rp->r_hiyear > stdrp->r_hiyear ||
+ (rp->r_hiyear == stdrp->r_hiyear &&
+ rp->r_month > stdrp->r_month))
+ stdrp = rp;
+ }
+ if (stdrp != NULL && stdrp->r_stdoff != 0)
+ return; /* We end up in DST (a POSIX no-no). */
+ /*
+ ** Horrid special case: if year is 2037,
+ ** presume this is a zone handled on a year-by-year basis;
+ ** do not try to apply a rule to the zone.
+ */
+ if (stdrp != NULL && stdrp->r_hiyear == 2037)
+ return;
+ }
+ if (stdrp == NULL && zp->z_nrules != 0)
+ return;
+ abbrvar = (stdrp == NULL) ? "" : stdrp->r_abbrvar;
+ doabbr(result, zp->z_format, abbrvar, FALSE, TRUE);
+ if (stringoffset(end(result), -zp->z_gmtoff) != 0) {
+ result[0] = '\0';
+ return;
+ }
+ if (dstrp == NULL)
+ return;
+ doabbr(end(result), zp->z_format, dstrp->r_abbrvar, TRUE, TRUE);
+ if (dstrp->r_stdoff != SECSPERMIN * MINSPERHOUR)
+ if (stringoffset(end(result),
+ -(zp->z_gmtoff + dstrp->r_stdoff)) != 0) {
+ result[0] = '\0';
+ return;
+ }
+ (void) strcat(result, ",");
+ if (stringrule(result, dstrp, dstrp->r_stdoff, zp->z_gmtoff) != 0) {
+ result[0] = '\0';
+ return;
+ }
+ (void) strcat(result, ",");
+ if (stringrule(result, stdrp, dstrp->r_stdoff, zp->z_gmtoff) != 0) {
+ result[0] = '\0';
+ return;
}
}
@@ -1637,8 +1974,17 @@ const int zonecount;
register int startttisstd;
register int startttisgmt;
register int type;
- char startbuf[BUFSIZ];
-
+ register char * startbuf;
+ register char * ab;
+ register char * envvar;
+ register int max_abbr_len;
+ register int max_envvar_len;
+
+ max_abbr_len = 2 + max_format_len + max_abbrvar_len;
+ max_envvar_len = 2 * max_abbr_len + 5 * 9;
+ startbuf = emalloc(max_abbr_len + 1);
+ ab = emalloc(max_abbr_len + 1);
+ envvar = emalloc(max_envvar_len + 1);
INITIALIZE(untiltime);
INITIALIZE(starttime);
/*
@@ -1653,6 +1999,48 @@ const int zonecount;
*/
startttisstd = FALSE;
startttisgmt = FALSE;
+ min_year = max_year = EPOCH_YEAR;
+ if (leapseen) {
+ updateminmax(leapminyear);
+ updateminmax(leapmaxyear);
+ }
+ for (i = 0; i < zonecount; ++i) {
+ zp = &zpfirst[i];
+ updateminmax(zp->z_untilrule.r_loyear);
+ for (j = 0; j < zp->z_nrules; ++j) {
+ rp = &zp->z_rules[j];
+ if (rp->r_lowasnum)
+ updateminmax(rp->r_loyear);
+ if (rp->r_hiwasnum)
+ updateminmax(rp->r_hiyear);
+ }
+ }
+ /*
+ ** Generate lots of data if a rule can't cover all future times.
+ */
+ stringzone(envvar, zpfirst, zonecount);
+ if (noise && envvar[0] == '\0') {
+ register char * wp;
+
+wp = ecpyalloc(_("no POSIX environment variable for zone"));
+ wp = ecatalloc(wp, " ");
+ wp = ecatalloc(wp, zpfirst->z_name);
+ warning(wp);
+ ifree(wp);
+ }
+ if (envvar[0] == '\0') {
+ if (min_year >= INT_MIN + YEARSPERREPEAT)
+ min_year -= YEARSPERREPEAT;
+ else min_year = INT_MIN;
+ if (max_year <= INT_MAX - YEARSPERREPEAT)
+ max_year += YEARSPERREPEAT;
+ else max_year = INT_MAX;
+ }
+ /*
+ ** For the benefit of older systems, generate data through 2037.
+ */
+ if (max_year < 2037)
+ max_year = 2037;
for (i = 0; i < zonecount; ++i) {
/*
** A guess that may well be corrected later.
@@ -1670,7 +2058,7 @@ const int zonecount;
if (zp->z_nrules == 0) {
stdoff = zp->z_stdoff;
doabbr(startbuf, zp->z_format,
- (char *) NULL, stdoff != 0);
+ (char *) NULL, stdoff != 0, FALSE);
type = addtype(oadd(zp->z_gmtoff, stdoff),
startbuf, stdoff != 0, startttisstd,
startttisgmt);
@@ -1700,7 +2088,6 @@ const int zonecount;
register int k;
register zic_t jtime, ktime;
register long offset;
- char buf[BUFSIZ];
INITIALIZE(ktime);
if (useuntil) {
@@ -1756,24 +2143,27 @@ const int zonecount;
stdoff);
doabbr(startbuf, zp->z_format,
rp->r_abbrvar,
- rp->r_stdoff != 0);
+ rp->r_stdoff != 0,
+ FALSE);
continue;
}
if (*startbuf == '\0' &&
startoff == oadd(zp->z_gmtoff,
- stdoff))
+ stdoff)) {
doabbr(startbuf,
zp->z_format,
rp->r_abbrvar,
rp->r_stdoff !=
- 0);
+ 0,
+ FALSE);
+ }
}
eats(zp->z_filename, zp->z_linenum,
rp->r_filename, rp->r_linenum);
- doabbr(buf, zp->z_format, rp->r_abbrvar,
- rp->r_stdoff != 0);
+ doabbr(ab, zp->z_format, rp->r_abbrvar,
+ rp->r_stdoff != 0, FALSE);
offset = oadd(zp->z_gmtoff, rp->r_stdoff);
- type = addtype(offset, buf, rp->r_stdoff != 0,
+ type = addtype(offset, ab, rp->r_stdoff != 0,
rp->r_todisstd, rp->r_todisgmt);
addtt(ktime, type);
}
@@ -1806,7 +2196,10 @@ error(_("can't determine time zone abbre
starttime = tadd(starttime, -gmtoff);
}
}
- writezone(zpfirst->z_name);
+ writezone(zpfirst->z_name, envvar);
+ ifree(startbuf);
+ ifree(ab);
+ ifree(envvar);
}
static void
@@ -2185,8 +2578,6 @@ register const int wantedy;
will not work with pre-2004 versions of zic"));
}
}
- if (dayoff < 0 && !TYPE_SIGNED(zic_t))
- return min_time;
if (dayoff < min_time / SECSPERDAY)
return min_time;
if (dayoff > max_time / SECSPERDAY)
Index: glibc.spec
===================================================================
RCS file: /cvs/dist/rpms/glibc/FC-6/glibc.spec,v
retrieving revision 1.277
retrieving revision 1.278
diff -u -r1.277 -r1.278
--- glibc.spec 8 Oct 2006 14:29:54 -0000 1.277
+++ glibc.spec 19 Dec 2006 23:23:44 -0000 1.278
@@ -3,7 +3,7 @@
%define glibcsrcdir glibc-2.5-20061008T1257
%define glibc_release_tarballs 0
%define glibcversion 2.5
-%define glibcrelease 3
+%define glibcrelease 8%{?dist}
%define auxarches i586 i686 athlon sparcv9 alphaev6
%define xenarches i686 athlon
%ifarch %{xenarches}
@@ -36,6 +36,40 @@
Source3: %{glibcname}-fedora-%{glibcdate}.tar.bz2
Patch0: %{glibcname}-fedora.patch
Patch1: %{name}-ia64-lib64.patch
+Patch2: glibc-bz3352.patch
+Patch3: glibc-bz3369.patch
+Patch4: glibc-i386-syscall6.patch
+Patch5: glibc-rh210130.patch
+Patch6: glibc-rh211116.patch
+Patch7: glibc-bz3429.patch
+Patch8: glibc-bz3451.patch
+Patch9: glibc-nptl_db-dtvp.patch
+Patch10: glibc-r_debug-r_map.patch
+Patch11: glibc-rh213656.patch
+Patch12: glibc-rh214569.patch
+Patch13: glibc-strxfrm.patch
+Patch14: glibc-sysconf-intel-core-duo.patch
+Patch15: glibc-tzfile64.patch
+Patch16: glibc-bz3320.patch
+Patch17: glibc-bz3559.patch
+Patch18: glibc-mai_IN.patch
+Patch19: glibc-po-update.patch
+Patch20: glibc-powerpc-cpu-addon-update.patch
+Patch21: glibc-rh215572.patch
+Patch22: glibc-bz3632.patch
+Patch23: glibc-memusage.patch
+Patch24: glibc-nis+-getenv.patch
+Patch25: glibc-rh206483.patch
+Patch26: glibc-rh218276.patch
+Patch27: glibc-rh218782.patch
+Patch28: glibc-rh218802.patch
+Patch29: glibc-strtod.patch
+Patch30: glibc-bz2337.patch
+Patch31: glibc-bz3747.patch
+Patch32: glibc-rh216970.patch
+Patch33: glibc-rh219107.patch
+Patch34: glibc-rh219145.patch
+Patch35: glibc-tst-pselect.patch
Buildroot: %{_tmppath}/glibc-%{PACKAGE_VERSION}-root
Obsoletes: zoneinfo, libc-static, libc-devel, libc-profile, libc-headers,
Obsoletes: gencat, locale, ldconfig, locale-ja, glibc-profile
@@ -247,6 +281,40 @@
%patch1 -p1
%endif
%endif
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+#%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
+%patch13 -p1
+%patch14 -p1
+%patch15 -p1
+%patch16 -p1
+%patch17 -p1
+%patch18 -p1
+%patch19 -p1
+%patch20 -p1
+%patch21 -p1
+%patch22 -p1
+%patch23 -p1
+%patch24 -p1
+%patch25 -p1
+%patch26 -p1
+%patch27 -p1
+%patch28 -p1
+%patch29 -p1
+%patch30 -p1
+%patch31 -p1
+%patch32 -p1
+%patch33 -p1
+%patch34 -p1
+%patch35 -p1
# Hack till glibc-kernheaders get updated, argh
mkdir -p override_headers/linux
@@ -909,6 +977,7 @@
%ifarch %{rtkaioarches}
rm -f $RPM_BUILD_ROOT{,%{_prefix}}/%{_lib}/librtkaio.so*
+rm -f $RPM_BUILD_ROOT%{_prefix}/%{_lib}/librt.so.*
mkdir -p $RPM_BUILD_ROOT/%{_lib}/rtkaio
mv $RPM_BUILD_ROOT/%{_lib}/librtkaio-*.so $RPM_BUILD_ROOT/%{_lib}/rtkaio/
rm -f $RPM_BUILD_ROOT/%{_lib}/$librtso
@@ -944,7 +1013,7 @@
%if %{buildpower6}
cd build-%{nptl_target_cpu}-linuxnptl-power6
-mkdir -p $RPM_BUILD_ROOT/%{_lib}/power6/
+mkdir -p $RPM_BUILD_ROOT/%{_lib}/power6{,x}
cp -a libc.so $RPM_BUILD_ROOT/%{_lib}/power6/`basename $RPM_BUILD_ROOT/%{_lib}/libc-*.so`
ln -sf `basename $RPM_BUILD_ROOT/%{_lib}/libc-*.so` $RPM_BUILD_ROOT/%{_lib}/power6/`basename $RPM_BUILD_ROOT/%{_lib}/libc.so.*`
cp -a math/libm.so $RPM_BUILD_ROOT/%{_lib}/power6/`basename $RPM_BUILD_ROOT/%{_lib}/libm-*.so`
@@ -957,10 +1026,18 @@
ln -sf `basename $RPM_BUILD_ROOT/%{_lib}/librt-*.so` $RPM_BUILD_ROOT/%{_lib}/power6/$librtso
cp -a nptl_db/libthread_db.so $RPM_BUILD_ROOT/%{_lib}/power6/`basename $RPM_BUILD_ROOT/%{_lib}/libthread_db-*.so`
ln -sf `basename $RPM_BUILD_ROOT/%{_lib}/libthread_db-*.so` $RPM_BUILD_ROOT/%{_lib}/power6/`basename $RPM_BUILD_ROOT/%{_lib}/libthread_db.so.*`
+pushd $RPM_BUILD_ROOT/%{_lib}/power6x
+ln -sf ../power6/*.so .
+cp -a ../power6/*.so.* .
+popd
%ifarch %{rtkaioarches}
-mkdir -p $RPM_BUILD_ROOT/%{_lib}/rtkaio/power6
+mkdir -p $RPM_BUILD_ROOT/%{_lib}/rtkaio/power6{,x}
cp -a rtkaio/librtkaio.so $RPM_BUILD_ROOT/%{_lib}/rtkaio/power6/`basename $RPM_BUILD_ROOT/%{_lib}/librt-*.so | sed s/librt-/librtkaio-/`
ln -sf `basename $RPM_BUILD_ROOT/%{_lib}/rtkaio/power6/librtkaio-*.so` $RPM_BUILD_ROOT/%{_lib}/rtkaio/power6/$librtso
+pushd $RPM_BUILD_ROOT/%{_lib}/rtkaio/power6x
+ln -sf ../power6/*.so .
+cp -a ../power6/*.so.* .
+popd
%endif
cd ..
%endif
@@ -1159,6 +1236,11 @@
rm -rf $RPM_BUILD_ROOT%{_prefix}/share/zoneinfo
+# Make sure %config files have the same timestamp
+touch -r fedora/glibc.spec.in $RPM_BUILD_ROOT/etc/ld.so.conf
+touch -r timezone/northamerica $RPM_BUILD_ROOT/etc/localtime
+touch -r sunrpc/etc.rpc $RPM_BUILD_ROOT/etc/rpc
+
cd fedora
$GCC -Os -static -o build-locale-archive build-locale-archive.c \
../build-%{nptl_target_cpu}-linuxnptl/locale/locarchive.o \
@@ -1446,8 +1528,10 @@
%endif
%if %{buildpower6}
%dir /%{_lib}/power6
+%dir /%{_lib}/power6x
%ifarch %{rtkaioarches}
%dir /%{_lib}/rtkaio/power6
+%dir /%{_lib}/rtkaio/power6x
%endif
%endif
%ifarch s390x
@@ -1533,6 +1617,56 @@
%endif
%changelog
+* Tue Dec 19 2006 Jakub Jelinek <jakub at redhat.com> 2.5-8.fc6
+- fix setcontext on ppc32 (#219107)
+- fix wide stdio after setvbuf (#217064, BZ#2337)
+- fix {j,m}rand48{,_r} on 64-bit arches (BZ#3747)
+- handle power6x AT_PLATFORM (#216970)
+- fix a race condition in getXXbyYY_r (#219145)
+- fix tst-pselect testcase
+
+* Tue Dec 12 2006 Jakub Jelinek <jakub at redhat.com> 2.5-7
+- fix hasmntopt (#218802)
+- fix setusershell and getusershell (#218782)
+- strtod fixes (BZ#3664, BZ#3673, BZ#3674)
+- fix ttyname and ttyname_r with invalid file descriptor (#218276)
+- fix nis_getnames if the default domain doesn't contain at least
+ two dots (#206483)
+- fix memusage with realloc (x, 0)
+
+* Wed Nov 29 2006 Jakub Jelinek <jakub at redhat.com> 2.5-6
+- fix svc_run (#216834, BZ#3559)
+- make sure there is consistent timestamp for /etc/ld.so.conf,
+ /etc/localtime and /etc/rpc between multilib glibc rpms
+- fix :include: /etc/alias handling (#215572)
+- update powerpc-cpu add-on to version 0.4 (#196319)
+- add power6x subdir to /%{_lib}/ and /%{_lib}/rtkaio/,
+ link all libs from ../power6/* into them
+- update nl, sv, pl and tr translations
+- add mai_IN locale (#213415)
+- fix es_ES LC_TIME (BZ#3320)
+
+* Tue Nov 14 2006 Jakub Jelinek <jakub at redhat.com> 2.5-5
+- remove bogus %{_libdir}/librt.so.1 symlink (#213555)
+- fix memusage (#213656)
+- fix sysconf (_SC_LEVEL{2,3}_CACHE_SIZE) on Intel Core Duo
+ CPUs
+- fix ld.so locking on dlopen failures (#213037, BZ#3429)
+- fix libthread_db.so on TLS_DTV_AT_TP architectures (#215513)
+- fix --inhibit-rpath (#214569)
+- fix _r_debug content when prelinked ld.so executes
+ a program as its argument
+- handle new tzdata format to cope with year > 2037 transitions
+ on 64-bit architectures
+- fix strxfrm
+- fix i?86 floor and ceil inlines (BZ#3451)
+
+* Thu Oct 19 2006 Jakub Jelinek <jakub at redhat.com> 2.5-4
+- fix i?86 6 argument syscalls (e.g. splice)
+- fix rtld minimal realloc (BZ#3352)
+- fix RFC3484 getaddrinfo sorting according to rules 4 and 7 (BZ#3369)
+- fix xdrmem_setpos (#211452)
+
* Sun Oct 8 2006 Jakub Jelinek <jakub at redhat.com> 2.5-3
- bump __GLIBC_MINOR__
- increase PTHREAD_STACK_MIN on ppc{,64} to 128K to allow
More information about the fedora-cvs-commits
mailing list