Skip to content

Commit

Permalink
Merge branch 'release/2.11/master' into fedora/2.11/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Schwab committed Nov 30, 2009
2 parents eab7090 + 20af204 commit 488fb43
Show file tree
Hide file tree
Showing 51 changed files with 634 additions and 164 deletions.
142 changes: 136 additions & 6 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,132 @@
2009-11-24 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/grantpt.c (grantpt): Use CLOSE_ALL_FDS is available
before the exec.
* sysdeps/unix/sysv/linux/grantpt.c: New file.
* login/programs/pt_chown.c (main): Don't print message on errors
when doing real work.

* csu/elf-init.c (__libc_csu_irel): New function. Code to perform
irel relocations split out from...
(__libc_csu_init): ...here.
* csu/libc-start.c [!SHARED]: Call __libc_csu_irel early.

2009-11-18 H.J. Lu <hongjiu.lu@intel.com>

[BZ #10162]
* sysdeps/ia64/memchr.S: Don't use a simple loop on data shorter
than software pipeline. Properly recover from shorter read.

2009-11-16 Jakub Jelinek <jakub@redhat.com>

* sysdeps/unix/sysv/linux/sync_file_range.c (sync_file_range):
Implement using sync_file_range2 syscall if __NR_sync_file_range2
is defined.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c: New
file.

2009-11-19 Ulrich Drepper <drepper@redhat.com>

[BZ #10958]
* libio/libio.h (_IO_getwc_unlocked): Check for _wide_data being
initialized before using it.
(_IO_putwc_unlocked): Likewise.

[BZ #10918]
* sysdeps/unix/sysv/linux/bits/sched.h (__CPU_ISSET_S): Use __const
in cast to not throw away const-ness of parameters.
(__CPU_EQUAL_S): Likewise.
(__CPU_OP_S): Likewise.

2009-11-17 Paolo Bonzini <bonzini@gnu.org>

* posix/bug-regex30.c: New file.
* posix/Makefile: Add rules to build and run bug-regex30.
* posix/regcomp.c (re_compile_fastmap_iter): Add all multibyte
character lead bytes when there is a range in a COMPLEX_BRACKET.
Reported by Oleg Bylatov.

2009-11-17 Ulrich Drepper <drepper@redhat.com>

[BZ #10969]
* locale/duplocale.c (__duplocale): Handle LC_GLOBAL_LOCALE special.
* locale/tst-duplocale.c: New file.
* locale/Makefile (tests): Add tst-duplocale.

[BZ #10968]
* locale/langinfo.h (_NL_LOCALE_NAME): Correct definition.
Patch by Bruno Haible <bruno@clisp.org>.
* locale/tst-locname.c: New file.
* locale/Makefile (tests): Add tst-locname.

[BZ #10972]
* sysdeps/unix/sysv/linux/powerpc/bits/mman.h: Add new MADV_*
constants from recent kernels.
* sysdeps/unix/sysv/linux/i386/bits/mman.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/bits/mman.h: Likewise.
* sysdeps/unix/sysv/linux/s390/bits/mman.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/mman.h: Likewise.
* sysdeps/unix/sysv/linux/sh/bits/mman.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/bits/mman.h: Likewise.

2009-11-09 Mike Frysinger <vapier@gentoo.org>

* sysdeps/unix/sysv/linux/i386/fallocate.c: Include errno.h.
(fallocate): Return ENOSYS if __NR_fallocate is not defined.
* sysdeps/unix/sysv/linux/i386/fallocate64.c: Likewise.

2009-11-06 Mike Frysinger <vapier@gentoo.org>

* posix/bug-regex29.c: Include stdio.h.

2009-11-14 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Update F_SETOWN_EX and
F_GETOWN_EX definitions according to corrected kernel definitions.
* sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
* sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise.
* sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise.

2009-11-10 Andreas Schwab <schwab@redhat.com>

* resolv/mapv4v6hostent.h (map_v4v6_hostent): Return non-zero if
out of buffer space.
* resolv/nss_dns/dns-host.c (getanswer_r): Check for
map_v4v6_hostent running out of space.

2009-11-10 Ulrich Drepper <drepper@redhat.com>

* string/bits/string3.h (memset): If the second parameter is constant
and zero there is likely no transposition.
Patch by Caolan McNamara <caolanm@redhat.com.

2009-11-04 Philippe De Muyter <phdm@macqel.be>

* sysdeps/powerpc/fpu/e_sqrt.c: Fix spelling of (Newton-)Raphson.
* sysdeps/powerpc/fpu/e_sqrtf.c: Likewise.

2009-10-30 Holger Hans Peter Freyther <zecke@selfish.org>

* malloc/memusagestat.c (main): Fix spelling in an error message.

2009-11-01 H.J. Lu <hongjiu.lu@intel.com>

* elf/dl-sym.c (do_sym): Properly handle STT_GNU_IFUNC symbols.
* elf/ifuncmain3.c (main): Test dlopen STT_GNU_IFUNC symbol.

2009-11-03 Andreas Schwab <schwab@redhat.com>

* sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list: Add
readahead.

2009-11-03 Jakub Jelinek <jakub@redhat.com>

* sysdeps/powerpc/powerpc64/dl-machine.h (resolve_ifunc): Don't
relocate opd entry when resolving prelink conflicts.

2009-11-04 Jakub Jelinek <jakub@redhat.com>

* misc/sys/uio.h (preadv, pwritev): Fix type of last argument
Expand All @@ -12,15 +141,16 @@
* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h (fallocate): Likewise.
* sysdeps/unix/sysv/linux/sh/bits/fcntl.h (fallocate): Likewise.

2009-11-03 Jakub Jelinek <jakub@redhat.com>
2009-11-03 Andreas Schwab <schwab@linux-m68k.org>

* sysdeps/powerpc/powerpc64/dl-machine.h (resolve_ifunc): Don't
relocate opd entry when resolving prelink conflicts.
[BZ #4457]
* sysdeps/generic/libgcc_s.h: New file.
* sysdeps/generic/framestate.c: Include it and use LIBGCC_S_SO.

2009-11-03 Andreas Schwab <schwab@redhat.com>
2009-11-01 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list: Add
readahead.
* malloc/hooks.c (free_check): Restore locking and call _int_free
appropriately.

2009-10-30 Ulrich Drepper <drepper@redhat.com>

Expand Down
21 changes: 15 additions & 6 deletions csu/elf-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,14 @@ extern void _fini (void);
/* These functions are passed to __libc_start_main by the startup code.
These get statically linked into each program. For dynamically linked
programs, this module will come from libc_nonshared.a and differs from
the libc.a module in that it doesn't call the preinit array. */
the libc.a module in that it doesn't call the preinit array and performs
explicit IREL{,A} relocations. */

void
__libc_csu_init (int argc, char **argv, char **envp)
{
/* For dynamically linked executables the preinit array is executed by
the dynamic linker (before initializing any shared object. */

#ifndef LIBC_NONSHARED
void
__libc_csu_irel (void)
{
# ifdef USE_MULTIARCH
# ifdef ELF_MACHINE_IRELA
{
Expand All @@ -115,7 +114,17 @@ __libc_csu_init (int argc, char **argv, char **envp)
}
# endif
# endif
}
#endif


void
__libc_csu_init (int argc, char **argv, char **envp)
{
/* For dynamically linked executables the preinit array is executed by
the dynamic linker (before initializing any shared object. */

#ifndef LIBC_NONSHARED
/* For static executables, preinit happens right before init. */
{
const size_t size = __preinit_array_end - __preinit_array_start;
Expand Down
6 changes: 6 additions & 0 deletions csu/libc-start.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#include <bp-sym.h>

extern void __libc_init_first (int argc, char **argv, char **envp);
#ifndef SHARED
extern void __libc_csu_irel (void);
#endif

extern int __libc_multiple_libcs;

Expand Down Expand Up @@ -134,6 +137,9 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
}
# endif

/* Performe IREL{,A} relocations. */
__libc_csu_irel ();

/* Initialize the thread library at least a bit since the libgcc
functions are using thread functions if these are available and
we need to setup errno. */
Expand Down
9 changes: 7 additions & 2 deletions elf/dl-sym.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,13 @@ RTLD_NEXT used in code not dynamically loaded"));

/* Resolve indirect function address. */
if (__builtin_expect (ELFW(ST_TYPE) (ref->st_info) == STT_GNU_IFUNC, 0))
value
= ((DL_FIXUP_VALUE_TYPE (*) (void)) DL_FIXUP_VALUE_ADDR (value)) ();
{
DL_FIXUP_VALUE_TYPE fixup
= DL_FIXUP_MAKE_VALUE (result, (ElfW(Addr)) value);
fixup =
((DL_FIXUP_VALUE_TYPE (*) (void)) DL_FIXUP_VALUE_ADDR (fixup)) ();
value = (void *) DL_FIXUP_VALUE_CODE_ADDR (fixup);
}

#ifdef SHARED
/* Auditing checkpoint: we have a new binding. Provide the
Expand Down
9 changes: 9 additions & 0 deletions elf/ifuncmain3.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ main (void)
return 1;
}

p = dlsym (h, "foo");
if (p == NULL)
{
printf ("symbol not found: %s\n", dlerror ());
return 1;
}
if ((*p) () != -1)
abort ();

f = dlsym (h, "get_foo_p");
if (f == NULL)
{
Expand Down
14 changes: 8 additions & 6 deletions libio/libio.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1991-1995,1997-2006,2007 Free Software Foundation, Inc.
/* Copyright (C) 1991-1995,1997-2006,2007,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Per Bothner <bothner@cygnus.com>.
Expand Down Expand Up @@ -442,13 +442,15 @@ extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t);

#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# define _IO_getwc_unlocked(_fp) \
(_IO_BE ((_fp)->_wide_data->_IO_read_ptr >= (_fp)->_wide_data->_IO_read_end,\
0) \
(_IO_BE ((_fp)->_wide_data == NULL \
|| ((_fp)->_wide_data->_IO_read_ptr \
>= (_fp)->_wide_data->_IO_read_end), 0) \
? __wuflow (_fp) : (_IO_wint_t) *(_fp)->_wide_data->_IO_read_ptr++)
# define _IO_putwc_unlocked(_wch, _fp) \
(_IO_BE ((_fp)->_wide_data->_IO_write_ptr \
>= (_fp)->_wide_data->_IO_write_end, 0) \
? __woverflow (_fp, _wch) \
(_IO_BE ((_fp)->_wide_data == NULL \
|| ((_fp)->_wide_data->_IO_write_ptr \
>= (_fp)->_wide_data->_IO_write_end), 0) \
? __woverflow (_fp, _wch) \
: (_IO_wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch)))
#endif

Expand Down
6 changes: 3 additions & 3 deletions locale/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 1991,1992,1995-2003,2005 Free Software Foundation, Inc.
# Copyright (C) 1991,1992,1995-2003,2005,2009 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
Expand Down Expand Up @@ -38,7 +38,7 @@ distribute = localeinfo.h categories.def iso-639.def iso-3166.def \
routines = setlocale findlocale loadlocale loadarchive \
localeconv nl_langinfo nl_langinfo_l mb_cur_max \
newlocale duplocale freelocale uselocale
tests = tst-C-locale
tests = tst-C-locale tst-locname tst-duplocale
categories = ctype messages monetary numeric time paper name \
address telephone measurement identification collate
aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
Expand Down Expand Up @@ -104,7 +104,7 @@ CFLAGS-charmap-dir.c = -Wno-write-strings

# This makes sure -DNOT_IN_libc is passed for all these modules.
cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \
$(locale-modules) $(lib-modules))
$(locale-modules) $(lib-modules))
lib := nonlib
include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))

Expand Down
6 changes: 5 additions & 1 deletion locale/duplocale.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Duplicate handle for selection of locales.
Copyright (C) 1997,2000,2001,2002,2005,2008 Free Software Foundation, Inc.
Copyright (C) 1997,2000-2002,2005,2008,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
Expand Down Expand Up @@ -37,6 +37,10 @@ __duplocale (__locale_t dataset)
if (dataset == _nl_C_locobj_ptr)
return dataset;

/* Handle a special value. */
if (dataset == LC_GLOBAL_LOCALE)
dataset = &_nl_global_locale;

__locale_t result;
int cnt;
size_t names_len = 0;
Expand Down
3 changes: 2 additions & 1 deletion locale/langinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,8 @@ enum

/* This macro produces an item you can pass to `nl_langinfo' or
`nl_langinfo_l' to get the name of the locale in use for CATEGORY. */
#define _NL_LOCALE_NAME(category) _NL_ITEM ((category), -1)
#define _NL_LOCALE_NAME(category) _NL_ITEM ((category), \
_NL_ITEM_INDEX (-1))
#ifdef __USE_GNU
# define NL_LOCALE_NAME(category) _NL_LOCALE_NAME (category)
#endif
Expand Down
14 changes: 14 additions & 0 deletions locale/tst-duplocale.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <locale.h>
#include <stdio.h>

static int
do_test (void)
{
locale_t d = duplocale (LC_GLOBAL_LOCALE);
if (d != (locale_t) 0)
freelocale (d);
return 0;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
20 changes: 20 additions & 0 deletions locale/tst-locname.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <langinfo.h>
#include <locale.h>
#include <stdio.h>
#include <string.h>

static int
do_test (void)
{
const char *s = nl_langinfo (_NL_LOCALE_NAME (LC_CTYPE));
if (s == NULL || strcmp (s, "C") != 0)
{
printf ("incorrect locale name returned: %s, expected \"C\"\n", s);
return 1;
}

return 0;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
5 changes: 2 additions & 3 deletions login/programs/pt_chown.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ main (int argc, char *argv[])
# define ncap_list (sizeof (cap_list) / sizeof (cap_list[0]))
cap_t caps = cap_init ();
if (caps == NULL)
error (FAIL_ENOMEM, errno,
_("Failed to initialize drop of capabilities"));
return FAIL_ENOMEM;

/* There is no reason why these should not work. */
cap_set_flag (caps, CAP_PERMITTED, ncap_list, cap_list, CAP_SET);
Expand All @@ -166,7 +165,7 @@ main (int argc, char *argv[])
cap_free (caps);

if (__builtin_expect (res != 0, 0))
error (FAIL_EXEC, errno, _("cap_set_proc failed"));
return FAIL_EXEC;
}
#endif

Expand Down
Loading

0 comments on commit 488fb43

Please sign in to comment.