diff options
author | Andreas Schwab <schwab@redhat.com> | 2009-09-14 11:05:01 +0200 |
---|---|---|
committer | Andreas Schwab <schwab@redhat.com> | 2009-09-14 11:05:01 +0200 |
commit | a31519cef9edea573edeb58ddd85417380cc5712 (patch) | |
tree | bb7c3944c0e74a70c2da747bed34502a74c59d3a | |
parent | 85cf3748c6c1f8f7484a35aa17616390a621382a (diff) | |
parent | 02bf610ca82f4b5660dadcfff04124e73f8ef2ff (diff) |
Merge remote branch 'origin/master' into fedora/master
-rw-r--r-- | ChangeLog | 19 | ||||
-rwxr-xr-x | configure | 4 | ||||
-rw-r--r-- | configure.in | 4 | ||||
-rw-r--r-- | locale/programs/ld-collate.c | 59 | ||||
-rw-r--r-- | nptl/ChangeLog | 4 | ||||
-rw-r--r-- | nptl/sysdeps/pthread/bits/libc-lock.h | 2 | ||||
-rw-r--r-- | posix/getconf.c | 72 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c (renamed from sysdeps/s390/s390-32/____longjmp_chk.c) | 16 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c (renamed from sysdeps/s390/s390-64/____longjmp_chk.c) | 16 |
9 files changed, 127 insertions, 69 deletions
@@ -1,5 +1,24 @@ +2009-09-09 Ulrich Drepper <drepper@redhat.com> + + * posix/getconf.c (main): Handle -- on command line. + +2009-09-05 H.J. Lu <hongjiu.lu@intel.com> + + * configure.in: Support binutils 2.100 and 3.0. + +2009-09-08 Jakub Jelinek <jakub@redhat.com> + + * sysdeps/s390/s390-32/____longjmp_chk.c: Removed. + * sysdeps/s390/s390-64/____longjmp_chk.c: Removed. + * sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c: New file. + * sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c: New file. + 2009-09-07 Ulrich Drepper <drepper@redhat.com> + * locale/programs/ld-collate.c (struct locale_collate_t): Add + unnamed_section_defined field. + (collate_read): Test and set unnamed_section_defined. + * posix/getconf.c (vars): Handle POSIX2_LINE_MAX in addition to _POSIX2_LINE_MAX. @@ -4841,7 +4841,7 @@ $as_echo_n "checking version of $AS... " >&6; } ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - 2.1[3-9]*|[2-9].[2-9]*) + 2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9]*|[3-9].*) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; @@ -4904,7 +4904,7 @@ $as_echo_n "checking version of $LD... " >&6; } ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - 2.1[3-9]*|[2-9].[2-9]*) + 2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9]*|3-9.*) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; diff --git a/configure.in b/configure.in index 7c4f71fda7..745e769cd1 100644 --- a/configure.in +++ b/configure.in @@ -897,10 +897,10 @@ AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in # Accept binutils 2.13 or newer. AC_CHECK_PROG_VER(AS, $AS, --version, [GNU assembler.* \([0-9]*\.[0-9.]*\)], - [2.1[3-9]*|[2-9].[2-9]*], AS=: critic_missing="$critic_missing as") + [2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9]*|[3-9].*], AS=: critic_missing="$critic_missing as") AC_CHECK_PROG_VER(LD, $LD, --version, [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)], - [2.1[3-9]*|[2-9].[2-9]*], LD=: critic_missing="$critic_missing ld") + [2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9]*]|[3-9].*, LD=: critic_missing="$critic_missing ld") # We need the physical current working directory. We cannot use the # "pwd -P" shell builtin since that's not portable. Instead we try to diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c index bf50e77aab..11bd7eacad 100644 --- a/locale/programs/ld-collate.c +++ b/locale/programs/ld-collate.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2003, 2005-2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 1995-2003, 2005-2008, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@gnu.org>, 1995. @@ -203,6 +203,8 @@ struct locale_collate_t struct section_list *current_section; /* There always can be an unnamed section. */ struct section_list unnamed_section; + /* Flag whether the unnamed section has been defined. */ + bool unnamed_section_defined; /* To make handling of errors easier we have another section. */ struct section_list error_section; /* Sometimes we are defining the values for collating symbols before @@ -634,7 +636,7 @@ find_element (struct linereader *ldfile, struct locale_collate_t *collate, if (find_entry (&collate->seq_table, str, len, &result) != 0) { /* Nope, not define yet. So we see whether it is a - collation symbol. */ + collation symbol. */ void *ptr; if (find_entry (&collate->sym_table, str, len, &ptr) == 0) @@ -788,7 +790,7 @@ insert_weights (struct linereader *ldfile, struct element_t *elem, if (*cp == '<') { /* Ahh, it's a bsymbol or an UCS4 value. If it's - the latter we have to unify the name. */ + the latter we have to unify the name. */ const char *startp = ++cp; size_t len; @@ -1302,8 +1304,8 @@ order for `%.*s' already defined at %s:%Zu"), else { /* Determine the range. To do so we have to determine the - common prefix of the both names and then the numeric - values of both ends. */ + common prefix of the both names and then the numeric + values of both ends. */ size_t lenfrom = strlen (startp->name); size_t lento = strlen (endp->name); char buf[lento + 1]; @@ -2222,14 +2224,14 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap, else { /* The entries in the list are sorted by length and then - alphabetically. This is the order in which we will add the - elements to the collation table. This allows simply walking + alphabetically. This is the order in which we will add the + elements to the collation table. This allows simply walking the table in sequence and stopping at the first matching - entry. Since the longer sequences are coming first in the - list they have the possibility to match first, just as it - has to be. In the worst case we are walking to the end of - the list where we put, if no singlebyte sequence is defined - in the locale definition, the weights for UNDEFINED. + entry. Since the longer sequences are coming first in the + list they have the possibility to match first, just as it + has to be. In the worst case we are walking to the end of + the list where we put, if no singlebyte sequence is defined + in the locale definition, the weights for UNDEFINED. To reduce the length of the search list we compress them a bit. This happens by collecting sequences of consecutive byte @@ -2297,7 +2299,7 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap, obstack_1grow_fast (&extrapool, curp->mbs[i]); /* Now find the end of the consecutive sequence and - add all the indeces in the indirect pool. */ + add all the indeces in the indirect pool. */ do { weightidx = output_weight (&weightpool, collate, curp); @@ -2312,7 +2314,7 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap, obstack_int32_grow (&indirectpool, weightidx); /* And add the end byte sequence. Without length this - time. */ + time. */ for (i = 1; i < curp->nmbs; ++i) obstack_1grow_fast (&extrapool, curp->mbs[i]); } @@ -2356,7 +2358,7 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap, & (__alignof__ (int32_t) - 1)) == 0); /* If the final entry in the list is not a single character we - add an UNDEFINED entry here. */ + add an UNDEFINED entry here. */ if (lastp->nmbs != 1) { int added = ((sizeof (int32_t) + 1 + 1 + __alignof__ (int32_t) - 1) @@ -3293,7 +3295,7 @@ error while adding equivalent collating symbol")); else { /* One should not be allowed to open the same - section twice. */ + section twice. */ if (sp->first != NULL) lr_error (ldfile, _("\ %s: multiple order definitions for section `%s'"), @@ -3349,7 +3351,7 @@ error while adding equivalent collating symbol")); section. */ collate->current_section = &collate->unnamed_section; - if (collate->unnamed_section.first != NULL) + if (collate->unnamed_section_defined) lr_error (ldfile, _("\ %s: multiple order definitions for unnamed section"), "LC_COLLATE"); @@ -3359,6 +3361,7 @@ error while adding equivalent collating symbol")); the collate->sections list. */ collate->unnamed_section.next = collate->sections; collate->sections = &collate->unnamed_section; + collate->unnamed_section_defined = true; } } @@ -3579,9 +3582,9 @@ error while adding equivalent collating symbol")); else { /* This is bad. The section after which we have to - reorder does not exist. Therefore we cannot - process the whole rest of this reorder - specification. */ + reorder does not exist. Therefore we cannot + process the whole rest of this reorder + specification. */ lr_error (ldfile, _("%s: section `%.*s' not known"), "LC_COLLATE", (int) arg->val.str.lenmb, arg->val.str.startmb); @@ -3657,9 +3660,9 @@ error while adding equivalent collating symbol")); if (state == 0) { /* We are outside an `order_start' region. This means - we must only accept definitions of values for - collation symbols since these are purely abstract - values and don't need directions associated. */ + we must only accept definitions of values for + collation symbols since these are purely abstract + values and don't need directions associated. */ void *ptr; if (find_entry (&collate->seq_table, symstr, symlen, &ptr) == 0) @@ -3741,7 +3744,7 @@ error while adding equivalent collating symbol")); seqp->next->last = seqp->last; /* We also have to check whether this entry is the - first or last of a section. */ + first or last of a section. */ if (seqp->section->first == seqp) { if (seqp->section->first == seqp->section->last) @@ -3798,7 +3801,7 @@ error while adding equivalent collating symbol")); } /* Process the rest of the line which might change - the collation rules. */ + the collation rules. */ arg = lr_token (ldfile, charmap, result, repertoire, verbose); if (arg->tok != tok_eof && arg->tok != tok_eol) @@ -3810,8 +3813,8 @@ error while adding equivalent collating symbol")); else if (was_ellipsis != tok_none) { /* Using the information in the `ellipsis_weight' - element and this and the last value we have to handle - the ellipsis now. */ + element and this and the last value we have to handle + the ellipsis now. */ assert (state == 1); handle_ellipsis (ldfile, symstr, symlen, was_ellipsis, charmap, @@ -3871,7 +3874,7 @@ error while adding equivalent collating symbol")); case tok_ellipsis3: /* absolute ellipsis */ case tok_ellipsis4: /* symbolic decimal ellipsis */ /* This is the symbolic (decimal or hexadecimal) or absolute - ellipsis. */ + ellipsis. */ if (was_ellipsis != tok_none) goto err_label; diff --git a/nptl/ChangeLog b/nptl/ChangeLog index b537413ce6..e9a278214a 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,7 @@ +2009-09-07 Andreas Schwab <schwab@redhat.com> + + * sysdeps/pthread/bits/libc-lock.h (BP_SYM): Remove space before paren. + 2009-09-02 Suzuki K P <suzuki@in.ibm.com> Joseph Myers <joseph@codesourcery.com> diff --git a/nptl/sysdeps/pthread/bits/libc-lock.h b/nptl/sysdeps/pthread/bits/libc-lock.h index a597f3b5a6..0cad8aa899 100644 --- a/nptl/sysdeps/pthread/bits/libc-lock.h +++ b/nptl/sysdeps/pthread/bits/libc-lock.h @@ -529,7 +529,7 @@ extern int __pthread_atfork (void (*__prepare) (void), # if _LIBC # include <bp-sym.h> # else -# define BP_SYM (sym) sym +# define BP_SYM(sym) sym # endif weak_extern (BP_SYM (__pthread_mutex_init)) weak_extern (BP_SYM (__pthread_mutex_destroy)) diff --git a/posix/getconf.c b/posix/getconf.c index facf5b08f5..d9d90e44f7 100644 --- a/posix/getconf.c +++ b/posix/getconf.c @@ -1052,34 +1052,34 @@ print_all (const char *path) printf("%-35s", c->name); switch (c->call) { case PATHCONF: - value = pathconf (path, c->call_name); - if (value != -1) { - printf("%ld", value); - } - printf("\n"); - break; + value = pathconf (path, c->call_name); + if (value != -1) { + printf("%ld", value); + } + printf("\n"); + break; case SYSCONF: - value = sysconf (c->call_name); - if (value == -1l) { - if (c->call_name == _SC_UINT_MAX - || c->call_name == _SC_ULONG_MAX) - printf ("%lu", value); - } - else { - printf ("%ld", value); - } - printf ("\n"); - break; + value = sysconf (c->call_name); + if (value == -1l) { + if (c->call_name == _SC_UINT_MAX + || c->call_name == _SC_ULONG_MAX) + printf ("%lu", value); + } + else { + printf ("%ld", value); + } + printf ("\n"); + break; case CONFSTR: - clen = confstr (c->call_name, (char *) NULL, 0); - cvalue = (char *) malloc (clen); - if (cvalue == NULL) - error (3, 0, _("memory exhausted")); - if (confstr (c->call_name, cvalue, clen) != clen) - error (3, errno, "confstr"); - printf ("%.*s\n", (int) clen, cvalue); + clen = confstr (c->call_name, (char *) NULL, 0); + cvalue = (char *) malloc (clen); + if (cvalue == NULL) + error (3, 0, _("memory exhausted")); + if (confstr (c->call_name, cvalue, clen) != clen) + error (3, errno, "confstr"); + printf ("%.*s\n", (int) clen, cvalue); free (cvalue); - break; + break; } } exit (0); @@ -1239,13 +1239,17 @@ environment SPEC.\n\n")); usage (); } - if (argc < 2 || argc > 3) + int ai = 1; + if (argc > ai && strcmp (argv[ai], "--") == 0) + ++ai; + + if (argc - ai < 1 || argc - ai > 2) usage (); for (c = vars; c->name != NULL; ++c) - if (strcmp (c->name, argv[1]) == 0 + if (strcmp (c->name, argv[ai]) == 0 || (strncmp (c->name, "_POSIX_", 7) == 0 - && strcmp (c->name + 7, argv[1]) == 0)) + && strcmp (c->name + 7, argv[ai]) == 0)) { long int value; size_t clen; @@ -1253,14 +1257,14 @@ environment SPEC.\n\n")); switch (c->call) { case PATHCONF: - if (argc < 3) + if (argc - ai < 2) usage (); errno = 0; - value = pathconf (argv[2], c->call_name); + value = pathconf (argv[ai + 1], c->call_name); if (value == -1) { if (errno) - error (3, errno, "pathconf: %s", argv[2]); + error (3, errno, "pathconf: %s", argv[ai + 1]); else puts (_("undefined")); } @@ -1269,7 +1273,7 @@ environment SPEC.\n\n")); exit (0); case SYSCONF: - if (argc > 2) + if (argc - ai > 1) usage (); value = sysconf (c->call_name); if (value == -1l) @@ -1285,7 +1289,7 @@ environment SPEC.\n\n")); exit (0); case CONFSTR: - if (argc > 2) + if (argc - ai > 1) usage (); clen = confstr (c->call_name, (char *) NULL, 0); cvalue = (char *) malloc (clen); @@ -1300,7 +1304,7 @@ environment SPEC.\n\n")); } } - error (2, 0, _("Unrecognized variable `%s'"), argv[1]); + error (2, 0, _("Unrecognized variable `%s'"), argv[ai]); /* NOTREACHED */ return 2; } diff --git a/sysdeps/s390/s390-32/____longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c index c5eb721e0e..b28e587498 100644 --- a/sysdeps/s390/s390-32/____longjmp_chk.c +++ b/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c @@ -24,6 +24,9 @@ #include <stdlib.h> #include <unistd.h> #include <stdio.h> +#include <stdint.h> +#include <signal.h> +#include <sys/syscall.h> #define __longjmp ____longjmp_chk @@ -35,7 +38,18 @@ __asm ("lr %0, %%r15" : "=r" (cur_sp)); \ new_sp ^= guard; \ if (new_sp < cur_sp) \ - __fortify_fail ("longjmp causes uninitialized stack frame"); \ + { \ + stack_t oss; \ + INTERNAL_SYSCALL_DECL (err); \ + int res = INTERNAL_SYSCALL (sigaltstack, err, 2, NULL, &oss); \ + if (!INTERNAL_SYSCALL_ERROR_P (res, err)) \ + { \ + if ((oss.ss_flags & SS_ONSTACK) == 0 \ + || ((uintptr_t) (oss.ss_sp + oss.ss_size) - new_sp \ + >= oss.ss_size)) \ + __fortify_fail ("longjmp causes uninitialized stack frame");\ + } \ + } \ } while (0) #include "__longjmp.c" diff --git a/sysdeps/s390/s390-64/____longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c index 241822ce4a..dcf58fb50b 100644 --- a/sysdeps/s390/s390-64/____longjmp_chk.c +++ b/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c @@ -24,6 +24,9 @@ #include <stdlib.h> #include <unistd.h> #include <stdio.h> +#include <stdint.h> +#include <signal.h> +#include <sys/syscall.h> #define __longjmp ____longjmp_chk @@ -35,7 +38,18 @@ __asm ("lgr %0, %%r15" : "=r" (cur_sp)); \ new_sp ^= guard; \ if (new_sp < cur_sp) \ - __fortify_fail ("longjmp causes uninitialized stack frame"); \ + { \ + stack_t oss; \ + INTERNAL_SYSCALL_DECL (err); \ + int res = INTERNAL_SYSCALL (sigaltstack, err, 2, NULL, &oss); \ + if (!INTERNAL_SYSCALL_ERROR_P (res, err)) \ + { \ + if ((oss.ss_flags & SS_ONSTACK) == 0 \ + || ((uintptr_t) (oss.ss_sp + oss.ss_size) - new_sp \ + >= oss.ss_size)) \ + __fortify_fail ("longjmp causes uninitialized stack frame");\ + } \ + } \ } while (0) #include "__longjmp.c" |