Skip to content

Commit

Permalink
Merge commit 'origin/master' into fedora/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland McGrath committed May 4, 2010
2 parents 2e76ab2 + c4ccff1 commit bb6d7d2
Show file tree
Hide file tree
Showing 25 changed files with 241 additions and 107 deletions.
72 changes: 71 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,73 @@
2010-05-03 Ulrich Drepper <drepper@redhat.com>

* version.h (VERSION): Bump for 2.12 release.
* include/features.h (__GLIBC_MINOR__): Bump to 12.

[BZ #11149]
* elf/ldconfig.c (search_dir): Fix handling of symlinks in chroot.

* elf/chroot_canon.c (chroot_canon): Use xmalloc and xrealloc.

* elf/ldconfig.c (parse_conf_include): Don't fall back to
directories named in config file outside the chroot.

2010-02-02 Andreas Schwab <schwab@redhat.com>

* sysdeps/generic/ldsodefs.h (struct rtld_global): Add
_dl_load_write_lock.
* elf/rtld.c (_rtld_global): Initialize it.
* elf/dl-support.c (_dl_load_write_lock): Define .
* elf/dl-close.c (_dl_close_worker): Lock GL(dl_load_write_lock)
when modifying the list of loaded objects.
* elf/dl-load.c (lose): Likewise.
* elf/dl-object.c (_dl_new_object): Likewise.
* elf/dl-iteratephdr.c (__dl_iterate_phdr): Lock
GL(dl_load_write_lock) instead of GL(dl_load_lock).

2010-05-03 Ulrich Drepper <drepper@redhat.com>

* elf/dl-iteratephdr.c (__dl_iterate_phdr): Remove unnecessary
assignment.

2010-05-02 Ulrich Drepper <drepper@redhat.com>

* misc/mntent_r.c (encode_name): The slow loop handles newlines so we
should recognize them as an abort condition.
Patch by Jan Lieskovsky <jlieskov@redhat.com>.

2010-04-25 Bruno Haible <bruno@clisp.org>

[BZ #11538]
* sysdeps/unix/bsd/ptsname.c (__ptsname_r): Use __ttyname_r's return
value instead of errno.
* sysdeps/unix/getlogin.c (getlogin): Likewise.

[BZ #11537]
* sysdeps/mach/hurd/ttyname_r.c (__ttyname_r): Upon failure, return
errno, not -1.

2010-04-24 Emilio Pozuelo Monfort <pochu27@gmail.com>

* hurd/lookup-at.c (__file_name_lookup_at): Fix error return value.

2010-04-22 Ulrich Drepper <drepper@redhat.com>

* po/vi.po: Update from translation team.

2010-04-21 Ulrich Drepper <drepper@redhat.com>

* po/bg.po: Update from translation team.

2010-04-19 Roland McGrath <roland@redhat.com>

* elf/Makefile ($(objpfx)noload): Depend on libdl.so.

* Makeconfig (as-needed, no-as-needed): New variables.
(link-libc): Add ld.so inside --as-needed.

* stdio-common/tst-fmemopen.c (TEST_FILE): Macro removed.
(main): Take arguments. Construct test file name from ARGV[0].

2010-04-15 H.J. Lu <hongjiu.lu@intel.com>

* string/test-strncmp.c (check_result): New function.
Expand Down Expand Up @@ -1643,7 +1713,7 @@
argv argument as non-NULL.
(execle, execl, execlp): Mark the first ARG argument as non-NULL.

-2009-12-08 Ulrich Drepper <drepper@redhat.com>
2009-12-08 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/bits/socket.h: Define mmsghdr and declare
recvmmsg.
Expand Down
11 changes: 10 additions & 1 deletion Makeconfig
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,14 @@ ifeq ($(elf),yes)
have-initfini = yes
endif

ifeq ($(have-as-needed),yes)
as-needed := -Wl,--as-needed
no-as-needed := -Wl,--no-as-needed
else
as-needed :=
no-as-needed :=
endif

# Installed name of the startup code.
ifneq ($(have-initfini),yes)
# When not having init/fini, there is just one startfile, called crt0.o.
Expand Down Expand Up @@ -484,7 +492,8 @@ ifeq ($(elf),yes)
# run the linked programs.
link-libc = -Wl,-rpath-link=$(rpath-link) \
$(common-objpfx)libc.so$(libc.so-version) \
$(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
$(common-objpfx)$(patsubst %,$(libtype.oS),c) \
$(as-needed) $(common-objpfx)elf/ld.so $(no-as-needed) $(gnulib)
# This is how to find at build-time things that will be installed there.
rpath-dirs = math elf dlfcn nss nis rt resolv crypt
endif
Expand Down
4 changes: 2 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GNU C Library NEWS -- history of user-visible changes. 2010-4-9
GNU C Library NEWS -- history of user-visible changes. 2010-5-4
Copyright (C) 1992-2009, 2010 Free Software Foundation, Inc.
See the end for copying conditions.

Expand All @@ -16,7 +16,7 @@ Version 2.12
11185, 11186, 11187, 11188, 11189, 11190, 11191, 11192, 11193, 11194,
11200, 11230, 11235, 11242, 11254, 11258, 11271, 11272, 11276, 11279,
11287, 11292, 11319, 11332, 11333, 11387, 11389, 11390, 11394, 11397,
11410, 11438, 11449, 11470, 11471
11410, 11438, 11449, 11470, 11471, 11520, 11537, 11538

* New interfaces: pthread_getname_np, pthread_setname_np

Expand Down
4 changes: 2 additions & 2 deletions elf/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 1995-2007, 2008, 2009 Free Software Foundation, Inc.
# Copyright (C) 1995-2007,2008,2009,2010 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 @@ -654,7 +654,7 @@ $(objpfx)vismain: $(addprefix $(objpfx),vismod1.so vismod2.so)
$(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so)
vismain-ENV = LD_PRELOAD=$(addprefix $(objpfx),vismod3.so)

$(objpfx)noload: $(objpfx)testobj1.so
$(objpfx)noload: $(objpfx)testobj1.so $(common-objpfx)dlfcn/libdl.so
LDFLAGS-noload = -rdynamic
$(objpfx)noload.out: $(objpfx)testobj5.so

Expand Down
10 changes: 3 additions & 7 deletions elf/chroot_canon.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Return the canonical absolute name of a given file inside chroot.
Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2005
Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2005,2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Expand Down Expand Up @@ -58,9 +58,7 @@ chroot_canon (const char *chroot, const char *name)
return NULL;
}

rpath = malloc (chroot_len + PATH_MAX);
if (rpath == NULL)
return NULL;
rpath = xmalloc (chroot_len + PATH_MAX);

rpath_limit = rpath + chroot_len + PATH_MAX;

Expand Down Expand Up @@ -109,9 +107,7 @@ chroot_canon (const char *chroot, const char *name)
new_size += end - start + 1;
else
new_size += PATH_MAX;
new_rpath = (char *) realloc (rpath, new_size);
if (new_rpath == NULL)
goto error;
new_rpath = (char *) xrealloc (rpath, new_size);
rpath = new_rpath;
rpath_limit = rpath + new_size;

Expand Down
5 changes: 5 additions & 0 deletions elf/dl-close.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,9 @@ _dl_close_worker (struct link_map *map)
size_t tls_free_end;
tls_free_start = tls_free_end = NO_TLS_OFFSET;

/* We modify the list of loaded objects. */
__rtld_lock_lock_recursive (GL(dl_load_write_lock));

/* Check each element of the search list to see if all references to
it are gone. */
for (unsigned int i = first_loaded; i < nloaded; ++i)
Expand Down Expand Up @@ -665,6 +668,8 @@ _dl_close_worker (struct link_map *map)
}
}

__rtld_lock_unlock_recursive (GL(dl_load_write_lock));

/* If we removed any object which uses TLS bump the generation counter. */
if (any_tls)
{
Expand Down
11 changes: 5 additions & 6 deletions elf/dl-iteratephdr.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Get loaded objects program headers.
Copyright (C) 2001-2004, 2006-2008, 2009 Free Software Foundation, Inc.
Copyright (C) 2001-2004, 2006-2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2001.
Expand All @@ -26,7 +26,7 @@
static void
cancel_handler (void *arg __attribute__((unused)))
{
__rtld_lock_unlock_recursive (GL(dl_load_lock));
__rtld_lock_unlock_recursive (GL(dl_load_write_lock));
}

hidden_proto (__dl_iterate_phdr)
Expand All @@ -38,8 +38,8 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
struct dl_phdr_info info;
int ret = 0;

/* Make sure we are alone. */
__rtld_lock_lock_recursive (GL(dl_load_lock));
/* Make sure nobody modifies the list of loaded objects. */
__rtld_lock_lock_recursive (GL(dl_load_write_lock));
__libc_cleanup_push (cancel_handler, 0);

/* We have to determine the namespace of the caller since this determines
Expand Down Expand Up @@ -68,7 +68,6 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
info.dlpi_phnum = l->l_phnum;
info.dlpi_adds = GL(dl_load_adds);
info.dlpi_subs = GL(dl_load_adds) - nloaded;
info.dlpi_tls_modid = 0;
info.dlpi_tls_data = NULL;
info.dlpi_tls_modid = l->l_tls_modid;
if (info.dlpi_tls_modid != 0)
Expand All @@ -80,7 +79,7 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,

/* Release the lock. */
__libc_cleanup_pop (0);
__rtld_lock_unlock_recursive (GL(dl_load_lock));
__rtld_lock_unlock_recursive (GL(dl_load_write_lock));

return ret;
}
Expand Down
3 changes: 3 additions & 0 deletions elf/dl-load.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,8 @@ lose (int code, int fd, const char *name, char *realname, struct link_map *l,
(void) __close (fd);
if (l != NULL)
{
/* We modify the list of loaded objects. */
__rtld_lock_lock_recursive (GL(dl_load_write_lock));
/* Remove the stillborn object from the list and free it. */
assert (l->l_next == NULL);
if (l->l_prev == NULL)
Expand All @@ -813,6 +815,7 @@ lose (int code, int fd, const char *name, char *realname, struct link_map *l,
l->l_prev->l_next = NULL;
--GL(dl_ns)[l->l_ns]._ns_nloaded;
free (l);
__rtld_lock_unlock_recursive (GL(dl_load_write_lock));
}
free (realname);

Expand Down
5 changes: 5 additions & 0 deletions elf/dl-object.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ _dl_new_object (char *realname, const char *libname, int type,
new->l_scope = new->l_scope_mem;
new->l_scope_max = sizeof (new->l_scope_mem) / sizeof (new->l_scope_mem[0]);

/* We modify the list of loaded objects. */
__rtld_lock_lock_recursive (GL(dl_load_write_lock));

/* Counter for the scopes we have to handle. */
idx = 0;

Expand All @@ -114,6 +117,8 @@ _dl_new_object (char *realname, const char *libname, int type,
new->l_serial = GL(dl_load_adds);
++GL(dl_load_adds);

__rtld_lock_unlock_recursive (GL(dl_load_write_lock));

/* If we have no loader the new object acts as it. */
if (loader == NULL)
loader = new;
Expand Down
4 changes: 4 additions & 0 deletions elf/dl-support.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ const ElfW(Ehdr) *_dl_sysinfo_dso;
the loaded object might as well require a call to this function.
At this time it is not anymore a problem to modify the tables. */
__rtld_lock_define_initialized_recursive (, _dl_load_lock)
/* This lock is used to keep __dl_iterate_phdr from inspecting the
list of loaded objects while an object is added to or removed from
that list. */
__rtld_lock_define_initialized_recursive (, _dl_load_write_lock)


#ifdef HAVE_AUX_VECTOR
Expand Down
17 changes: 15 additions & 2 deletions elf/ldconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,18 @@ search_dir (const struct dir_entry *entry)
{
/* In case of symlink, we check if the symlink refers to
a directory. */
if (__builtin_expect (stat64 (real_file_name, &stat_buf), 0))
char *target_name = real_file_name;
if (opt_chroot)
{
target_name = chroot_canon (opt_chroot, file_name);
if (target_name == NULL)
{
if (strstr (file_name, ".so") == NULL)
error (0, 0, _("Input file %s not found.\n"), file_name);
continue;
}
}
if (__builtin_expect (stat64 (target_name, &stat_buf), 0))
{
if (opt_verbose)
error (0, errno, _("Cannot stat %s"), file_name);
Expand Down Expand Up @@ -1183,7 +1194,9 @@ parse_conf_include (const char *config_file, unsigned int lineno,
if (do_chroot && opt_chroot)
{
char *canon = chroot_canon (opt_chroot, pattern);
result = glob64 (canon ?: pattern, 0, NULL, &gl);
if (canon == NULL)
return;
result = glob64 (canon, 0, NULL, &gl);
free (canon);
}
else
Expand Down
1 change: 1 addition & 0 deletions elf/rtld.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ struct rtld_global _rtld_global =
._dl_stack_flags = PF_R|PF_W|PF_X,
#ifdef _LIBC_REENTRANT
._dl_load_lock = _RTLD_LOCK_RECURSIVE_INITIALIZER,
._dl_load_write_lock = _RTLD_LOCK_RECURSIVE_INITIALIZER,
#endif
._dl_nns = 1,
._dl_ns =
Expand Down
4 changes: 2 additions & 2 deletions hurd/lookup-at.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Lookup helper function for Hurd implementation of *at functions.
Copyright (C) 2006 Free Software Foundation, Inc.
Copyright (C) 2006,2010 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 @@ -33,7 +33,7 @@ __file_name_lookup_at (int fd, int at_flags,
flags |= (at_flags & AT_SYMLINK_NOFOLLOW) ? O_NOLINK : 0;
at_flags &= ~AT_SYMLINK_NOFOLLOW;
if (at_flags != 0)
return __hurd_fail (EINVAL);
return (__hurd_fail (EINVAL), MACH_PORT_NULL);

if (fd == AT_FDCWD || file_name[0] == '/')
return __file_name_lookup (file_name, flags, mode);
Expand Down
2 changes: 1 addition & 1 deletion include/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
/* Major and minor version number of the GNU C library package. Use
these macros to test for features in specific releases. */
#define __GLIBC__ 2
#define __GLIBC_MINOR__ 11
#define __GLIBC_MINOR__ 12

#define __GLIBC_PREREQ(maj, min) \
((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
Expand Down
5 changes: 5 additions & 0 deletions localedata/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2010-05-03 Ulrich Drepper <drepper@redhat.com>

[BZ #11520]
* locales/de_CH: Define week, first_weekday, and first_workday.

2010-04-08 Ulrich Drepper <drepper@redhat.com>

* locales/ar_AE: Fix typo.
Expand Down
Loading

0 comments on commit bb6d7d2

Please sign in to comment.