summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-08-25 06:45:16 +0000
committerJakub Jelinek <jakub@redhat.com>2006-08-25 06:45:16 +0000
commit44731509844946ccd2c2ee1de87901c171dadcc5 (patch)
tree83e065c21bd400661e9a594289ec3114cd10d051
parent4728cb644861ff8c58586702bf6815c50a1c0dd2 (diff)
Updated to fedora-glibc-20060825T0639
-rw-r--r--ChangeLog36
-rw-r--r--elf/Makefile4
-rw-r--r--elf/dl-addr.c6
-rw-r--r--elf/tst-addr1.c19
-rw-r--r--fedora/branch.mk4
-rw-r--r--fedora/glibc.spec.in4
-rw-r--r--locale/programs/ld-ctype.c2
-rw-r--r--localedata/ChangeLog18
-rw-r--r--localedata/locales/bn_BD4
-rw-r--r--localedata/locales/en_NZ5
-rw-r--r--localedata/locales/et_EE26
-rw-r--r--localedata/locales/nn_NO32
-rw-r--r--malloc/malloc.c4
-rw-r--r--malloc/tst-malloc.c12
-rw-r--r--nptl/ChangeLog12
-rw-r--r--nptl/allocatestack.c78
-rw-r--r--nptl/init.c4
-rw-r--r--nptl/pthreadP.h2
-rw-r--r--nptl/sysdeps/pthread/pthread-functions.h3
-rw-r--r--nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c9
-rw-r--r--posix/bits/unistd.h2
-rw-r--r--posix/unistd.h2
-rw-r--r--sysdeps/generic/ldsodefs.h6
-rw-r--r--sysdeps/i386/bits/byteswap.h5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h4
25 files changed, 212 insertions, 91 deletions
diff --git a/ChangeLog b/ChangeLog
index 2adc7bb44f..b95ea69c5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+2006-08-24 Ulrich Drepper <drepper@redhat.com>
+
+ * locale/programs/ld-ctype.c (ctype_read): If CTYPE is NULL, don't
+ do anything.
+
+ * sysdeps/generic/ldsodefs.h (DL_ADDR_SYM_MATCH): For undefined
+ symbol require exact match (these are PLTs).
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h
+ (_dl_ppc64_addr_sym_match): Likewise.
+
+ [BZ #2683]
+ * elf/dl-addr.c (_dl_addr): Don't ignore all undefined symbols.
+ If symbol has a value use it.
+ * elf/tst-dladdr1.c: New file.
+ * elf/Makefile: Add rules to build and run tst-addr1.
+
+2006-08-24 Jakub Jelinek <jakub@redhat.com>
+
+ * malloc/malloc.c (sYSMALLOc): Avoid infinite loop if MMAP
+ keeps failing and heap growth or new heap creation isn't
+ successful either.
+ * malloc/tst-malloc.c (main): Add new tests.
+
+2006-08-24 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #2734]
+ * sysdeps/i386/bits/byteswap.h (__bswap_32): Use same conditions
+ as in the x86-64 code to use bswap.
+
+2006-05-21 Joseph S. Myers <joseph@codesourcery.com>
+
+ [BZ #2680]
+ * posix/unistd.h (getlogin_r): Condition on __USE_POSIX199506, not
+ __USE_UNIX98.
+ * posix/bits/unistd.h: Likewise.
+
2006-05-15 Mike Frysinger <vapier@gentoo.org>
[BZ #2751]
diff --git a/elf/Makefile b/elf/Makefile
index 402fc18636..6f4b0260c0 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -170,7 +170,7 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
unload3 unload4 unload5 unload6 tst-global1 order2 \
tst-audit1 tst-audit2 \
- tst-stackguard1
+ tst-stackguard1 tst-addr1
# reldep9
test-srcs = tst-pathopt
tests-vis-yes = vismain
@@ -906,3 +906,5 @@ $(objpfx)tst-leaks1-mem: $(objpfx)tst-leaks1.out
$(common-objpfx)malloc/mtrace $(objpfx)tst-leaks1.mtrace > $@
tst-leaks1-ENV = MALLOC_TRACE=$(objpfx)tst-leaks1.mtrace
+
+$(objpfx)tst-addr1: $(libdl)
diff --git a/elf/dl-addr.c b/elf/dl-addr.c
index 5d3719adb2..720b24d04b 100644
--- a/elf/dl-addr.c
+++ b/elf/dl-addr.c
@@ -91,7 +91,8 @@ _dl_addr (const void *address, Dl_info *info,
{
/* The hash table never references local symbols
so we can omit that test here. */
- if (symtab[symndx].st_shndx != SHN_UNDEF
+ if ((symtab[symndx].st_shndx != SHN_UNDEF
+ || symtab[symndx].st_value != 0)
#ifdef USE_TLS
&& ELFW(ST_TYPE) (symtab[symndx].st_info) != STT_TLS
#endif
@@ -125,7 +126,8 @@ _dl_addr (const void *address, Dl_info *info,
#ifdef USE_TLS
&& ELFW(ST_TYPE) (symtab->st_info) != STT_TLS
#endif
- && symtab->st_shndx != SHN_UNDEF
+ && (symtab->st_shndx != SHN_UNDEF
+ || symtab->st_value != 0)
&& DL_ADDR_SYM_MATCH (match, symtab, matchsym, addr)
&& symtab->st_name < strtabsize)
matchsym = (ElfW(Sym) *) symtab;
diff --git a/elf/tst-addr1.c b/elf/tst-addr1.c
new file mode 100644
index 0000000000..3a2cbb668f
--- /dev/null
+++ b/elf/tst-addr1.c
@@ -0,0 +1,19 @@
+#include <dlfcn.h>
+#include <stdio.h>
+#include <string.h>
+
+static int
+do_test (void)
+{
+ Dl_info i;
+ if (dladdr (&printf, &i) == 0)
+ {
+ puts ("not found");
+ return 1;
+ }
+ printf ("found symbol %s in %s\n", i.dli_sname, i.dli_fname);
+ return i.dli_sname == NULL || strcmp (i.dli_sname, "printf") != 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/fedora/branch.mk b/fedora/branch.mk
index 86bc40a3e5..fb723d026c 100644
--- a/fedora/branch.mk
+++ b/fedora/branch.mk
@@ -3,5 +3,5 @@ glibc-branch := fedora
glibc-base := HEAD
DIST_BRANCH := devel
COLLECTION := dist-fc4
-fedora-sync-date := 2006-08-22 07:06 UTC
-fedora-sync-tag := fedora-glibc-20060822T0706
+fedora-sync-date := 2006-08-25 06:39 UTC
+fedora-sync-tag := fedora-glibc-20060825T0639
diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in
index 251854997b..f265ce6a13 100644
--- a/fedora/glibc.spec.in
+++ b/fedora/glibc.spec.in
@@ -1142,7 +1142,7 @@ echo ====================TESTING=========================
cd build-%{nptl_target_cpu}-linuxnptl
( make %{?_smp_mflags} -k check PARALLELMFLAGS=-s 2>&1
sleep 10s
- teepid="`ps -eo ppid,pid,command | grep ^${parent}' [0-9]\+ tee' | cut -d' ' -f2`"
+ teepid="`ps -eo ppid,pid,command | grep ^${parent}'[ ]\+[0-9]\+[ ]\+tee' | cut -d' ' -f2`"
[ -n "$teepid" ] && kill $teepid
) | tee check.log || :
cd ..
@@ -1151,7 +1151,7 @@ echo ====================TESTING -mno-tls-direct-seg-refs=============
cd build-%{nptl_target_cpu}-linuxnptl-nosegneg
( make -j$numprocs -k check PARALLELMFLAGS=-s 2>&1
sleep 10s
- teepid="`ps -eo ppid,pid,command | grep ^${parent}' [0-9]\+ tee' | cut -d' ' -f2`"
+ teepid="`ps -eo ppid,pid,command | grep ^${parent}'[ ]\+[0-9]\+[ ]\+tee' | cut -d' ' -f2`"
[ -n "$teepid" ] && kill $teepid
) | tee check.log || :
cd ..
diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
index f38231f984..0ffda62e29 100644
--- a/locale/programs/ld-ctype.c
+++ b/locale/programs/ld-ctype.c
@@ -2256,6 +2256,8 @@ ctype_read (struct linereader *ldfile, struct localedef_t *result,
/* Prepare the data structures. */
ctype_startup (ldfile, result, charmap, copy_locale, ignore_content);
ctype = result->categories[LC_CTYPE].ctype;
+ if (ctype == NULL)
+ return;
/* Remember the repertoire we use. */
if (!ignore_content)
diff --git a/localedata/ChangeLog b/localedata/ChangeLog
index b7ec81b992..df44366657 100644
--- a/localedata/ChangeLog
+++ b/localedata/ChangeLog
@@ -1,3 +1,21 @@
+2006-08-24 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #2695]
+ * locales/et_EE: Update LC_ADDRESS category.
+ Patch by Priit Laes <amd@store20.com>.
+
+2006-08-23 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #2662]
+ * locales/bn_BD: Fix abday and day spelling of Tuesday.
+
+ [BZ #2473]
+ * locales/en_NZ: Define am/pm formats.
+
+2006-08-22 Ulrich Drepper <drepper@redhat.com>
+
+ * locales/nn_NO: Copy more categories from nb_NO.
+
2006-08-19 Ulrich Drepper <drepper@redhat.com>
[BZ #3034]
diff --git a/localedata/locales/bn_BD b/localedata/locales/bn_BD
index 196b42dbc3..23f821ad6e 100644
--- a/localedata/locales/bn_BD
+++ b/localedata/locales/bn_BD
@@ -73,7 +73,7 @@ END LC_NUMERIC
LC_TIME
abday "<U09B0><U09AC><U09BF>"; /
"<U09B8><U09CB><U09AE>";/
- "<U09AE><U0999><U0997><U09B2>";/
+ "<U09AE><U0999><U09CD><U0997><U09B2>";/
"<U09AC><U09C1><U09A7>";/
"<U09AC><U09C3><U09B9><U0983>";/
"<U09B6><U09C1><U0995><U09CD><U09B0>";/
@@ -81,7 +81,7 @@ abday "<U09B0><U09AC><U09BF>"; /
day "<U09B0><U09AC><U09BF><U09AC><U09BE><U09B0>";/
"<U09B8><U09CB><U09AE><U09AC><U09BE><U09B0>";/
- "<U09AE><U0999><U0997><U09B2><U09AC><U09BE><U09B0>";/
+ "<U09AE><U0999><U09CD><U0997><U09B2><U09AC><U09BE><U09B0>";/
"<U09AC><U09C1><U09A7><U09AC><U09BE><U09B0>";/
"<U09AC><U09C3><U09B9><U09B8><U09CD><U09AA><U09A4><U09BF><U09AC><U09BE><U09B0>";/
"<U09B6><U09C1><U0995><U09CD><U09B0><U09AC><U09BE><U09B0>";/
diff --git a/localedata/locales/en_NZ b/localedata/locales/en_NZ
index d3f7e636cf..82470f57c3 100644
--- a/localedata/locales/en_NZ
+++ b/localedata/locales/en_NZ
@@ -111,8 +111,9 @@ mon "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
d_fmt "<U0025><U0064><U002F><U0025><U006D><U002F><U0025><U0079>"
t_fmt "<U0025><U0054>"
-am_pm "";""
-t_fmt_ampm ""
+am_pm "<U0041><U004D>";"<U0050><U004D>"
+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
+<U0025><U0070>"
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>"
diff --git a/localedata/locales/et_EE b/localedata/locales/et_EE
index 3c70cdf624..e44e0c88c7 100644
--- a/localedata/locales/et_EE
+++ b/localedata/locales/et_EE
@@ -2228,12 +2228,22 @@ name_fmt "<U0025><U0064><U0025><U0074><U0025><U0067><U0025><U0074>/
END LC_NAME
LC_ADDRESS
-postal_fmt "<U0025><U0066><U0025><U004E><U0025><U0061><U0025><U004E>/
-<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-<U004E><U0025><U0025><U007A><U0020><U0025><U0054><U0025>/
-<U004E><U0025><U0063><U0025><U004E>"
-country_ab2 "<U0045><U0045>"
-country_ab3 "<U0045><U0053><U0054>"
-country_num 233
+postal_fmt "<U0025><U0061><U0025><U004E>/
+ <U0025><U0066><U0025><U004E>/
+ <U0025><U0064><U0025><U004E>/
+ <U0025><U0062><U0025><U004E>/
+ <U0025><U0073><U0025><U0074><U0025><U0068><U0025><U0074><U0025><U0065><U0025><U0074><U0025><U0072><U0025><U004E>/
+ <U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025><U004E>/
+ <U0025><U0063><U0025><U004E>"
+country_name "<U0045><U0065><U0073><U0074><U0069>"
+country_post "<U0045><U0045>"
+country_ab2 "<U0045><U0045>"
+country_ab3 "<U0045><U0053><U0054>"
+country_num 233
+country_car "<U0045><U0053><U0054>"
+country_isbn "<U0039><U0039><U0038><U0035>"
+lang_name "<U0065><U0065><U0073><U0074><U0069><U0020><U006B><U0065><U0065><U006C>"
+lang_ab "<U0065><U0074>"
+lang_term "<U0065><U0073><U0074>"
+lang_lib "<U0065><U0073><U0074>"
END LC_ADDRESS
diff --git a/localedata/locales/nn_NO b/localedata/locales/nn_NO
index 097fbbc18c..eb060edcce 100644
--- a/localedata/locales/nn_NO
+++ b/localedata/locales/nn_NO
@@ -65,12 +65,7 @@ END LC_MONETARY
LC_NUMERIC
-% This is the POSIX Locale definition for the LC_NUMERIC category.
-%
-decimal_point "<U002C>"
-thousands_sep "<U00A0>"
-grouping 3
-%
+copy "nb_NO"
END LC_NUMERIC
@@ -151,40 +146,25 @@ END LC_MESSAGES
LC_PAPER
-height 297
-width 210
+copy "nb_NO"
END LC_PAPER
LC_NAME
-name_fmt "<U0025><U0064><U0025><U0074><U0025><U0067><U0025><U0074>/
-<U0025><U006D><U0025><U0074><U0025><U0066>"
+copy "nb_NO"
END LC_NAME
LC_ADDRESS
-postal_fmt "<U0025><U0066><U0025><U004E><U0025><U0061><U0025><U004E>/
-<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-<U004E><U0025><U0025><U007A><U0020><U0025><U0054><U0025>/
-<U004E><U0025><U0063><U0025><U004E>"
-country_ab2 "<U004E><U004F>"
-country_ab3 "<U004E><U004F><U0052>"
-country_num 578
+copy "nb_NO"
END LC_ADDRESS
LC_TELEPHONE
-tel_int_fmt "<U002B><U0025><U0063><U0020><U0025><U006C>"
-tel_dom_fmt "<U0025><U006C>"
-int_select "<U0030><U0030>"
-int_prefix "<U0034><U0037>"
+copy "nb_NO"
END LC_TELEPHONE
LC_MEASUREMENT
-% This is the ISO_IEC TR14652 Locale definition for the
-%
-measurement 1
-
+copy "nb_NO"
END LC_MEASUREMENT
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 02f659708d..6de1409c4f 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -2860,6 +2860,7 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
unsigned long sum; /* for updating stats */
size_t pagemask = mp_.pagesize - 1;
+ bool tried_mmap = false;
#if HAVE_MMAP
@@ -2883,6 +2884,7 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
is no following chunk whose prev_size field could be used.
*/
size = (nb + SIZE_SZ + MALLOC_ALIGN_MASK + pagemask) & ~pagemask;
+ tried_mmap = true;
/* Don't try if size wraps around 0 */
if ((unsigned long)(size) > (unsigned long)(nb)) {
@@ -3006,7 +3008,7 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
set_foot(old_top, (old_size + 2*SIZE_SZ));
}
}
- else
+ else if (!tried_mmap)
/* We can at least try to use to mmap memory. */
goto try_mmap;
diff --git a/malloc/tst-malloc.c b/malloc/tst-malloc.c
index d555ae46ef..81d279236c 100644
--- a/malloc/tst-malloc.c
+++ b/malloc/tst-malloc.c
@@ -33,7 +33,7 @@ merror (const char *msg)
int
main (void)
{
- void *p;
+ void *p, *q;
int save;
errno = 0;
@@ -64,5 +64,15 @@ main (void)
if (p != NULL)
merror ("realloc (p, 0) failed.");
+ p = malloc (513 * 1024);
+ if (p == NULL)
+ merror ("malloc (513K) failed.");
+
+ q = malloc (-512 * 1024);
+ if (q != NULL)
+ merror ("malloc (-512K) succeeded.");
+
+ free (p);
+
return errors != 0;
}
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 2dee6abb00..07a1d2f7a7 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,15 @@
+2006-08-23 Ulrich Drepper <drepper@redhat.com>
+
+ * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
+ (free_stacks): ...here.
+ (__free_stack_cache): New function.
+ * pthreadP.h: Declare __free_stack_cache.
+ * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
+ ptr_freeres.
+ * init.c (pthread_functions): Initialize ptr_freeres.
+ * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
+ New freeres function.
+
2006-07-30 Joseph S. Myers <joseph@codesourcery.com>
[BZ #3018]
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 4a1cd18481..c05cd47dff 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -211,6 +211,45 @@ get_cached_stack (size_t *sizep, void **memp)
}
+/* Free stacks until cache size is lower than LIMIT. */
+static void
+free_stacks (size_t limit)
+{
+ /* We reduce the size of the cache. Remove the last entries until
+ the size is below the limit. */
+ list_t *entry;
+ list_t *prev;
+
+ /* Search from the end of the list. */
+ list_for_each_prev_safe (entry, prev, &stack_cache)
+ {
+ struct pthread *curr;
+
+ curr = list_entry (entry, struct pthread, list);
+ if (FREE_P (curr))
+ {
+ /* Unlink the block. */
+ list_del (entry);
+
+ /* Account for the freed memory. */
+ stack_cache_actsize -= curr->stackblock_size;
+
+ /* Free the memory associated with the ELF TLS. */
+ _dl_deallocate_tls (TLS_TPADJ (curr), false);
+
+ /* Remove this block. This should never fail. If it does
+ something is really wrong. */
+ if (munmap (curr->stackblock, curr->stackblock_size) != 0)
+ abort ();
+
+ /* Maybe we have freed enough. */
+ if (stack_cache_actsize <= limit)
+ break;
+ }
+ }
+}
+
+
/* Add a stack frame which is not used anymore to the stack. Must be
called with the cache lock held. */
static inline void
@@ -224,40 +263,15 @@ queue_stack (struct pthread *stack)
stack_cache_actsize += stack->stackblock_size;
if (__builtin_expect (stack_cache_actsize > stack_cache_maxsize, 0))
- {
- /* We reduce the size of the cache. Remove the last entries
- until the size is below the limit. */
- list_t *entry;
- list_t *prev;
-
- /* Search from the end of the list. */
- list_for_each_prev_safe (entry, prev, &stack_cache)
- {
- struct pthread *curr;
-
- curr = list_entry (entry, struct pthread, list);
- if (FREE_P (curr))
- {
- /* Unlink the block. */
- list_del (entry);
-
- /* Account for the freed memory. */
- stack_cache_actsize -= curr->stackblock_size;
-
- /* Free the memory associated with the ELF TLS. */
- _dl_deallocate_tls (TLS_TPADJ (curr), false);
+ free_stacks (stack_cache_maxsize);
+}
- /* Remove this block. This should never fail. If it
- does something is really wrong. */
- if (munmap (curr->stackblock, curr->stackblock_size) != 0)
- abort ();
- /* Maybe we have freed enough. */
- if (stack_cache_actsize <= stack_cache_maxsize)
- break;
- }
- }
- }
+/* This function is called indirectly from the freeres code in libc. */
+void
+__free_stack_cache (void)
+{
+ free_stacks (0);
}
diff --git a/nptl/init.c b/nptl/init.c
index 7cfe803c42..14441153b8 100644
--- a/nptl/init.c
+++ b/nptl/init.c
@@ -136,7 +136,9 @@ static const struct pthread_functions pthread_functions =
.ptr_nthreads = &__nptl_nthreads,
.ptr___pthread_unwind = &__pthread_unwind,
.ptr__nptl_deallocate_tsd = __nptl_deallocate_tsd,
- .ptr__nptl_setxid = __nptl_setxid
+ .ptr__nptl_setxid = __nptl_setxid,
+ /* For now only the stack cache needs to be freed. */
+ .ptr_freeres = __free_stack_cache
};
# define ptr_pthread_functions &pthread_functions
#else
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 503e99b2b4..f9634ab0ff 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -543,6 +543,8 @@ extern void __nptl_deallocate_tsd (void) attribute_hidden;
extern int __nptl_setxid (struct xid_command *cmdp) attribute_hidden;
+extern void __free_stack_cache (void) attribute_hidden;
+
#ifdef SHARED
# define PTHREAD_STATIC_FN_REQUIRE(name)
#else
diff --git a/nptl/sysdeps/pthread/pthread-functions.h b/nptl/sysdeps/pthread/pthread-functions.h
index d75bbbb11e..74d24005c3 100644
--- a/nptl/sysdeps/pthread/pthread-functions.h
+++ b/nptl/sysdeps/pthread/pthread-functions.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -95,6 +95,7 @@ struct pthread_functions
__attribute ((noreturn)) __cleanup_fct_attribute;
void (*ptr__nptl_deallocate_tsd) (void);
int (*ptr__nptl_setxid) (struct xid_command *);
+ void (*ptr_freeres) (void);
};
/* Variable in libc.so. */
diff --git a/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c b/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
index 4e60596f7d..4e0001af91 100644
--- a/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
+++ b/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -57,3 +57,10 @@ __libc_pthread_init (ptr, reclaim, functions)
return &__libc_multiple_threads;
#endif
}
+
+
+libc_freeres_fn (freeres_libptread)
+{
+ if (__libc_pthread_functions.ptr_freeres != NULL)
+ __libc_pthread_functions.ptr_freeres ();
+}
diff --git a/posix/bits/unistd.h b/posix/bits/unistd.h
index 96f26d5482..b08aef2f6c 100644
--- a/posix/bits/unistd.h
+++ b/posix/bits/unistd.h
@@ -198,7 +198,7 @@ __NTH (ttyname_r (int __fd, char *__buf, size_t __buflen))
}
-#if defined __USE_REENTRANT || defined __USE_UNIX98
+#if defined __USE_REENTRANT || defined __USE_POSIX199506
extern int __getlogin_r_chk (char *__buf, size_t __buflen, size_t __nreal)
__nonnull ((1));
extern int __REDIRECT (__getlogin_r_alias, (char *__buf, size_t __buflen),
diff --git a/posix/unistd.h b/posix/unistd.h
index c7a52722ca..b751928b1e 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -811,7 +811,7 @@ extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __THROW;
This function is a possible cancellation points and therefore not
marked with __THROW. */
extern char *getlogin (void);
-#if defined __USE_REENTRANT || defined __USE_UNIX98
+#if defined __USE_REENTRANT || defined __USE_POSIX199506
/* Return at most NAME_LEN characters of the login name of the user in NAME.
If it cannot be determined or some other error occurred, return the error
code. Otherwise return 0.
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index ef2b685393..b7d0f9b7e7 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -59,8 +59,8 @@ __BEGIN_DECLS
/* Result of the lookup functions and how to retrieve the base address. */
typedef struct link_map *lookup_t;
-# define LOOKUP_VALUE(map) map
-# define LOOKUP_VALUE_ADDRESS(map) ((map) ? (map)->l_addr : 0)
+#define LOOKUP_VALUE(map) map
+#define LOOKUP_VALUE_ADDRESS(map) ((map) ? (map)->l_addr : 0)
/* On some architectures a pointer to a function is not just a pointer
to the actual code of the function but rather an architecture
@@ -76,7 +76,7 @@ typedef struct link_map *lookup_t;
/* On some architectures dladdr can't use st_size of all symbols this way. */
#define DL_ADDR_SYM_MATCH(L, SYM, MATCHSYM, ADDR) \
((ADDR) >= (L)->l_addr + (SYM)->st_value \
- && (((SYM)->st_size == 0 \
+ && ((((SYM)->st_shndx == SHN_UNDEF || (SYM)->st_size == 0) \
&& (ADDR) == (L)->l_addr + (SYM)->st_value) \
|| (ADDR) < (L)->l_addr + (SYM)->st_value + (SYM)->st_size) \
&& ((MATCHSYM) == NULL || (MATCHSYM)->st_value < (SYM)->st_value))
diff --git a/sysdeps/i386/bits/byteswap.h b/sysdeps/i386/bits/byteswap.h
index 33af208888..bed27559c5 100644
--- a/sysdeps/i386/bits/byteswap.h
+++ b/sysdeps/i386/bits/byteswap.h
@@ -1,5 +1,5 @@
/* Macros to swap the order of bytes in integer values.
- Copyright (C) 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,2000,2002,2003,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
@@ -65,7 +65,8 @@ __bswap_16 (unsigned short int __bsx)
/* To swap the bytes in a word the i486 processors and up provide the
`bswap' opcode. On i386 we have to use three instructions. */
# if !defined __i486__ && !defined __pentium__ && !defined __pentiumpro__ \
- && !defined __pentium4__
+ && !defined __pentium4__ && !defined __k8__ && !defined __athlon__ \
+ && !defined __k6__
# define __bswap_32(x) \
(__extension__ \
({ register unsigned int __v, __x = (x); \
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h
index 1ead3dd63d..ac4a0d5aa9 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 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
@@ -47,7 +47,7 @@ _dl_ppc64_addr_sym_match (const struct link_map *l, const ElfW(Sym) *sym,
return false;
}
}
- else if (sym->st_size == 0)
+ else if (sym->st_shndx == SHN_UNDEF || sym->st_size == 0)
{
if (addr != value)
return false;