+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]
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
$(common-objpfx)malloc/mtrace $(objpfx)tst-leaks1.mtrace > $@
tst-leaks1-ENV = MALLOC_TRACE=$(objpfx)tst-leaks1.mtrace
+
+$(objpfx)tst-addr1: $(libdl)
{
/* 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
#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;
--- /dev/null
+#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"
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
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 ..
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 ..
/* 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)
+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]
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>";/
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>";/
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>"
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
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
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
unsigned long sum; /* for updating stats */
size_t pagemask = mp_.pagesize - 1;
+ bool tried_mmap = false;
#if HAVE_MMAP
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)) {
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;
int
main (void)
{
- void *p;
+ void *p, *q;
int save;
errno = 0;
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;
}
+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]
}
+/* 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
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);
}
.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
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
-/* 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.
__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. */
-/* 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.
return &__libc_multiple_threads;
#endif
}
+
+
+libc_freeres_fn (freeres_libptread)
+{
+ if (__libc_pthread_functions.ptr_freeres != NULL)
+ __libc_pthread_functions.ptr_freeres ();
+}
}
-#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),
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.
/* 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
/* 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))
/* 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
/* 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); \
/* 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
return false;
}
}
- else if (sym->st_size == 0)
+ else if (sym->st_shndx == SHN_UNDEF || sym->st_size == 0)
{
if (addr != value)
return false;