mirror of
git://sourceware.org/git/glibc.git
synced 2026-09-09 05:59:27 +08:00
Compare commits
217
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df79688ef6 | ||
|
|
07c65bd7b3 | ||
|
|
36edecaa99 | ||
|
|
cf65c66723 | ||
|
|
81313e32ef | ||
|
|
448f6a4dfb | ||
|
|
78856c5c73 | ||
|
|
50cb4b00a2 | ||
|
|
54717475a5 | ||
|
|
7d76befe53 | ||
|
|
875703d095 | ||
|
|
88a97c6e4c | ||
|
|
82c938203a | ||
|
|
b77931ad9f | ||
|
|
9bb6bfdf65 | ||
|
|
18852b24dc | ||
|
|
564bc26b79 | ||
|
|
d95270c5b5 | ||
|
|
2363f73c9f | ||
|
|
2d028cbedb | ||
|
|
426cfd7371 | ||
|
|
7b1d92c643 | ||
|
|
1b31d30e82 | ||
|
|
8277fdc1cd | ||
|
|
fea332e164 | ||
|
|
4e43f00fc3 | ||
|
|
7d789b1b4d | ||
|
|
c81fb726d8 | ||
|
|
fa9f66a6f0 | ||
|
|
efdc6bb89a | ||
|
|
6a29825d63 | ||
|
|
411a9d6b1d | ||
|
|
957a75e60b | ||
|
|
a02af4f1ae | ||
|
|
522cb50e61 | ||
|
|
ad78094bcb | ||
|
|
21eddf8cff | ||
|
|
a4fd88c0fc | ||
|
|
c55cc45ed7 | ||
|
|
758c66a234 | ||
|
|
44092c71f6 | ||
|
|
b72646ad0c | ||
|
|
b472343aa6 | ||
|
|
997c2a72c1 | ||
|
|
77314ef9bd | ||
|
|
6c1ac1d121 | ||
|
|
a525e03185 | ||
|
|
7928c812d3 | ||
|
|
24b5b849fd | ||
|
|
28ef97b099 | ||
|
|
83e15ff7c2 | ||
|
|
f369c365c2 | ||
|
|
7344c4a5cb | ||
|
|
47968f8ba8 | ||
|
|
bbfacbc5ea | ||
|
|
2d0273a47b | ||
|
|
0b62ea76db | ||
|
|
73c7d57959 | ||
|
|
72215c6000 | ||
|
|
d0a9695460 | ||
|
|
17a0fde057 | ||
|
|
9a1af187c1 | ||
|
|
216e05cac9 | ||
|
|
b6995df513 | ||
|
|
2796cd94a8 | ||
|
|
837d8a0fab | ||
|
|
961327556d | ||
|
|
7372b19962 | ||
|
|
977bbf5c18 | ||
|
|
491e94705b | ||
|
|
5c26c0f7f9 | ||
|
|
353ade4f9b | ||
|
|
d795f23c92 | ||
|
|
42c95109b2 | ||
|
|
1e0bcc2ee3 | ||
|
|
7112fd02ab | ||
|
|
dd2fde461e | ||
|
|
c01f7d05b8 | ||
|
|
49a47e5a16 | ||
|
|
2ea9855d59 | ||
|
|
457c305d8a | ||
|
|
5a647459c8 | ||
|
|
cbca5989ba | ||
|
|
5da0ad5538 | ||
|
|
4e951b5938 | ||
|
|
fa55fd7e5b | ||
|
|
7f5aef2309 | ||
|
|
1d81ee7397 | ||
|
|
8b1cd765b2 | ||
|
|
c88ea0dfe1 | ||
|
|
3f0ccf6ea5 | ||
|
|
1f260d0fdc | ||
|
|
153501dc10 | ||
|
|
8a69e300d5 | ||
|
|
f3a97f4c2c | ||
|
|
4eedc59901 | ||
|
|
72f754daa0 | ||
|
|
bca48e9a92 | ||
|
|
dca25feaf7 | ||
|
|
e6ff4b8b26 | ||
|
|
254fea5e8f | ||
|
|
5f353d1e05 | ||
|
|
311ad04d94 | ||
|
|
0ea58d8be3 | ||
|
|
9d70662339 | ||
|
|
07b72c0b42 | ||
|
|
720be42915 | ||
|
|
de8b6f612a | ||
|
|
5881b3d981 | ||
|
|
62724d5f1e | ||
|
|
553fe7087a | ||
|
|
9b44d3dad9 | ||
|
|
a17f00a815 | ||
|
|
9ca2c3cc19 | ||
|
|
827face44b | ||
|
|
ca47880178 | ||
|
|
0cd8f10947 | ||
|
|
cd8ba92d34 | ||
|
|
b001725149 | ||
|
|
a99e880cd8 | ||
|
|
831daea2c9 | ||
|
|
38e894eec8 | ||
|
|
0a15401613 | ||
|
|
88731ee916 | ||
|
|
a4c0656f24 | ||
|
|
f4b045b4b9 | ||
|
|
2158096703 | ||
|
|
ef43572852 | ||
|
|
4d4e902530 | ||
|
|
d0d308e32b | ||
|
|
a8226edc79 | ||
|
|
f2020c6459 | ||
|
|
6be390f354 | ||
|
|
6d270188ef | ||
|
|
32901cc363 | ||
|
|
b9b562e8bc | ||
|
|
50a66cf517 | ||
|
|
c4e15a30bd | ||
|
|
8ef4dbaf6d | ||
|
|
850121f39d | ||
|
|
15290d7086 | ||
|
|
ca27df35b7 | ||
|
|
49c6fd1ff2 | ||
|
|
59d5bd49df | ||
|
|
39879d17a4 | ||
|
|
1aa9c16a2a | ||
|
|
6b6e2d505c | ||
|
|
d75c76e1d7 | ||
|
|
443a33d804 | ||
|
|
52ade99fe5 | ||
|
|
fbca690a79 | ||
|
|
ed5e4f5aac | ||
|
|
1845ca2309 | ||
|
|
14b56bb117 | ||
|
|
ec2c681f5d | ||
|
|
16c1804e69 | ||
|
|
159aeed982 | ||
|
|
043ea9e79d | ||
|
|
ea614f680d | ||
|
|
6c4a23bc8d | ||
|
|
02c9c5d2be | ||
|
|
888fec4045 | ||
|
|
64a532ff2c | ||
|
|
9914417d12 | ||
|
|
8469d71f1f | ||
|
|
f273badc6b | ||
|
|
877103176f | ||
|
|
7dab764e60 | ||
|
|
a82e74eb46 | ||
|
|
fae1e90fa1 | ||
|
|
3c0fb4080d | ||
|
|
2da4488386 | ||
|
|
a4b67d9bcd | ||
|
|
f514e0b227 | ||
|
|
69ad8afe74 | ||
|
|
c648b3046e | ||
|
|
b204d65517 | ||
|
|
272eb2b141 | ||
|
|
4aa960e79d | ||
|
|
2ce2bf1a98 | ||
|
|
721d1acb10 | ||
|
|
ea8e535ed1 | ||
|
|
5238213a22 | ||
|
|
b95387484e | ||
|
|
b0e8ad9e4b | ||
|
|
72fe1ad152 | ||
|
|
e73ad37f15 | ||
|
|
8c55b16c2f | ||
|
|
ec10a41982 | ||
|
|
71197fe61f | ||
|
|
11c19d374b | ||
|
|
2dfab6cf7c | ||
|
|
7b35a400cf | ||
|
|
a4b737aa08 | ||
|
|
3decedce64 | ||
|
|
1db8b35487 | ||
|
|
bc207ace44 | ||
|
|
65a27b0b41 | ||
|
|
4f9d265e05 | ||
|
|
b15f34af1c | ||
|
|
ede3f7ef5c | ||
|
|
360f6f3a25 | ||
|
|
93721a641a | ||
|
|
8d7c09b162 | ||
|
|
1bc1954c73 | ||
|
|
16b583ea7e | ||
|
|
488e337a17 | ||
|
|
b12103e146 | ||
|
|
c35a44f325 | ||
|
|
1960ded78b | ||
|
|
b39591e9c1 | ||
|
|
c086031db0 | ||
|
|
22bdb3aa5b | ||
|
|
c0ca09284e | ||
|
|
c78e33c312 | ||
|
|
3e224a852a | ||
|
|
dc2d2c7e91 |
@@ -1 +1,2 @@
|
||||
timezone/* -whitespace
|
||||
INSTALL -whitespace
|
||||
|
||||
@@ -317,11 +317,12 @@ build the GNU C library:
|
||||
Check the FAQ for any special compiler issues on particular
|
||||
platforms.
|
||||
|
||||
* GNU `binutils' 2.15 or later
|
||||
* GNU `binutils'
|
||||
|
||||
You must use GNU `binutils' (as and ld) to build the GNU C library.
|
||||
No other assembler or linker has the necessary functionality at the
|
||||
moment.
|
||||
moment. The configure scripts checks for the appropriate version
|
||||
for the platform. Too-old versions will prevent building glibc.
|
||||
|
||||
* GNU `texinfo' 3.12f
|
||||
|
||||
|
||||
+4
-4
@@ -686,7 +686,7 @@ CPPFLAGS = $($(subdir)-CPPFLAGS) $(+includes) $(defines) \
|
||||
-include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
|
||||
$(CPPFLAGS-$(suffix $@)) \
|
||||
$(foreach lib,$(libof-$(basename $(@F))) \
|
||||
$(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
|
||||
$(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
|
||||
$(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
|
||||
override CFLAGS = -std=gnu99 $(gnu89-inline-CFLAGS) \
|
||||
$(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
|
||||
@@ -957,7 +957,7 @@ endif
|
||||
# emitted into sysd-rules. A sysdeps Makeconfig fragment can
|
||||
# add its own special object file prefix to this list with e.g. foo-%:%
|
||||
# to have foo-*.? compiled from *.? using $(foo-CPPFLAGS).
|
||||
sysd-rules-patterns := %:% rtld-%:% m_%:s_%
|
||||
sysd-rules-patterns := %:% rtld-%:rtld-% rtld-%:% m_%:s_%
|
||||
|
||||
# Let sysdeps/ subdirs contain a Makeconfig fragment for us to include here.
|
||||
sysdep-makeconfigs := $(wildcard $(+sysdep_dirs:=/Makeconfig))
|
||||
@@ -966,8 +966,8 @@ include $(sysdep-makeconfigs)
|
||||
endif
|
||||
|
||||
# Compute just the target patterns. Makeconfig has set sysd-rules-patterns.
|
||||
sysd-rules-targets := $(foreach p,$(sysd-rules-patterns),\
|
||||
$(firstword $(subst :, ,$p)))
|
||||
sysd-rules-targets := $(sort $(foreach p,$(sysd-rules-patterns),\
|
||||
$(firstword $(subst :, ,$p))))
|
||||
|
||||
endif # Makeconfig not yet included
|
||||
|
||||
|
||||
+3
-2
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1997, 2002, 2003, 2006, 2007 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997,2002,2003,2006,2007,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
|
||||
@@ -26,12 +26,13 @@ distribute = argp-fmtstream.h argp-namefrob.h
|
||||
routines = $(addprefix argp-, ba fmtstream fs-xinl help parse pv \
|
||||
pvh xinl eexst)
|
||||
|
||||
tests = argp-test tst-argp1 bug-argp1 tst-argp2
|
||||
tests = argp-test tst-argp1 bug-argp1 tst-argp2 bug-argp2
|
||||
|
||||
CFLAGS-argp-help.c = $(uses-callbacks) -fexceptions
|
||||
CFLAGS-argp-parse.c = $(uses-callbacks)
|
||||
CFLAGS-argp-fmtstream.c = -fexceptions
|
||||
|
||||
bug-argp1-ARGS = -- --help
|
||||
bug-argp2-ARGS = -- -d 111 --dstaddr 222 -p 333 --peer 444
|
||||
|
||||
include ../Rules
|
||||
|
||||
+6
-6
@@ -1,5 +1,5 @@
|
||||
/* Hierarchial argument parsing, layered over getopt
|
||||
Copyright (C) 1995-2000, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2000, 2002, 2003, 2004, 2010 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -99,7 +99,7 @@ static volatile int _argp_hang;
|
||||
|
||||
static const struct argp_option argp_default_options[] =
|
||||
{
|
||||
{"help", '?', 0, 0, N_("Give this help list"), -1},
|
||||
{"help", '?', 0, 0, N_("Give this help list"), -1},
|
||||
{"usage", OPT_USAGE, 0, 0, N_("Give a short usage message")},
|
||||
{"program-name",OPT_PROGNAME,"NAME", OPTION_HIDDEN, N_("Set the program name")},
|
||||
{"HANG", OPT_HANG, "SECS", OPTION_ARG_OPTIONAL | OPTION_HIDDEN,
|
||||
@@ -164,7 +164,7 @@ static const struct argp argp_default_argp =
|
||||
|
||||
static const struct argp_option argp_version_options[] =
|
||||
{
|
||||
{"version", 'V', 0, 0, N_("Print program version"), -1},
|
||||
{"version", 'V', 0, 0, N_("Print program version"), -1},
|
||||
{0, 0}
|
||||
};
|
||||
|
||||
@@ -364,7 +364,7 @@ convert_options (const struct argp *argp,
|
||||
values (the sign of the lower bits is preserved
|
||||
however)... */
|
||||
cvt->long_end->val =
|
||||
((opt->key | real->key) & USER_MASK)
|
||||
((opt->key ? opt->key : real->key) & USER_MASK)
|
||||
+ (((group - cvt->parser->groups) + 1) << USER_BITS);
|
||||
|
||||
/* Keep the LONG_OPTS list terminated. */
|
||||
@@ -385,7 +385,7 @@ convert_options (const struct argp *argp,
|
||||
|
||||
if (children)
|
||||
/* Assign GROUP's CHILD_INPUTS field some space from
|
||||
CVT->child_inputs_end.*/
|
||||
CVT->child_inputs_end.*/
|
||||
{
|
||||
unsigned num_children = 0;
|
||||
while (children[num_children].argp)
|
||||
@@ -823,7 +823,7 @@ parser_parse_next (struct parser *parser, int *arg_ebadkey)
|
||||
parser->try_getopt = 0;
|
||||
if (parser->state.next > 1
|
||||
&& strcmp (parser->state.argv[parser->state.next - 1], QUOTE)
|
||||
== 0)
|
||||
== 0)
|
||||
/* Not only is this the end of the options, but it's a
|
||||
`quoted' region, which may have args that *look* like
|
||||
options, so we definitely shouldn't try to use getopt past
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
#include <argp.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static struct argp_option argp_options[] = {
|
||||
{ "dstaddr", 'd', "ADDR", 0,
|
||||
"set destination (peer) address to ADDR" },
|
||||
{ "peer", 'p', "ADDR", OPTION_ALIAS },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static error_t parse_opt (int key, char *arg, struct argp_state *state);
|
||||
|
||||
static struct argp argp =
|
||||
{
|
||||
argp_options, parse_opt
|
||||
};
|
||||
|
||||
static int cnt;
|
||||
|
||||
static int
|
||||
do_test (int argc, char *argv[])
|
||||
{
|
||||
int remaining;
|
||||
argp_parse (&argp, argc, argv, 0, &remaining, NULL);
|
||||
return cnt != 4;
|
||||
}
|
||||
|
||||
static error_t
|
||||
parse_opt (int key, char *arg, struct argp_state *state)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case 'd':
|
||||
case 'p':
|
||||
printf ("got '%c' with argument '%s'\n", key, arg);
|
||||
++cnt;
|
||||
break;
|
||||
case 0:
|
||||
case ARGP_KEY_END:
|
||||
case ARGP_KEY_NO_ARGS:
|
||||
case ARGP_KEY_INIT:
|
||||
case ARGP_KEY_SUCCESS:
|
||||
case ARGP_KEY_FINI:
|
||||
// Ignore.
|
||||
return ARGP_ERR_UNKNOWN;
|
||||
default:
|
||||
printf ("invalid key '%x'\n", key);
|
||||
exit (1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define TEST_FUNCTION do_test (argc, argv)
|
||||
#include "../test-skeleton.c"
|
||||
+1
-1
@@ -527,7 +527,7 @@ enum
|
||||
|
||||
_SC_THREAD_ROBUST_PRIO_INHERIT,
|
||||
#define _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_INHERIT
|
||||
_SC_THREAD_ROBUST_PRIO_PROTECT,
|
||||
_SC_THREAD_ROBUST_PRIO_PROTECT
|
||||
#define _SC_THREAD_ROBUST_PRIO_PROTECT _SC_THREAD_ROBUST_PRIO_PROTECT
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ have-cpp-asm-debuginfo = @libc_cv_cpp_asm_debuginfo@
|
||||
enable-check-abi = @enable_check_abi@
|
||||
have-forced-unwind = @libc_cv_forced_unwind@
|
||||
have-fpie = @libc_cv_fpie@
|
||||
gnu89-inline-CFLAGS = @libc_cv_gnu89_inline@
|
||||
gnu89-inline-CFLAGS = @gnu89_inline@
|
||||
have-ssp = @libc_cv_ssp@
|
||||
have-selinux = @have_selinux@
|
||||
have-libaudit = @have_libaudit@
|
||||
|
||||
@@ -681,7 +681,7 @@ libc_cv_cc_submachine
|
||||
exceptions
|
||||
no_whole_archive
|
||||
libc_cv_have_initfini
|
||||
libc_cv_gnu89_inline
|
||||
gnu89_inline
|
||||
libc_cv_ssp
|
||||
fno_unit_at_a_time
|
||||
libc_cv_hashstyle
|
||||
@@ -6890,9 +6890,9 @@ fi
|
||||
{ $as_echo "$as_me:$LINENO: result: $libc_cv_gnu89_inline" >&5
|
||||
$as_echo "$libc_cv_gnu89_inline" >&6; }
|
||||
if test $libc_cv_gnu89_inline = yes; then
|
||||
libc_cv_gnu89_inline=-fgnu89-inline
|
||||
gnu89_inline=-fgnu89-inline
|
||||
else
|
||||
libc_cv_gnu89_inline=
|
||||
gnu89_inline=
|
||||
fi
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -1776,11 +1776,11 @@ else
|
||||
fi
|
||||
rm -f conftest*])
|
||||
if test $libc_cv_gnu89_inline = yes; then
|
||||
libc_cv_gnu89_inline=-fgnu89-inline
|
||||
gnu89_inline=-fgnu89-inline
|
||||
else
|
||||
libc_cv_gnu89_inline=
|
||||
gnu89_inline=
|
||||
fi
|
||||
AC_SUBST(libc_cv_gnu89_inline)
|
||||
AC_SUBST(gnu89_inline)
|
||||
|
||||
if test $elf != yes; then
|
||||
AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
|
||||
|
||||
@@ -87,7 +87,7 @@ function int getaddrinfo (const char*, const char*, const struct addrinfo*, stru
|
||||
function {struct hostent*} gethostbyaddr (const void*, socklen_t, int)
|
||||
function {struct hostent*} gethostbyname (const char*)
|
||||
function {struct hostent*} gethostent (void)
|
||||
function int getnameinfo (const struct sockaddr*, socklen_t, char*, socklen_t, char*, socklen_t, unsigned)
|
||||
function int getnameinfo (const struct sockaddr*, socklen_t, char*, socklen_t, char*, socklen_t, int)
|
||||
function {struct netent*} getnetbyaddr (uint32_t, int)
|
||||
function {struct netent*} getnetbyname (const char*)
|
||||
function {struct netent*} getnetent (void)
|
||||
|
||||
+43
-41
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* UFC-crypt: ultra fast crypt(3) implementation
|
||||
*
|
||||
* Copyright (C) 1991, 92, 93, 96, 97, 98, 2000 Free Software Foundation, Inc.
|
||||
* Copyright (C) 1991-1993,1996-1998,2000,2010 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -27,6 +27,7 @@
|
||||
#ifdef DEBUG
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#include <atomic.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef STATIC
|
||||
@@ -114,53 +115,53 @@ static const int perm32[32] = {
|
||||
* The sboxes
|
||||
*/
|
||||
static const int sbox[8][4][16]= {
|
||||
{ { 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7 },
|
||||
{ 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8 },
|
||||
{ 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0 },
|
||||
{ 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13 }
|
||||
},
|
||||
{ { 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7 },
|
||||
{ 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8 },
|
||||
{ 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0 },
|
||||
{ 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13 }
|
||||
},
|
||||
|
||||
{ { 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10 },
|
||||
{ 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5 },
|
||||
{ 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15 },
|
||||
{ 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9 }
|
||||
},
|
||||
{ { 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10 },
|
||||
{ 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5 },
|
||||
{ 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15 },
|
||||
{ 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9 }
|
||||
},
|
||||
|
||||
{ { 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8 },
|
||||
{ 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1 },
|
||||
{ 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7 },
|
||||
{ 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12 }
|
||||
},
|
||||
{ { 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8 },
|
||||
{ 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1 },
|
||||
{ 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7 },
|
||||
{ 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12 }
|
||||
},
|
||||
|
||||
{ { 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15 },
|
||||
{ 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9 },
|
||||
{ 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4 },
|
||||
{ 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14 }
|
||||
},
|
||||
{ { 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15 },
|
||||
{ 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9 },
|
||||
{ 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4 },
|
||||
{ 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14 }
|
||||
},
|
||||
|
||||
{ { 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9 },
|
||||
{ 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6 },
|
||||
{ 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14 },
|
||||
{ 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3 }
|
||||
},
|
||||
{ { 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9 },
|
||||
{ 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6 },
|
||||
{ 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14 },
|
||||
{ 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3 }
|
||||
},
|
||||
|
||||
{ { 12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11 },
|
||||
{ 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8 },
|
||||
{ 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6 },
|
||||
{ 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13 }
|
||||
},
|
||||
{ { 12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11 },
|
||||
{ 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8 },
|
||||
{ 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6 },
|
||||
{ 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13 }
|
||||
},
|
||||
|
||||
{ { 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1 },
|
||||
{ 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6 },
|
||||
{ 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2 },
|
||||
{ 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12 }
|
||||
},
|
||||
{ { 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1 },
|
||||
{ 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6 },
|
||||
{ 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2 },
|
||||
{ 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12 }
|
||||
},
|
||||
|
||||
{ { 13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7 },
|
||||
{ 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2 },
|
||||
{ 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8 },
|
||||
{ 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11 }
|
||||
}
|
||||
{ { 13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7 },
|
||||
{ 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2 },
|
||||
{ 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8 },
|
||||
{ 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11 }
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -468,6 +469,7 @@ __init_des_r(__data)
|
||||
efp[comes_from_word][word_value][o_long] |= mask2;
|
||||
}
|
||||
}
|
||||
atomic_write_barrier ();
|
||||
small_tables_initialized = 1;
|
||||
#ifdef __GNU_LIBRARY__
|
||||
small_tables_done:
|
||||
|
||||
+13
-2
@@ -1,5 +1,5 @@
|
||||
# Makefile for csu code for GNU C library.
|
||||
# Copyright (C) 1995-2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995-2004, 2005, 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
|
||||
@@ -209,8 +209,19 @@ $(objpfx)version-info.h: $(common-objpfx)config.make $(all-Banner-files)
|
||||
linux*) version=`(printf '%s\n%s\n' \
|
||||
'#include <linux/version.h>' \
|
||||
UTS_RELEASE \
|
||||
| $(CC) $(CPPFLAGS) -E -P - -DNOT_IN_libc=1 | \
|
||||
| $(CC) $(CPPFLAGS) -O -E -P - -DNOT_IN_libc=1 | \
|
||||
sed -e 's/"\([^"]*\)".*/\1/p' -e d) 2>/dev/null`;\
|
||||
if [ -z "$$version" ]; then \
|
||||
version=`(printf '%s\n%s\n' \
|
||||
'#include <linux/version.h>' \
|
||||
LINUX_VERSION_CODE \
|
||||
| $(CC) $(CPPFLAGS) -O -E -P - -DNOT_IN_libc=1 \
|
||||
| sed -n -e '/^[123456789].*/p' \
|
||||
| awk '{v=$$1; \
|
||||
printf("%d.%d.%d\n", \
|
||||
v/65535, v/256%256, v%256)}') \
|
||||
2>/dev/null`; \
|
||||
fi; \
|
||||
if [ -z "$$version" ]; then \
|
||||
if [ -r /proc/version ]; then \
|
||||
version=`sed 's/.*Linux version \([^ ]*\) .*/>>\1<</' \
|
||||
|
||||
+15
-6
@@ -72,15 +72,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
|
||||
{
|
||||
@@ -98,7 +97,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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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. */
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991-2000, 2003-2005, 2009 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991-2000,2003-2005,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
|
||||
@@ -218,7 +218,7 @@ extern void seekdir (DIR *__dirp, long int __pos) __THROW __nonnull ((1));
|
||||
extern long int telldir (DIR *__dirp) __THROW __nonnull ((1));
|
||||
#endif
|
||||
|
||||
#if defined __USE_BSD || defined __USE_MISC || defined __XOPEN_2K8
|
||||
#if defined __USE_BSD || defined __USE_MISC || defined __XOPEN2K8
|
||||
|
||||
/* Return the file descriptor used by DIRP. */
|
||||
extern int dirfd (DIR *__dirp) __THROW __nonnull ((1));
|
||||
|
||||
+3
-3
@@ -759,11 +759,11 @@ $(objpfx)tst-tls8.out: $(objpfx)tst-tlsmod3.so $(objpfx)tst-tlsmod4.so
|
||||
$(objpfx)tst-tls9: $(libdl)
|
||||
$(objpfx)tst-tls9.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
|
||||
|
||||
$(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so
|
||||
$(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so $(objpfx)tst-tlsmod7.so
|
||||
|
||||
$(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so
|
||||
$(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so $(objpfx)tst-tlsmod9.so
|
||||
|
||||
$(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so
|
||||
$(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so $(objpfx)tst-tlsmod11.so
|
||||
|
||||
$(objpfx)tst-tls13: $(libdl)
|
||||
$(objpfx)tst-tls13.out: $(objpfx)tst-tlsmod13a.so
|
||||
|
||||
+3
-7
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
+5
-5
@@ -62,7 +62,7 @@ openaux (void *a)
|
||||
{
|
||||
struct openaux_args *args = (struct openaux_args *) a;
|
||||
|
||||
args->aux = _dl_map_object (args->map, args->name, 0,
|
||||
args->aux = _dl_map_object (args->map, args->name,
|
||||
(args->map->l_type == lt_executable
|
||||
? lt_library : args->map->l_type),
|
||||
args->trace_mode, args->open_mode,
|
||||
@@ -491,6 +491,10 @@ _dl_map_object_deps (struct link_map *map,
|
||||
if (errno == 0 && errno_saved != 0)
|
||||
__set_errno (errno_saved);
|
||||
|
||||
if (errno_reason)
|
||||
_dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
|
||||
NULL, errstring);
|
||||
|
||||
struct link_map **old_l_initfini = NULL;
|
||||
if (map->l_initfini != NULL && map->l_type == lt_loaded)
|
||||
{
|
||||
@@ -666,8 +670,4 @@ Filters not supported with LD_TRACE_PRELINKING"));
|
||||
}
|
||||
if (old_l_initfini != NULL)
|
||||
_dl_scope_free (old_l_initfini);
|
||||
|
||||
if (errno_reason)
|
||||
_dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
|
||||
NULL, errstring);
|
||||
}
|
||||
|
||||
+22
-12
@@ -1,6 +1,5 @@
|
||||
/* Handling of dynamic sring tokens.
|
||||
Copyright (C) 1999,2001,2002,2003,2004,2006,2007
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1999,2001-2004,2006,2007,2011 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
|
||||
@@ -18,6 +17,8 @@
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include "trusted-dirs.h"
|
||||
|
||||
/* Determine the number of DST elements in the name. Only if IS_PATH is
|
||||
nonzero paths are recognized (i.e., multiple, ':' separated filenames). */
|
||||
#define DL_DST_COUNT(name, is_path) \
|
||||
@@ -31,6 +32,11 @@
|
||||
__cnt; })
|
||||
|
||||
|
||||
#ifdef SHARED
|
||||
# define IS_RTLD(l) (l) == &GL(dl_rtld_map)
|
||||
#else
|
||||
# define IS_RTLD(l) 0
|
||||
#endif
|
||||
/* Guess from the number of DSTs the length of the result string. */
|
||||
#define DL_DST_REQUIRED(l, name, len, cnt) \
|
||||
({ \
|
||||
@@ -39,28 +45,32 @@
|
||||
\
|
||||
if (__cnt > 0) \
|
||||
{ \
|
||||
size_t origin_len; \
|
||||
size_t dst_len; \
|
||||
/* Now we make a guess how many extra characters on top of the \
|
||||
length of S we need to represent the result. We know that \
|
||||
we have CNT replacements. Each at most can use \
|
||||
MAX (strlen (ORIGIN), strlen (_dl_platform)) \
|
||||
minus 7 (which is the length of "$ORIGIN"). \
|
||||
MAX (MAX (strlen (ORIGIN), strlen (_dl_platform)), \
|
||||
strlen (DL_DST_LIB)) \
|
||||
minus 4 (which is the length of "$LIB"). \
|
||||
\
|
||||
First get the origin string if it is not available yet. \
|
||||
This can only happen for the map of the executable. */ \
|
||||
This can only happen for the map of the executable or, when \
|
||||
auditing, in ld.so. */ \
|
||||
DL_DST_REQ_STATIC (l) \
|
||||
if ((l)->l_origin == NULL) \
|
||||
{ \
|
||||
assert ((l)->l_name[0] == '\0'); \
|
||||
assert ((l)->l_name[0] == '\0' || IS_RTLD (l)); \
|
||||
(l)->l_origin = _dl_get_origin (); \
|
||||
origin_len = ((l)->l_origin && (l)->l_origin != (char *) -1 \
|
||||
dst_len = ((l)->l_origin && (l)->l_origin != (char *) -1 \
|
||||
? strlen ((l)->l_origin) : 0); \
|
||||
} \
|
||||
else \
|
||||
origin_len = (l)->l_origin == (char *) -1 \
|
||||
dst_len = (l)->l_origin == (char *) -1 \
|
||||
? 0 : strlen ((l)->l_origin); \
|
||||
\
|
||||
__len += __cnt * (MAX (origin_len, GLRO(dl_platformlen)) - 7); \
|
||||
dst_len = MAX (MAX (dst_len, GLRO(dl_platformlen)), \
|
||||
strlen (DL_DST_LIB)); \
|
||||
if (dst_len > 4) \
|
||||
__len += __cnt * (dst_len - 4); \
|
||||
} \
|
||||
\
|
||||
__len; })
|
||||
@@ -72,7 +82,7 @@
|
||||
if ((l) == NULL) \
|
||||
{ \
|
||||
const char *origin = _dl_get_origin (); \
|
||||
origin_len = (origin && origin != (char *) -1 ? strlen (origin) : 0); \
|
||||
dst_len = (origin && origin != (char *) -1 ? strlen (origin) : 0); \
|
||||
} \
|
||||
else
|
||||
#endif
|
||||
|
||||
+152
-61
@@ -1,5 +1,5 @@
|
||||
/* Map in a shared object's segments from the file.
|
||||
Copyright (C) 1995-2005, 2006, 2007, 2009 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2007, 2009, 2011 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
|
||||
@@ -168,6 +168,87 @@ local_strdup (const char *s)
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
is_trusted_path (const char *path, size_t len)
|
||||
{
|
||||
const char *trun = system_dirs;
|
||||
|
||||
for (size_t idx = 0; idx < nsystem_dirs_len; ++idx)
|
||||
{
|
||||
if (len == system_dirs_len[idx] && memcmp (trun, path, len) == 0)
|
||||
/* Found it. */
|
||||
return true;
|
||||
|
||||
trun += system_dirs_len[idx] + 1;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
is_trusted_path_normalize (const char *path, size_t len)
|
||||
{
|
||||
if (len == 0)
|
||||
return false;
|
||||
|
||||
if (*path == ':')
|
||||
{
|
||||
++path;
|
||||
--len;
|
||||
}
|
||||
|
||||
char *npath = (char *) alloca (len + 2);
|
||||
char *wnp = npath;
|
||||
while (*path != '\0')
|
||||
{
|
||||
if (path[0] == '/')
|
||||
{
|
||||
if (path[1] == '.')
|
||||
{
|
||||
if (path[2] == '.' && (path[3] == '/' || path[3] == '\0'))
|
||||
{
|
||||
while (wnp > npath && *--wnp != '/')
|
||||
;
|
||||
path += 3;
|
||||
continue;
|
||||
}
|
||||
else if (path[2] == '/' || path[2] == '\0')
|
||||
{
|
||||
path += 2;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (wnp > npath && wnp[-1] == '/')
|
||||
{
|
||||
++path;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
*wnp++ = *path++;
|
||||
}
|
||||
|
||||
if (wnp == npath || wnp[-1] != '/')
|
||||
*wnp++ = '/';
|
||||
|
||||
const char *trun = system_dirs;
|
||||
|
||||
for (size_t idx = 0; idx < nsystem_dirs_len; ++idx)
|
||||
{
|
||||
if (wnp - npath >= system_dirs_len[idx]
|
||||
&& memcmp (trun, npath, system_dirs_len[idx]) == 0)
|
||||
/* Found it. */
|
||||
return true;
|
||||
|
||||
trun += system_dirs_len[idx] + 1;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static size_t
|
||||
is_dst (const char *start, const char *name, const char *str,
|
||||
int is_path, int secure)
|
||||
@@ -200,7 +281,8 @@ is_dst (const char *start, const char *name, const char *str,
|
||||
return 0;
|
||||
|
||||
if (__builtin_expect (secure, 0)
|
||||
&& ((name[len] != '\0' && (!is_path || name[len] != ':'))
|
||||
&& ((name[len] != '\0' && name[len] != '/'
|
||||
&& (!is_path || name[len] != ':'))
|
||||
|| (name != start + 1 && (!is_path || name[-2] != ':'))))
|
||||
return 0;
|
||||
|
||||
@@ -240,13 +322,14 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
|
||||
int is_path)
|
||||
{
|
||||
const char *const start = name;
|
||||
char *last_elem, *wp;
|
||||
|
||||
/* Now fill the result path. While copying over the string we keep
|
||||
track of the start of the last path element. When we come accross
|
||||
a DST we copy over the value or (if the value is not available)
|
||||
leave the entire path element out. */
|
||||
last_elem = wp = result;
|
||||
char *wp = result;
|
||||
char *last_elem = result;
|
||||
bool check_for_trusted = false;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -265,6 +348,9 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
|
||||
else
|
||||
#endif
|
||||
repl = l->l_origin;
|
||||
|
||||
check_for_trusted = (INTUSE(__libc_enable_secure)
|
||||
&& l->l_type == lt_executable);
|
||||
}
|
||||
else if ((len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0)
|
||||
repl = GLRO(dl_platform);
|
||||
@@ -284,6 +370,10 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
|
||||
name += len;
|
||||
while (*name != '\0' && (!is_path || *name != ':'))
|
||||
++name;
|
||||
/* Also skip following colon if this is the first rpath
|
||||
element, but keep an empty element at the end. */
|
||||
if (wp == result && is_path && *name == ':' && name[1] != '\0')
|
||||
++name;
|
||||
}
|
||||
else
|
||||
/* No DST we recognize. */
|
||||
@@ -293,11 +383,28 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
|
||||
{
|
||||
*wp++ = *name++;
|
||||
if (is_path && *name == ':')
|
||||
last_elem = wp;
|
||||
{
|
||||
/* In SUID/SGID programs, after $ORIGIN expansion the
|
||||
normalized path must be rooted in one of the trusted
|
||||
directories. */
|
||||
if (__builtin_expect (check_for_trusted, false)
|
||||
&& !is_trusted_path_normalize (last_elem, wp - last_elem))
|
||||
wp = last_elem;
|
||||
else
|
||||
last_elem = wp;
|
||||
|
||||
check_for_trusted = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (*name != '\0');
|
||||
|
||||
/* In SUID/SGID programs, after $ORIGIN expansion the normalized
|
||||
path must be rooted in one of the trusted directories. */
|
||||
if (__builtin_expect (check_for_trusted, false)
|
||||
&& !is_trusted_path_normalize (last_elem, wp - last_elem))
|
||||
wp = last_elem;
|
||||
|
||||
*wp = '\0';
|
||||
|
||||
return result;
|
||||
@@ -310,7 +417,7 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
|
||||
belonging to the map is loaded. In this case the path element
|
||||
containing $ORIGIN is left out. */
|
||||
static char *
|
||||
expand_dynamic_string_token (struct link_map *l, const char *s)
|
||||
expand_dynamic_string_token (struct link_map *l, const char *s, int is_path)
|
||||
{
|
||||
/* We make two runs over the string. First we determine how large the
|
||||
resulting string is and then we copy it over. Since this is now
|
||||
@@ -321,7 +428,7 @@ expand_dynamic_string_token (struct link_map *l, const char *s)
|
||||
char *result;
|
||||
|
||||
/* Determine the number of DST elements. */
|
||||
cnt = DL_DST_COUNT (s, 1);
|
||||
cnt = DL_DST_COUNT (s, is_path);
|
||||
|
||||
/* If we do not have to replace anything simply copy the string. */
|
||||
if (__builtin_expect (cnt, 0) == 0)
|
||||
@@ -335,7 +442,7 @@ expand_dynamic_string_token (struct link_map *l, const char *s)
|
||||
if (result == NULL)
|
||||
return NULL;
|
||||
|
||||
return _dl_dst_substitute (l, s, result, 1);
|
||||
return _dl_dst_substitute (l, s, result, is_path);
|
||||
}
|
||||
|
||||
|
||||
@@ -407,33 +514,8 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep,
|
||||
cp[len++] = '/';
|
||||
|
||||
/* Make sure we don't use untrusted directories if we run SUID. */
|
||||
if (__builtin_expect (check_trusted, 0))
|
||||
{
|
||||
const char *trun = system_dirs;
|
||||
size_t idx;
|
||||
int unsecure = 1;
|
||||
|
||||
/* All trusted directories must be complete names. */
|
||||
if (cp[0] == '/')
|
||||
{
|
||||
for (idx = 0; idx < nsystem_dirs_len; ++idx)
|
||||
{
|
||||
if (len == system_dirs_len[idx]
|
||||
&& memcmp (trun, cp, len) == 0)
|
||||
{
|
||||
/* Found it. */
|
||||
unsecure = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
trun += system_dirs_len[idx] + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (unsecure)
|
||||
/* Simply drop this directory. */
|
||||
continue;
|
||||
}
|
||||
if (__builtin_expect (check_trusted, 0) && !is_trusted_path (cp, len))
|
||||
continue;
|
||||
|
||||
/* See if this directory is already known. */
|
||||
for (dirp = GL(dl_all_dirs); dirp != NULL; dirp = dirp->next)
|
||||
@@ -551,13 +633,21 @@ decompose_rpath (struct r_search_path_struct *sps,
|
||||
|
||||
/* Make a writable copy. At the same time expand possible dynamic
|
||||
string tokens. */
|
||||
copy = expand_dynamic_string_token (l, rpath);
|
||||
copy = expand_dynamic_string_token (l, rpath, 1);
|
||||
if (copy == NULL)
|
||||
{
|
||||
errstring = N_("cannot create RUNPATH/RPATH copy");
|
||||
goto signal_error;
|
||||
}
|
||||
|
||||
/* Ignore empty rpaths. */
|
||||
if (*copy == 0)
|
||||
{
|
||||
free (copy);
|
||||
sps->dirs = (struct r_search_path_elem **) -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Count the number of necessary elements in the result array. */
|
||||
nelems = 0;
|
||||
for (cp = copy; *cp != '\0'; ++cp)
|
||||
@@ -801,19 +891,7 @@ lose (int code, int fd, const char *name, char *realname, struct link_map *l,
|
||||
/* The file might already be closed. */
|
||||
if (fd != -1)
|
||||
(void) __close (fd);
|
||||
if (l != NULL)
|
||||
{
|
||||
/* Remove the stillborn object from the list and free it. */
|
||||
assert (l->l_next == NULL);
|
||||
if (l->l_prev == NULL)
|
||||
/* No other module loaded. This happens only in the static library,
|
||||
or in rtld under --verify. */
|
||||
GL(dl_ns)[l->l_ns]._ns_loaded = NULL;
|
||||
else
|
||||
l->l_prev->l_next = NULL;
|
||||
--GL(dl_ns)[l->l_ns]._ns_nloaded;
|
||||
free (l);
|
||||
}
|
||||
free (l);
|
||||
free (realname);
|
||||
|
||||
if (r != NULL)
|
||||
@@ -898,6 +976,9 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
|
||||
never be unloaded. */
|
||||
__close (fd);
|
||||
|
||||
/* Add the map for the mirrored object to the object list. */
|
||||
_dl_add_to_namespace_list (l, nsid);
|
||||
|
||||
return l;
|
||||
}
|
||||
#endif
|
||||
@@ -1492,6 +1573,9 @@ cannot enable executable stack as shared object requires");
|
||||
add_name_to_object (l, ((const char *) D_PTR (l, l_info[DT_STRTAB])
|
||||
+ l->l_info[DT_SONAME]->d_un.d_val));
|
||||
|
||||
/* Now that the object is fully initialized add it to the object list. */
|
||||
_dl_add_to_namespace_list (l, nsid);
|
||||
|
||||
#ifdef SHARED
|
||||
/* Auditing checkpoint: we have a new object. */
|
||||
if (__builtin_expect (GLRO(dl_naudit) > 0, 0)
|
||||
@@ -1802,7 +1886,7 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
|
||||
if MAY_FREE_DIRS is true. */
|
||||
|
||||
static int
|
||||
open_path (const char *name, size_t namelen, int preloaded,
|
||||
open_path (const char *name, size_t namelen, int secure,
|
||||
struct r_search_path_struct *sps, char **realname,
|
||||
struct filebuf *fbp, struct link_map *loader, int whatcode,
|
||||
bool *found_other_class)
|
||||
@@ -1884,7 +1968,7 @@ open_path (const char *name, size_t namelen, int preloaded,
|
||||
/* Remember whether we found any existing directory. */
|
||||
here_any |= this_dir->status[cnt] != nonexisting;
|
||||
|
||||
if (fd != -1 && __builtin_expect (preloaded, 0)
|
||||
if (fd != -1 && __builtin_expect (secure, 0)
|
||||
&& INTUSE(__libc_enable_secure))
|
||||
{
|
||||
/* This is an extra security effort to make sure nobody can
|
||||
@@ -1953,7 +2037,7 @@ open_path (const char *name, size_t namelen, int preloaded,
|
||||
|
||||
struct link_map *
|
||||
internal_function
|
||||
_dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
||||
_dl_map_object (struct link_map *loader, const char *name,
|
||||
int type, int trace_mode, int mode, Lmid_t nsid)
|
||||
{
|
||||
int fd;
|
||||
@@ -2057,7 +2141,8 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
||||
for (l = loader; l; l = l->l_loader)
|
||||
if (cache_rpath (l, &l->l_rpath_dirs, DT_RPATH, "RPATH"))
|
||||
{
|
||||
fd = open_path (name, namelen, preloaded, &l->l_rpath_dirs,
|
||||
fd = open_path (name, namelen, mode & __RTLD_SECURE,
|
||||
&l->l_rpath_dirs,
|
||||
&realname, &fb, loader, LA_SER_RUNPATH,
|
||||
&found_other_class);
|
||||
if (fd != -1)
|
||||
@@ -2072,14 +2157,15 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
||||
&& main_map != NULL && main_map->l_type != lt_loaded
|
||||
&& cache_rpath (main_map, &main_map->l_rpath_dirs, DT_RPATH,
|
||||
"RPATH"))
|
||||
fd = open_path (name, namelen, preloaded, &main_map->l_rpath_dirs,
|
||||
fd = open_path (name, namelen, mode & __RTLD_SECURE,
|
||||
&main_map->l_rpath_dirs,
|
||||
&realname, &fb, loader ?: main_map, LA_SER_RUNPATH,
|
||||
&found_other_class);
|
||||
}
|
||||
|
||||
/* Try the LD_LIBRARY_PATH environment variable. */
|
||||
if (fd == -1 && env_path_list.dirs != (void *) -1)
|
||||
fd = open_path (name, namelen, preloaded, &env_path_list,
|
||||
fd = open_path (name, namelen, mode & __RTLD_SECURE, &env_path_list,
|
||||
&realname, &fb,
|
||||
loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded,
|
||||
LA_SER_LIBPATH, &found_other_class);
|
||||
@@ -2088,12 +2174,12 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
||||
if (fd == -1 && loader != NULL
|
||||
&& cache_rpath (loader, &loader->l_runpath_dirs,
|
||||
DT_RUNPATH, "RUNPATH"))
|
||||
fd = open_path (name, namelen, preloaded,
|
||||
fd = open_path (name, namelen, mode & __RTLD_SECURE,
|
||||
&loader->l_runpath_dirs, &realname, &fb, loader,
|
||||
LA_SER_RUNPATH, &found_other_class);
|
||||
|
||||
if (fd == -1
|
||||
&& (__builtin_expect (! preloaded, 1)
|
||||
&& (__builtin_expect (! (mode & __RTLD_SECURE), 1)
|
||||
|| ! INTUSE(__libc_enable_secure)))
|
||||
{
|
||||
/* Check the list of libraries in the file /etc/ld.so.cache,
|
||||
@@ -2104,7 +2190,9 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
||||
{
|
||||
#ifdef SHARED
|
||||
// XXX Correct to unconditionally default to namespace 0?
|
||||
l = loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded;
|
||||
l = (loader
|
||||
?: GL(dl_ns)[LM_ID_BASE]._ns_loaded
|
||||
?: &GL(dl_rtld_map));
|
||||
#else
|
||||
l = loader;
|
||||
#endif
|
||||
@@ -2159,7 +2247,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
||||
&& ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
|
||||
|| __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1))
|
||||
&& rtld_search_dirs.dirs != (void *) -1)
|
||||
fd = open_path (name, namelen, preloaded, &rtld_search_dirs,
|
||||
fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs,
|
||||
&realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
|
||||
|
||||
/* Add another newline when we are tracing the library loading. */
|
||||
@@ -2170,7 +2258,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
||||
{
|
||||
/* The path may contain dynamic string tokens. */
|
||||
realname = (loader
|
||||
? expand_dynamic_string_token (loader, name)
|
||||
? expand_dynamic_string_token (loader, name, 0)
|
||||
: local_strdup (name));
|
||||
if (realname == NULL)
|
||||
fd = -1;
|
||||
@@ -2204,7 +2292,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
||||
have. */
|
||||
static const Elf_Symndx dummy_bucket = STN_UNDEF;
|
||||
|
||||
/* Enter the new object in the list of loaded objects. */
|
||||
/* Allocate a new object map. */
|
||||
if ((name_copy = local_strdup (name)) == NULL
|
||||
|| (l = _dl_new_object (name_copy, name, type, loader,
|
||||
mode, nsid)) == NULL)
|
||||
@@ -2222,6 +2310,9 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
||||
l->l_nbuckets = 1;
|
||||
l->l_relocated = 1;
|
||||
|
||||
/* Enter the object in the object list. */
|
||||
_dl_add_to_namespace_list (l, nsid);
|
||||
|
||||
return l;
|
||||
}
|
||||
else if (found_other_class)
|
||||
|
||||
+38
-33
@@ -1,5 +1,5 @@
|
||||
/* Look up a symbol in the loaded objects.
|
||||
Copyright (C) 1995-2005, 2006, 2007, 2009 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2007, 2009, 2011 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
|
||||
@@ -312,39 +312,21 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
|
||||
definition we have to use it. */
|
||||
void enter (struct unique_sym *table, size_t size,
|
||||
unsigned int hash, const char *name,
|
||||
const ElfW(Sym) *sym, struct link_map *map)
|
||||
const ElfW(Sym) *sym, const struct link_map *map)
|
||||
{
|
||||
size_t idx = hash % size;
|
||||
size_t hash2 = 1 + hash % (size - 2);
|
||||
while (1)
|
||||
while (table[idx].name != NULL)
|
||||
{
|
||||
if (table[idx].name == NULL)
|
||||
{
|
||||
table[idx].hashval = hash;
|
||||
table[idx].name = name;
|
||||
if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
|
||||
{
|
||||
table[idx].sym = ref;
|
||||
table[idx].map = undef_map;
|
||||
}
|
||||
else
|
||||
{
|
||||
table[idx].sym = sym;
|
||||
table[idx].map = map;
|
||||
|
||||
if (map->l_type == lt_loaded)
|
||||
/* Make sure we don't unload this object by
|
||||
setting the appropriate flag. */
|
||||
map->l_flags_1 |= DF_1_NODELETE;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
idx += hash2;
|
||||
if (idx >= size)
|
||||
idx -= size;
|
||||
}
|
||||
|
||||
table[idx].hashval = hash;
|
||||
table[idx].name = name;
|
||||
table[idx].sym = sym;
|
||||
table[idx].map = map;
|
||||
}
|
||||
|
||||
struct unique_sym_table *tab
|
||||
@@ -363,8 +345,19 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
|
||||
if (entries[idx].hashval == new_hash
|
||||
&& strcmp (entries[idx].name, undef_name) == 0)
|
||||
{
|
||||
result->s = entries[idx].sym;
|
||||
result->m = (struct link_map *) entries[idx].map;
|
||||
if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
|
||||
{
|
||||
/* We possibly have to initialize the central
|
||||
copy from the copy addressed through the
|
||||
relocation. */
|
||||
result->s = sym;
|
||||
result->m = (struct link_map *) map;
|
||||
}
|
||||
else
|
||||
{
|
||||
result->s = entries[idx].sym;
|
||||
result->m = (struct link_map *) entries[idx].map;
|
||||
}
|
||||
__rtld_lock_unlock_recursive (tab->lock);
|
||||
return 1;
|
||||
}
|
||||
@@ -425,8 +418,19 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
|
||||
tab->free = free;
|
||||
}
|
||||
|
||||
enter (entries, size, new_hash, strtab + sym->st_name, sym,
|
||||
(struct link_map *) map);
|
||||
if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
|
||||
enter (entries, size, new_hash, strtab + sym->st_name, ref,
|
||||
undef_map);
|
||||
else
|
||||
{
|
||||
enter (entries, size, new_hash, strtab + sym->st_name, sym,
|
||||
map);
|
||||
|
||||
if (map->l_type == lt_loaded)
|
||||
/* Make sure we don't unload this object by
|
||||
setting the appropriate flag. */
|
||||
((struct link_map *) map)->l_flags_1 |= DF_1_NODELETE;
|
||||
}
|
||||
++tab->n_elements;
|
||||
|
||||
__rtld_lock_unlock_recursive (tab->lock);
|
||||
@@ -777,7 +781,7 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
|
||||
if (__builtin_expect (protected != 0, 0))
|
||||
{
|
||||
/* It is very tricky. We need to figure out what value to
|
||||
return for the protected symbol. */
|
||||
return for the protected symbol. */
|
||||
if (type_class == ELF_RTYPE_CLASS_PLT)
|
||||
{
|
||||
if (current_value.s != NULL && current_value.m != undef_map)
|
||||
@@ -822,7 +826,8 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
|
||||
version, type_class, flags, skip_map);
|
||||
|
||||
/* The object is used. */
|
||||
current_value.m->l_used = 1;
|
||||
if (__builtin_expect (current_value.m->l_used == 0, 0))
|
||||
current_value.m->l_used = 1;
|
||||
|
||||
if (__builtin_expect (GLRO(dl_debug_mask)
|
||||
& (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0))
|
||||
@@ -844,7 +849,7 @@ _dl_setup_hash (struct link_map *map)
|
||||
Elf_Symndx nchain;
|
||||
|
||||
if (__builtin_expect (map->l_info[DT_ADDRTAGIDX (DT_GNU_HASH) + DT_NUM
|
||||
+ DT_THISPROCNUM + DT_VERSIONTAGNUM
|
||||
+ DT_THISPROCNUM + DT_VERSIONTAGNUM
|
||||
+ DT_EXTRANUM + DT_VALNUM] != NULL, 1))
|
||||
{
|
||||
Elf32_Word *hash32
|
||||
|
||||
+31
-21
@@ -1,5 +1,5 @@
|
||||
/* Storage management for the chain of loaded shared objects.
|
||||
Copyright (C) 1995-2002,2004,2006,2007,2008 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2002,2004,2006-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
|
||||
@@ -26,16 +26,36 @@
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
/* Add the new link_map NEW to the end of the namespace list. */
|
||||
void
|
||||
internal_function
|
||||
_dl_add_to_namespace_list (struct link_map *new, Lmid_t nsid)
|
||||
{
|
||||
if (GL(dl_ns)[nsid]._ns_loaded != NULL)
|
||||
{
|
||||
struct link_map *l = GL(dl_ns)[nsid]._ns_loaded;
|
||||
while (l->l_next != NULL)
|
||||
l = l->l_next;
|
||||
new->l_prev = l;
|
||||
/* new->l_next = NULL; Would be necessary but we use calloc. */
|
||||
l->l_next = new;
|
||||
}
|
||||
else
|
||||
GL(dl_ns)[nsid]._ns_loaded = new;
|
||||
++GL(dl_ns)[nsid]._ns_nloaded;
|
||||
new->l_serial = GL(dl_load_adds);
|
||||
++GL(dl_load_adds);
|
||||
}
|
||||
|
||||
|
||||
/* Allocate a `struct link_map' for a new object being loaded,
|
||||
and enter it into the _dl_loaded list. */
|
||||
|
||||
struct link_map *
|
||||
internal_function
|
||||
_dl_new_object (char *realname, const char *libname, int type,
|
||||
struct link_map *loader, int mode, Lmid_t nsid)
|
||||
{
|
||||
struct link_map *l;
|
||||
int idx;
|
||||
size_t libname_len = strlen (libname) + 1;
|
||||
struct link_map *new;
|
||||
struct libname_list *newname;
|
||||
@@ -67,6 +87,10 @@ _dl_new_object (char *realname, const char *libname, int type,
|
||||
|
||||
new->l_name = realname;
|
||||
new->l_type = type;
|
||||
/* If we set the bit now since we know it is never used we avoid
|
||||
dirtying the cache line later. */
|
||||
if ((GLRO(dl_debug_mask) & DL_DEBUG_UNUSED) == 0)
|
||||
new->l_used = 1;
|
||||
new->l_loader = loader;
|
||||
#if NO_TLS_OFFSET != 0
|
||||
new->l_tls_offset = NO_TLS_OFFSET;
|
||||
@@ -90,25 +114,11 @@ _dl_new_object (char *realname, const char *libname, int type,
|
||||
new->l_scope_max = sizeof (new->l_scope_mem) / sizeof (new->l_scope_mem[0]);
|
||||
|
||||
/* Counter for the scopes we have to handle. */
|
||||
idx = 0;
|
||||
int idx = 0;
|
||||
|
||||
if (GL(dl_ns)[nsid]._ns_loaded != NULL)
|
||||
{
|
||||
l = GL(dl_ns)[nsid]._ns_loaded;
|
||||
while (l->l_next != NULL)
|
||||
l = l->l_next;
|
||||
new->l_prev = l;
|
||||
/* new->l_next = NULL; Would be necessary but we use calloc. */
|
||||
l->l_next = new;
|
||||
|
||||
/* Add the global scope. */
|
||||
new->l_scope[idx++] = &GL(dl_ns)[nsid]._ns_loaded->l_searchlist;
|
||||
}
|
||||
else
|
||||
GL(dl_ns)[nsid]._ns_loaded = new;
|
||||
++GL(dl_ns)[nsid]._ns_nloaded;
|
||||
new->l_serial = GL(dl_load_adds);
|
||||
++GL(dl_load_adds);
|
||||
/* Add the global scope. */
|
||||
new->l_scope[idx++] = &GL(dl_ns)[nsid]._ns_loaded->l_searchlist;
|
||||
|
||||
/* If we have no loader the new object acts as it. */
|
||||
if (loader == NULL)
|
||||
@@ -174,7 +184,7 @@ _dl_new_object (char *realname, const char *libname, int type,
|
||||
if (result == NULL)
|
||||
{
|
||||
/* We were not able to determine the current directory.
|
||||
Note that free(origin) is OK if origin == NULL. */
|
||||
Note that free(origin) is OK if origin == NULL. */
|
||||
free (origin);
|
||||
origin = (char *) -1;
|
||||
goto out;
|
||||
|
||||
+1
-30
@@ -220,38 +220,9 @@ dl_open_worker (void *a)
|
||||
|
||||
assert (_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT);
|
||||
|
||||
/* Maybe we have to expand a DST. */
|
||||
if (__builtin_expect (dst != NULL, 0))
|
||||
{
|
||||
size_t len = strlen (file);
|
||||
|
||||
/* Determine how much space we need. We have to allocate the
|
||||
memory locally. */
|
||||
size_t required = DL_DST_REQUIRED (call_map, file, len,
|
||||
_dl_dst_count (dst, 0));
|
||||
|
||||
/* Get space for the new file name. */
|
||||
char *new_file = (char *) alloca (required + 1);
|
||||
|
||||
/* Generate the new file name. */
|
||||
_dl_dst_substitute (call_map, file, new_file, 0);
|
||||
|
||||
/* If the substitution failed don't try to load. */
|
||||
if (*new_file == '\0')
|
||||
_dl_signal_error (0, "dlopen", NULL,
|
||||
N_("empty dynamic string token substitution"));
|
||||
|
||||
/* Now we have a new file name. */
|
||||
file = new_file;
|
||||
|
||||
/* It does not matter whether call_map is set even if we
|
||||
computed it only because of the DST. Since the path contains
|
||||
a slash the value is not used. See dl-load.c. */
|
||||
}
|
||||
|
||||
/* Load the named object. */
|
||||
struct link_map *new;
|
||||
args->map = new = _dl_map_object (call_map, file, 0, lt_loaded, 0,
|
||||
args->map = new = _dl_map_object (call_map, file, lt_loaded, 0,
|
||||
mode | __RTLD_CALLMAP, args->nsid);
|
||||
|
||||
/* If the pointer returned is NULL this means the RTLD_NOLOAD flag is
|
||||
|
||||
+5
-1
@@ -1,5 +1,5 @@
|
||||
/* Relocate a shared object and resolve its references to other loaded objects.
|
||||
Copyright (C) 1995-2006, 2008, 2009 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2006, 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
|
||||
@@ -307,6 +307,10 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
|
||||
goto call_error;
|
||||
}
|
||||
|
||||
#ifdef CLEAR_CACHE
|
||||
CLEAR_CACHE (textrels->start, textrels->start + textrels->len);
|
||||
#endif
|
||||
|
||||
textrels = textrels->next;
|
||||
}
|
||||
|
||||
|
||||
+8
-5
@@ -1,5 +1,5 @@
|
||||
/* On-demand PLT fixup for shared objects.
|
||||
Copyright (C) 1995-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2009, 2010, 2011 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
|
||||
@@ -144,7 +144,8 @@ _dl_fixup (
|
||||
/* And now perhaps the relocation addend. */
|
||||
value = elf_machine_plt_value (l, reloc, value);
|
||||
|
||||
if (__builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0))
|
||||
if (sym != NULL
|
||||
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0))
|
||||
value = ((DL_FIXUP_VALUE_TYPE (*) (void)) DL_FIXUP_VALUE_ADDR (value)) ();
|
||||
|
||||
/* Finally, fix up the plt itself. */
|
||||
@@ -231,8 +232,9 @@ _dl_profile_fixup (
|
||||
? LOOKUP_VALUE_ADDRESS (result)
|
||||
+ defsym->st_value : 0);
|
||||
|
||||
if (__builtin_expect (ELFW(ST_TYPE) (defsym->st_info)
|
||||
== STT_GNU_IFUNC, 0))
|
||||
if (defsym != NULL
|
||||
&& __builtin_expect (ELFW(ST_TYPE) (defsym->st_info)
|
||||
== STT_GNU_IFUNC, 0))
|
||||
value = ((DL_FIXUP_VALUE_TYPE (*) (void))
|
||||
DL_FIXUP_VALUE_ADDR (value)) ();
|
||||
}
|
||||
@@ -369,7 +371,7 @@ _dl_profile_fixup (
|
||||
struct audit_ifaces *afct = GLRO(dl_audit);
|
||||
for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt)
|
||||
{
|
||||
if (afct->ARCH_LA_PLTENTER != NULL
|
||||
if (afct->ARCH_LA_PLTENTER != NULL
|
||||
&& (reloc_result->enterexit
|
||||
& (LA_SYMB_NOPLTENTER << (2 * (cnt + 1)))) == 0)
|
||||
{
|
||||
@@ -444,6 +446,7 @@ _dl_call_pltexit (struct link_map *l, ElfW(Word) reloc_arg,
|
||||
|
||||
/* Set up the sym parameter. */
|
||||
ElfW(Sym) sym = *defsym;
|
||||
sym.st_value = DL_FIXUP_VALUE_ADDR (reloc_result->addr);
|
||||
|
||||
/* Get the symbol name. */
|
||||
const char *strtab = (const void *) D_PTR (reloc_result->bound,
|
||||
|
||||
@@ -424,6 +424,11 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
|
||||
{
|
||||
const ElfW(Word) mask = ((const ElfW(Word) *) dsocaps)[-1];
|
||||
GLRO(dl_hwcap) |= (uint64_t) mask << _DL_FIRST_EXTRA;
|
||||
/* Note that we add the dsocaps to the set already chosen by the
|
||||
LD_HWCAP_MASK environment variable (or default HWCAP_IMPORTANT).
|
||||
So there is no way to request ignoring an OS-supplied dsocap
|
||||
string and bit like you can ignore an OS-supplied HWCAP bit. */
|
||||
GLRO(dl_hwcap_mask) |= (uint64_t) mask << _DL_FIRST_EXTRA;
|
||||
size_t len;
|
||||
for (const char *p = dsocaps; p < dsocaps + dsocapslen; p += len + 1)
|
||||
{
|
||||
|
||||
+1
-4
@@ -1,5 +1,5 @@
|
||||
/* Thread-local storage handling in the ELF dynamic linker. Generic version.
|
||||
Copyright (C) 2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2006,2008,2011 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
|
||||
@@ -33,9 +33,6 @@
|
||||
to allow dynamic loading of modules defining IE-model TLS data. */
|
||||
#define TLS_STATIC_SURPLUS 64 + DL_NNS * 100
|
||||
|
||||
/* Value used for dtv entries for which the allocation is delayed. */
|
||||
#define TLS_DTV_UNALLOCATED ((void *) -1l)
|
||||
|
||||
|
||||
/* Out-of-memory handler. */
|
||||
#ifdef SHARED
|
||||
|
||||
+8
-4
@@ -322,10 +322,14 @@ _dl_check_map_versions (struct link_map *map, int verbose, int trace_mode)
|
||||
while (1)
|
||||
{
|
||||
ElfW(Half) ndx = aux->vna_other & 0x7fff;
|
||||
map->l_versions[ndx].hash = aux->vna_hash;
|
||||
map->l_versions[ndx].hidden = aux->vna_other & 0x8000;
|
||||
map->l_versions[ndx].name = &strtab[aux->vna_name];
|
||||
map->l_versions[ndx].filename = &strtab[ent->vn_file];
|
||||
/* In trace mode, dependencies may be missing. */
|
||||
if (__builtin_expect (ndx < map->l_nversions, 1))
|
||||
{
|
||||
map->l_versions[ndx].hash = aux->vna_hash;
|
||||
map->l_versions[ndx].hidden = aux->vna_other & 0x8000;
|
||||
map->l_versions[ndx].name = &strtab[aux->vna_name];
|
||||
map->l_versions[ndx].filename = &strtab[ent->vn_file];
|
||||
}
|
||||
|
||||
if (aux->vna_next == 0)
|
||||
/* No more symbols. */
|
||||
|
||||
+10
-5
@@ -103,6 +103,11 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
|
||||
{
|
||||
ElfW(Dyn) *dyn = l->l_ld;
|
||||
ElfW(Dyn) **info;
|
||||
#if __ELF_NATIVE_CLASS == 32
|
||||
typedef Elf32_Word d_tag_utype;
|
||||
#elif __ELF_NATIVE_CLASS == 64
|
||||
typedef Elf64_Xword d_tag_utype;
|
||||
#endif
|
||||
|
||||
#ifndef RTLD_BOOTSTRAP
|
||||
if (dyn == NULL)
|
||||
@@ -113,20 +118,20 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
|
||||
|
||||
while (dyn->d_tag != DT_NULL)
|
||||
{
|
||||
if (dyn->d_tag < DT_NUM)
|
||||
if ((d_tag_utype) dyn->d_tag < DT_NUM)
|
||||
info[dyn->d_tag] = dyn;
|
||||
else if (dyn->d_tag >= DT_LOPROC &&
|
||||
dyn->d_tag < DT_LOPROC + DT_THISPROCNUM)
|
||||
info[dyn->d_tag - DT_LOPROC + DT_NUM] = dyn;
|
||||
else if ((Elf32_Word) DT_VERSIONTAGIDX (dyn->d_tag) < DT_VERSIONTAGNUM)
|
||||
else if ((d_tag_utype) DT_VERSIONTAGIDX (dyn->d_tag) < DT_VERSIONTAGNUM)
|
||||
info[VERSYMIDX (dyn->d_tag)] = dyn;
|
||||
else if ((Elf32_Word) DT_EXTRATAGIDX (dyn->d_tag) < DT_EXTRANUM)
|
||||
else if ((d_tag_utype) DT_EXTRATAGIDX (dyn->d_tag) < DT_EXTRANUM)
|
||||
info[DT_EXTRATAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
|
||||
+ DT_VERSIONTAGNUM] = dyn;
|
||||
else if ((Elf32_Word) DT_VALTAGIDX (dyn->d_tag) < DT_VALNUM)
|
||||
else if ((d_tag_utype) DT_VALTAGIDX (dyn->d_tag) < DT_VALNUM)
|
||||
info[DT_VALTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
|
||||
+ DT_VERSIONTAGNUM + DT_EXTRANUM] = dyn;
|
||||
else if ((Elf32_Word) DT_ADDRTAGIDX (dyn->d_tag) < DT_ADDRNUM)
|
||||
else if ((d_tag_utype) DT_ADDRTAGIDX (dyn->d_tag) < DT_ADDRNUM)
|
||||
info[DT_ADDRTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
|
||||
+ DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM] = dyn;
|
||||
++dyn;
|
||||
|
||||
+35
-16
@@ -384,14 +384,17 @@ add_dir (const char *line)
|
||||
}
|
||||
|
||||
/* Canonify path: for now only remove leading and trailing
|
||||
whitespace and the trailing slashes slashes. */
|
||||
i = strlen (entry->path) - 1;
|
||||
whitespace and the trailing slashes. */
|
||||
i = strlen (entry->path);
|
||||
|
||||
while (isspace (entry->path[i]) && i > 0)
|
||||
entry->path[i--] = '\0';
|
||||
while (i > 0 && isspace (entry->path[i - 1]))
|
||||
entry->path[--i] = '\0';
|
||||
|
||||
while (entry->path[i] == '/' && i > 0)
|
||||
entry->path[i--] = '\0';
|
||||
while (i > 0 && entry->path[i - 1] == '/')
|
||||
entry->path[--i] = '\0';
|
||||
|
||||
if (i == 0)
|
||||
return;
|
||||
|
||||
char *path = entry->path;
|
||||
if (opt_chroot)
|
||||
@@ -773,7 +776,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);
|
||||
@@ -1174,7 +1188,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
|
||||
@@ -1305,11 +1321,9 @@ main (int argc, char **argv)
|
||||
p ? (*p = '\0', cache_file) : "/");
|
||||
|
||||
if (canon == NULL)
|
||||
{
|
||||
error (EXIT_FAILURE, errno,
|
||||
_("Can't open cache file directory %s\n"),
|
||||
p ? cache_file : "/");
|
||||
}
|
||||
error (EXIT_FAILURE, errno,
|
||||
_("Can't open cache file directory %s\n"),
|
||||
p ? cache_file : "/");
|
||||
|
||||
if (p)
|
||||
++p;
|
||||
@@ -1346,8 +1360,12 @@ main (int argc, char **argv)
|
||||
add_system_dir (LIBDIR);
|
||||
}
|
||||
|
||||
if (! opt_ignore_aux_cache)
|
||||
load_aux_cache (_PATH_LDCONFIG_AUX_CACHE);
|
||||
const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
|
||||
if (opt_chroot)
|
||||
aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
|
||||
|
||||
if (! opt_ignore_aux_cache && aux_cache_file)
|
||||
load_aux_cache (aux_cache_file);
|
||||
else
|
||||
init_aux_cache ();
|
||||
|
||||
@@ -1356,7 +1374,8 @@ main (int argc, char **argv)
|
||||
if (opt_build_cache)
|
||||
{
|
||||
save_cache (cache_file);
|
||||
save_aux_cache (_PATH_LDCONFIG_AUX_CACHE);
|
||||
if (aux_cache_file)
|
||||
save_aux_cache (aux_cache_file);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
+11
-2
@@ -1,6 +1,6 @@
|
||||
# Subroutine makefile for compiling libc modules linked into dynamic linker.
|
||||
|
||||
# Copyright (C) 2002, 2003, 2005, 2006, 2008 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002,2003,2005,2006,2008,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
|
||||
@@ -56,7 +56,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\
|
||||
# Use the verbose option of ar and tar when not running silently.
|
||||
ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s
|
||||
verbose := v
|
||||
else # -s
|
||||
else # -s
|
||||
verbose :=
|
||||
endif # not -s
|
||||
|
||||
@@ -93,6 +93,12 @@ else
|
||||
# These are the basic compilation rules corresponding to the Makerules ones.
|
||||
# The sysd-rules generated makefile already defines pattern rules for rtld-%
|
||||
# targets built from sysdeps source files.
|
||||
$(objpfx)rtld-%.os: rtld-%.S $(before-compile)
|
||||
$(compile-command.S) $(rtld-CPPFLAGS)
|
||||
$(objpfx)rtld-%.os: rtld-%.s $(before-compile)
|
||||
$(compile-command.s) $(rtld-CPPFLAGS)
|
||||
$(objpfx)rtld-%.os: rtld-%.c $(before-compile)
|
||||
$(compile-command.c) $(rtld-CPPFLAGS)
|
||||
$(objpfx)rtld-%.os: %.S $(before-compile)
|
||||
$(compile-command.S) $(rtld-CPPFLAGS)
|
||||
$(objpfx)rtld-%.os: %.s $(before-compile)
|
||||
@@ -101,6 +107,9 @@ $(objpfx)rtld-%.os: %.c $(before-compile)
|
||||
$(compile-command.c) $(rtld-CPPFLAGS)
|
||||
|
||||
# The rules for generated source files.
|
||||
$(objpfx)rtld-%.os: $(objpfx)rtld-%.S $(before-compile); $(compile-command.S)
|
||||
$(objpfx)rtld-%.os: $(objpfx)rtld-%.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)rtld-%.os: $(objpfx)rtld-%.c $(before-compile); $(compile-command.c)
|
||||
$(objpfx)rtld-%.os: $(objpfx)%.S $(before-compile); $(compile-command.S)
|
||||
$(objpfx)rtld-%.os: $(objpfx)%.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)rtld-%.os: $(objpfx)%.c $(before-compile); $(compile-command.c)
|
||||
|
||||
+16
-11
@@ -588,7 +588,6 @@ struct map_args
|
||||
/* Argument to map_doit. */
|
||||
char *str;
|
||||
struct link_map *loader;
|
||||
int is_preloaded;
|
||||
int mode;
|
||||
/* Return value of map_doit. */
|
||||
struct link_map *map;
|
||||
@@ -626,16 +625,17 @@ static void
|
||||
map_doit (void *a)
|
||||
{
|
||||
struct map_args *args = (struct map_args *) a;
|
||||
args->map = _dl_map_object (args->loader, args->str,
|
||||
args->is_preloaded, lt_library, 0, args->mode,
|
||||
LM_ID_BASE);
|
||||
args->map = _dl_map_object (args->loader, args->str, lt_library, 0,
|
||||
args->mode, LM_ID_BASE);
|
||||
}
|
||||
|
||||
static void
|
||||
dlmopen_doit (void *a)
|
||||
{
|
||||
struct dlmopen_args *args = (struct dlmopen_args *) a;
|
||||
args->map = _dl_open (args->fname, RTLD_LAZY | __RTLD_DLOPEN | __RTLD_AUDIT,
|
||||
args->map = _dl_open (args->fname,
|
||||
(RTLD_LAZY | __RTLD_DLOPEN | __RTLD_AUDIT
|
||||
| __RTLD_SECURE),
|
||||
dl_main, LM_ID_NEWLM, _dl_argc, INTUSE(_dl_argv),
|
||||
__environ);
|
||||
}
|
||||
@@ -805,8 +805,7 @@ do_preload (char *fname, struct link_map *main_map, const char *where)
|
||||
|
||||
args.str = fname;
|
||||
args.loader = main_map;
|
||||
args.is_preloaded = 1;
|
||||
args.mode = 0;
|
||||
args.mode = __RTLD_SECURE;
|
||||
|
||||
unsigned int old_nloaded = GL(dl_ns)[LM_ID_BASE]._ns_nloaded;
|
||||
|
||||
@@ -1052,7 +1051,6 @@ of this helper program; chances are you did not intend to run this program.\n\
|
||||
|
||||
args.str = rtld_progname;
|
||||
args.loader = NULL;
|
||||
args.is_preloaded = 0;
|
||||
args.mode = __RTLD_OPENEXEC;
|
||||
(void) _dl_catch_error (&objname, &err_str, &malloced, map_doit,
|
||||
&args);
|
||||
@@ -1064,7 +1062,7 @@ of this helper program; chances are you did not intend to run this program.\n\
|
||||
else
|
||||
{
|
||||
HP_TIMING_NOW (start);
|
||||
_dl_map_object (NULL, rtld_progname, 0, lt_library, 0,
|
||||
_dl_map_object (NULL, rtld_progname, lt_library, 0,
|
||||
__RTLD_OPENEXEC, LM_ID_BASE);
|
||||
HP_TIMING_NOW (stop);
|
||||
|
||||
@@ -1090,11 +1088,15 @@ of this helper program; chances are you did not intend to run this program.\n\
|
||||
main_map = _dl_new_object ((char *) "", "", lt_executable, NULL,
|
||||
__RTLD_OPENEXEC, LM_ID_BASE);
|
||||
assert (main_map != NULL);
|
||||
assert (main_map == GL(dl_ns)[LM_ID_BASE]._ns_loaded);
|
||||
main_map->l_phdr = phdr;
|
||||
main_map->l_phnum = phnum;
|
||||
main_map->l_entry = *user_entry;
|
||||
|
||||
/* Even though the link map is not yet fully initialized we can add
|
||||
it to the map list since there are no possible users running yet. */
|
||||
_dl_add_to_namespace_list (main_map, LM_ID_BASE);
|
||||
assert (main_map == GL(dl_ns)[LM_ID_BASE]._ns_loaded);
|
||||
|
||||
/* At this point we are in a bit of trouble. We would have to
|
||||
fill in the values for l_dev and l_ino. But in general we
|
||||
do not know where the file is. We also do not handle AT_EXECFD
|
||||
@@ -1237,7 +1239,7 @@ of this helper program; chances are you did not intend to run this program.\n\
|
||||
/* We were invoked directly, so the program might not have a
|
||||
PT_INTERP. */
|
||||
_dl_rtld_libname.name = GL(dl_rtld_map).l_name;
|
||||
/* _dl_rtld_libname.next = NULL; Already zero. */
|
||||
/* _dl_rtld_libname.next = NULL; Already zero. */
|
||||
GL(dl_rtld_map).l_libname = &_dl_rtld_libname;
|
||||
}
|
||||
else
|
||||
@@ -1362,6 +1364,9 @@ of this helper program; chances are you did not intend to run this program.\n\
|
||||
l->l_libname->name = memcpy (copy, dsoname, len);
|
||||
}
|
||||
|
||||
/* Add the vDSO to the object list. */
|
||||
_dl_add_to_namespace_list (l, LM_ID_BASE);
|
||||
|
||||
/* Rearrange the list so this DSO appears after rtld_map. */
|
||||
assert (l->l_next == NULL);
|
||||
assert (l->l_prev == main_map);
|
||||
|
||||
+3
-2
@@ -254,8 +254,9 @@ extern int _hurd_select (int nfds, struct pollfd *pollfds,
|
||||
const sigset_t *sigmask);
|
||||
|
||||
/* Variant of file_name_lookup used in *at function implementations.
|
||||
AT_FLAGS should contain only AT_SYMLINK_NOFOLLOW; other bits
|
||||
cause EINVAL. */
|
||||
AT_FLAGS may only contain AT_SYMLINK_FOLLOW or AT_SYMLINK_NOFOLLOW,
|
||||
which will remove and add O_NOLINK from FLAGS respectively.
|
||||
Other bits cause EINVAL. */
|
||||
extern file_t __file_name_lookup_at (int fd, int at_flags,
|
||||
const char *file_name,
|
||||
int flags, mode_t mode);
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ _hurd_select (int nfds,
|
||||
int firstfd, lastfd;
|
||||
mach_msg_timeout_t to = (timeout != NULL ?
|
||||
(timeout->tv_sec * 1000 +
|
||||
timeout->tv_nsec / 1000000) :
|
||||
(timeout->tv_nsec + 999999) / 1000000) :
|
||||
0);
|
||||
struct
|
||||
{
|
||||
|
||||
+8
-2
@@ -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
|
||||
@@ -30,10 +30,16 @@ __file_name_lookup_at (int fd, int at_flags,
|
||||
error_t err;
|
||||
file_t result;
|
||||
|
||||
if ((at_flags & AT_SYMLINK_FOLLOW) && (at_flags & AT_SYMLINK_NOFOLLOW))
|
||||
return (__hurd_fail (EINVAL), MACH_PORT_NULL);
|
||||
|
||||
flags |= (at_flags & AT_SYMLINK_NOFOLLOW) ? O_NOLINK : 0;
|
||||
at_flags &= ~AT_SYMLINK_NOFOLLOW;
|
||||
if (at_flags & AT_SYMLINK_FOLLOW)
|
||||
flags &= ~O_NOLINK;
|
||||
at_flags &= ~AT_SYMLINK_FOLLOW;
|
||||
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);
|
||||
|
||||
+1
-1
@@ -442,7 +442,7 @@ write_output (const char *outbuf, const char *outptr, FILE **output,
|
||||
if (output_file != NULL && strcmp (output_file, "-") != 0)
|
||||
{
|
||||
*output = fopen (output_file, "w");
|
||||
if (output == NULL)
|
||||
if (*output == NULL)
|
||||
error (EXIT_FAILURE, errno, _("cannot open output file"));
|
||||
}
|
||||
else
|
||||
|
||||
+4
-1
@@ -1,5 +1,5 @@
|
||||
/* Conversion loop frame work.
|
||||
Copyright (C) 1998-2002, 2003, 2005, 2008 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-2003, 2005, 2008, 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
||||
|
||||
@@ -399,6 +399,9 @@ SINGLE(LOOPFCT) (struct __gconv_step *step,
|
||||
{
|
||||
*inptrp = inend;
|
||||
#ifdef STORE_REST
|
||||
while (inptr < inend)
|
||||
bytebuf[inlen++] = *inptr++;
|
||||
|
||||
inptr = bytebuf;
|
||||
inptrp = &inptr;
|
||||
inend = &bytebuf[inlen];
|
||||
|
||||
@@ -14,6 +14,7 @@ extern void *__alloca (size_t __size);
|
||||
|
||||
extern int __libc_use_alloca (size_t size) __attribute__ ((const));
|
||||
extern int __libc_alloca_cutoff (size_t size) __attribute__ ((const));
|
||||
libc_hidden_proto (__libc_alloca_cutoff)
|
||||
|
||||
#define __MAX_ALLOCA_CUTOFF 65536
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
the multi-thread case. The interfaces have the prefix
|
||||
"catomic_".
|
||||
|
||||
- support functions like barriers. They also have the preifx
|
||||
- support functions like barriers. They also have the prefix
|
||||
"atomic_".
|
||||
|
||||
Architectures must provide a few lowlevel macros (the compare
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#define __RTLD_OPENEXEC 0x20000000
|
||||
#define __RTLD_CALLMAP 0x10000000
|
||||
#define __RTLD_AUDIT 0x08000000
|
||||
#define __RTLD_SECURE 0x04000000 /* Apply additional security checks. */
|
||||
|
||||
#define __LM_ID_CALLER -2
|
||||
|
||||
|
||||
+5
-3
@@ -1,6 +1,6 @@
|
||||
/* Data structure for communication from the run-time dynamic linker for
|
||||
loaded ELF shared objects.
|
||||
Copyright (C) 1995-2006, 2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2006, 2007, 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
|
||||
@@ -180,7 +180,6 @@ struct link_map
|
||||
unsigned int l_need_tls_init:1; /* Nonzero if GL(dl_init_static_tls)
|
||||
should be called on this link map
|
||||
when relocation finishes. */
|
||||
unsigned int l_used:1; /* Nonzero if the DSO is used. */
|
||||
unsigned int l_auditing:1; /* Nonzero if the DSO is used in auditing. */
|
||||
unsigned int l_audit_any_plt:1; /* Nonzero if at least one audit module
|
||||
is interested in the PLT interception.*/
|
||||
@@ -239,12 +238,15 @@ struct link_map
|
||||
struct link_map **l_initfini;
|
||||
|
||||
/* List of the dependencies introduced through symbol binding. */
|
||||
unsigned int l_reldepsmax;
|
||||
struct link_map_reldeps
|
||||
{
|
||||
unsigned int act;
|
||||
struct link_map *list[];
|
||||
} *l_reldeps;
|
||||
unsigned int l_reldepsmax;
|
||||
|
||||
/* Nonzero if the DSO is used. */
|
||||
unsigned int l_used;
|
||||
|
||||
/* Various flag words. */
|
||||
ElfW(Word) l_feature_1;
|
||||
|
||||
+2
-2
@@ -159,7 +159,7 @@ nrl_domainname (void)
|
||||
int
|
||||
getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
|
||||
socklen_t hostlen, char *serv, socklen_t servlen,
|
||||
unsigned int flags)
|
||||
int flags)
|
||||
{
|
||||
int serrno = errno;
|
||||
int tmpbuflen = 1024;
|
||||
@@ -385,7 +385,7 @@ getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
|
||||
break;
|
||||
|
||||
default:
|
||||
return EAI_FAMILY;
|
||||
return EAI_FAMILY;
|
||||
}
|
||||
|
||||
if (serv && (servlen > 0))
|
||||
|
||||
+3
-1
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006,2007, 2009
|
||||
/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006,2007,2009,2010,2011
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
@@ -64,6 +64,8 @@ __BEGIN_DECLS
|
||||
# define AT_REMOVEDIR 0x200 /* Remove directory instead of
|
||||
unlinking file. */
|
||||
# define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
|
||||
# define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount
|
||||
traversal. */
|
||||
# define AT_EACCESS 0x200 /* Test access permitted for
|
||||
effective IDs, not real IDs. */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* File tree walker functions.
|
||||
Copyright (C) 1996-2004, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2004, 2006-2008, 2010 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
|
||||
@@ -790,6 +790,7 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
|
||||
{
|
||||
int save_err = errno;
|
||||
__fchdir (cwdfd);
|
||||
close_not_cancel_no_status (cwdfd);
|
||||
__set_errno (save_err);
|
||||
}
|
||||
else if (cwd != NULL)
|
||||
|
||||
+15
-15
@@ -290,7 +290,7 @@ _IO_new_file_fopen (fp, filename, mode, is32not64)
|
||||
#ifdef _LIBC
|
||||
last_recognized = mode;
|
||||
#endif
|
||||
for (i = 1; i < 6; ++i)
|
||||
for (i = 1; i < 7; ++i)
|
||||
{
|
||||
switch (*++mode)
|
||||
{
|
||||
@@ -997,18 +997,18 @@ _IO_new_file_seekoff (fp, offset, dir, mode)
|
||||
/* Adjust for read-ahead (bytes is buffer). */
|
||||
offset -= fp->_IO_read_end - fp->_IO_read_ptr;
|
||||
if (fp->_offset == _IO_pos_BAD)
|
||||
{
|
||||
if (mode != 0)
|
||||
goto dumb;
|
||||
else
|
||||
{
|
||||
result = _IO_SYSSEEK (fp, 0, dir);
|
||||
if (result == EOF)
|
||||
return result;
|
||||
{
|
||||
if (mode != 0)
|
||||
goto dumb;
|
||||
else
|
||||
{
|
||||
result = _IO_SYSSEEK (fp, 0, dir);
|
||||
if (result == EOF)
|
||||
return result;
|
||||
|
||||
fp->_offset = result;
|
||||
}
|
||||
}
|
||||
fp->_offset = result;
|
||||
}
|
||||
}
|
||||
/* Make offset absolute, assuming current pointer is file_ptr(). */
|
||||
offset += fp->_offset;
|
||||
if (offset < 0)
|
||||
@@ -1270,7 +1270,7 @@ _IO_new_file_write (f, data, n)
|
||||
{
|
||||
f->_flags |= _IO_ERR_SEEN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
to_do -= count;
|
||||
data = (void *) ((char *) data + count);
|
||||
}
|
||||
@@ -1358,12 +1358,12 @@ _IO_new_file_xsputn (f, data, n)
|
||||
do_write = to_do - (block_size >= 128 ? to_do % block_size : 0);
|
||||
|
||||
if (do_write)
|
||||
{
|
||||
{
|
||||
count = new_do_write (f, s, do_write);
|
||||
to_do -= count;
|
||||
if (count < do_write)
|
||||
return n - to_do;
|
||||
}
|
||||
}
|
||||
|
||||
/* Now write out the remainder. Normally, this will fit in the
|
||||
buffer, but it's somewhat messier for line-buffered files,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/* Fmemopen implementation.
|
||||
Copyright (C) 2000, 2002, 2005, 2006, 2008, 2009
|
||||
Copyright (C) 2000, 2002, 2005, 2006, 2008, 2009, 2011
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Hanno Mueller, kontakt@hanno.de, 2000.
|
||||
@@ -243,7 +243,7 @@ fmemopen (void *buf, size_t len, const char *mode)
|
||||
if (mode[0] == 'w')
|
||||
c->buffer[0] = '\0';
|
||||
|
||||
c->maxpos = strlen (c->buffer);
|
||||
c->maxpos = strnlen (c->buffer, len);
|
||||
|
||||
if (mode[0] == 'a')
|
||||
c->pos = c->maxpos;
|
||||
|
||||
+4
-1
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1995, 1997-2000, 2001, 2002, 2003, 2006
|
||||
/* Copyright (C) 1995, 1997-2000, 2001, 2002, 2003, 2006, 2010
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
@@ -60,6 +60,9 @@ _IO_vdprintf (d, format, arg)
|
||||
|
||||
done = INTUSE(_IO_vfprintf) (&tmpfil.file, format, arg);
|
||||
|
||||
if (done != EOF && _IO_do_flush (&tmpfil.file) == EOF)
|
||||
done = EOF;
|
||||
|
||||
_IO_FINISH (&tmpfil.file);
|
||||
|
||||
return done;
|
||||
|
||||
+8
-6
@@ -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>.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
+8
-8
@@ -427,9 +427,9 @@ extern int __REDIRECT (fscanf, (FILE *__restrict __stream,
|
||||
__isoc99_fscanf) __wur;
|
||||
extern int __REDIRECT (scanf, (__const char *__restrict __format, ...),
|
||||
__isoc99_scanf) __wur;
|
||||
extern int __REDIRECT (sscanf, (__const char *__restrict __s,
|
||||
__const char *__restrict __format, ...),
|
||||
__isoc99_sscanf) __THROW;
|
||||
extern int __REDIRECT_NTH (sscanf, (__const char *__restrict __s,
|
||||
__const char *__restrict __format, ...),
|
||||
__isoc99_sscanf);
|
||||
# else
|
||||
extern int __isoc99_fscanf (FILE *__restrict __stream,
|
||||
__const char *__restrict __format, ...) __wur;
|
||||
@@ -481,11 +481,11 @@ extern int __REDIRECT (vfscanf,
|
||||
extern int __REDIRECT (vscanf, (__const char *__restrict __format,
|
||||
_G_va_list __arg), __isoc99_vscanf)
|
||||
__attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
|
||||
extern int __REDIRECT (vsscanf,
|
||||
(__const char *__restrict __s,
|
||||
__const char *__restrict __format, _G_va_list __arg),
|
||||
__isoc99_vsscanf)
|
||||
__THROW __attribute__ ((__format__ (__scanf__, 2, 0)));
|
||||
extern int __REDIRECT_NTH (vsscanf,
|
||||
(__const char *__restrict __s,
|
||||
__const char *__restrict __format,
|
||||
_G_va_list __arg), __isoc99_vsscanf)
|
||||
__attribute__ ((__format__ (__scanf__, 2, 0)));
|
||||
# else
|
||||
extern int __isoc99_vfscanf (FILE *__restrict __s,
|
||||
__const char *__restrict __format,
|
||||
|
||||
+3
-3
@@ -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
|
||||
@@ -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 \
|
||||
@@ -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))
|
||||
|
||||
|
||||
+5
-1
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
+2
-1
@@ -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
|
||||
|
||||
@@ -224,6 +224,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
|
||||
PROT_READ, MAP_FILE|MAP_COPY, fd, 0);
|
||||
if (__builtin_expect (filedata == MAP_FAILED, 0))
|
||||
{
|
||||
filedata = NULL;
|
||||
if (__builtin_expect (errno, ENOSYS) == ENOSYS)
|
||||
{
|
||||
#endif /* _POSIX_MAPPED_FILES */
|
||||
|
||||
@@ -762,6 +762,29 @@ write_charmaps (void)
|
||||
twalk (all_data, print_names);
|
||||
}
|
||||
|
||||
/* Print a properly quoted assignment of NAME with VAL, using double
|
||||
quotes iff DQUOTE is true. */
|
||||
static void
|
||||
print_assignment (const char *name, const char *val, bool dquote)
|
||||
{
|
||||
printf ("%s=", name);
|
||||
if (dquote)
|
||||
putchar ('"');
|
||||
while (*val != '\0')
|
||||
{
|
||||
size_t segment
|
||||
= strcspn (val, dquote ? "$`\"\\" : "~|&;<>()$`\\\"' \t\n");
|
||||
printf ("%.*s", (int) segment, val);
|
||||
val += segment;
|
||||
if (*val == '\0')
|
||||
break;
|
||||
putchar ('\\');
|
||||
putchar (*val++);
|
||||
}
|
||||
if (dquote)
|
||||
putchar ('"');
|
||||
putchar ('\n');
|
||||
}
|
||||
|
||||
/* We have to show the contents of the environments determining the
|
||||
locale. */
|
||||
@@ -769,7 +792,7 @@ static void
|
||||
show_locale_vars (void)
|
||||
{
|
||||
size_t cat_no;
|
||||
const char *lcall = getenv ("LC_ALL");
|
||||
const char *lcall = getenv ("LC_ALL") ? : "";
|
||||
const char *lang = getenv ("LANG") ? : "";
|
||||
|
||||
auto void get_source (const char *name);
|
||||
@@ -778,15 +801,15 @@ show_locale_vars (void)
|
||||
{
|
||||
char *val = getenv (name);
|
||||
|
||||
if ((lcall ?: "")[0] != '\0' || val == NULL)
|
||||
printf ("%s=\"%s\"\n", name,
|
||||
(lcall ?: "")[0] ? lcall : (lang ?: "")[0] ? lang : "POSIX");
|
||||
if (lcall[0] != '\0' || val == NULL)
|
||||
print_assignment (name, lcall[0] ? lcall : lang[0] ? lang : "POSIX",
|
||||
true);
|
||||
else
|
||||
printf ("%s=%s\n", name, val);
|
||||
print_assignment (name, val, false);
|
||||
}
|
||||
|
||||
/* LANG has to be the first value. */
|
||||
printf ("LANG=%s\n", lang);
|
||||
print_assignment ("LANG", lang, false);
|
||||
|
||||
/* Now all categories in an unspecified order. */
|
||||
for (cat_no = 0; cat_no < NCATEGORIES; ++cat_no)
|
||||
@@ -794,7 +817,7 @@ show_locale_vars (void)
|
||||
get_source (category[cat_no].name);
|
||||
|
||||
/* The last is the LC_ALL value. */
|
||||
printf ("LC_ALL=%s\n", lcall ? : "");
|
||||
print_assignment ("LC_ALL", lcall, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
@@ -1,3 +1,23 @@
|
||||
2010-02-16 Paul Pluzhnikov <ppluzhnikov@google.com>
|
||||
|
||||
* Makefile: Add missing gconv-modules dependency.
|
||||
|
||||
2010-01-25 Andreas Schwab <schwab@redhat.com>
|
||||
|
||||
* locales/i18n: Don't map U00DF to U1E9E in toupper table.
|
||||
|
||||
2009-11-24 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* locales/hsb_DE: Define week, first_weekday, and first_workday.
|
||||
|
||||
2009-11-23 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* locales/en_DK: Define week, first_weekday, and first_workday.
|
||||
|
||||
2009-11-22 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* locales/nl_NL: Define week, first_weekday, and first_workday.
|
||||
|
||||
2009-10-30 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* locales/it_CH: Fix typos in last change.
|
||||
|
||||
@@ -107,6 +107,8 @@ install-others := $(addprefix $(inst_i18ndir)/, \
|
||||
$(addsuffix .gz, $(charmaps)) \
|
||||
$(locales))
|
||||
|
||||
tests: $(objdir)/iconvdata/gconv-modules
|
||||
|
||||
include ../Rules
|
||||
|
||||
# Install the charmap files in gzipped format.
|
||||
@@ -298,3 +300,6 @@ tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace \
|
||||
LOCPATH=$(common-objpfx)localedata
|
||||
$(objpfx)mtrace-tst-leaks: $(objpfx)tst-leaks.out
|
||||
$(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@
|
||||
|
||||
$(objdir)/iconvdata/gconv-modules:
|
||||
$(MAKE) -C ../iconvdata subdir=iconvdata $@
|
||||
|
||||
+28
-25
@@ -85,34 +85,34 @@ END LC_NUMERIC
|
||||
|
||||
LC_TIME
|
||||
abday "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
|
||||
"<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
|
||||
"<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
|
||||
"<U0053><U0061><U0074>"
|
||||
"<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
|
||||
"<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
|
||||
"<U0053><U0061><U0074>"
|
||||
day "<U0053><U0075><U006E><U0064><U0061><U0079>";/
|
||||
"<U004D><U006F><U006E><U0064><U0061><U0079>";/
|
||||
"<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
|
||||
"<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
|
||||
"<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
|
||||
"<U0046><U0072><U0069><U0064><U0061><U0079>";/
|
||||
"<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
|
||||
"<U004D><U006F><U006E><U0064><U0061><U0079>";/
|
||||
"<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
|
||||
"<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
|
||||
"<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
|
||||
"<U0046><U0072><U0069><U0064><U0061><U0079>";/
|
||||
"<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
|
||||
abmon "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
|
||||
"<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
|
||||
"<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
|
||||
"<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
|
||||
"<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
|
||||
"<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
|
||||
"<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
|
||||
"<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
|
||||
"<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
|
||||
"<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
|
||||
"<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
|
||||
mon "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
|
||||
"<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
|
||||
"<U004D><U0061><U0072><U0063><U0068>";/
|
||||
"<U0041><U0070><U0072><U0069><U006C>";/
|
||||
"<U004D><U0061><U0079>";/
|
||||
"<U004A><U0075><U006E><U0065>";/
|
||||
"<U004A><U0075><U006C><U0079>";/
|
||||
"<U0041><U0075><U0067><U0075><U0073><U0074>";/
|
||||
"<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
|
||||
"<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
|
||||
"<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
|
||||
"<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
|
||||
"<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
|
||||
"<U004D><U0061><U0072><U0063><U0068>";/
|
||||
"<U0041><U0070><U0072><U0069><U006C>";/
|
||||
"<U004D><U0061><U0079>";/
|
||||
"<U004A><U0075><U006E><U0065>";/
|
||||
"<U004A><U0075><U006C><U0079>";/
|
||||
"<U0041><U0075><U0067><U0075><U0073><U0074>";/
|
||||
"<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
|
||||
"<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
|
||||
"<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
|
||||
"<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
|
||||
% date formats following ISO 8601-1988
|
||||
d_t_fmt "<U0025><U0059><U002D><U0025><U006D><U002D><U0025><U0064><U0054><U0025><U0054><U0020><U0025><U005A>"
|
||||
d_fmt "<U0025><U0059><U002D><U0025><U006D><U002D><U0025><U0064>"
|
||||
@@ -122,6 +122,9 @@ t_fmt_ampm ""
|
||||
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>"
|
||||
week 7;19971130;4
|
||||
first_weekday 2
|
||||
first_workday 2
|
||||
END LC_TIME
|
||||
|
||||
LC_MESSAGES
|
||||
|
||||
+14
-10
@@ -197,7 +197,7 @@ collating-symbol <SPECIAL>
|
||||
% letter;accent;case;specials
|
||||
|
||||
order_start forward;backward/
|
||||
;forward;position
|
||||
;forward;position
|
||||
|
||||
% <CAPITAL> or <SMALL> letters first:
|
||||
|
||||
@@ -2136,16 +2136,16 @@ END LC_NUMERIC
|
||||
|
||||
LC_TIME
|
||||
abday "<U004E><U006A>";"<U0050><U00F3>";/
|
||||
"<U0057><U0075>";"<U0053><U0072>";/
|
||||
"<U0160><U0074>";"<U0050><U006A>";/
|
||||
"<U0053><U006F>"
|
||||
"<U0057><U0075>";"<U0053><U0072>";/
|
||||
"<U0160><U0074>";"<U0050><U006A>";/
|
||||
"<U0053><U006F>"
|
||||
day "<U004E><U006A><U0065><U0064><U017A><U0065><U006C><U0061>";/
|
||||
"<U0050><U00F3><U006E><U0064><U017A><U0065><U006C><U0061>";/
|
||||
"<U0057><U0075><U0074><U006F><U0072><U0061>";/
|
||||
"<U0053><U0072><U006A><U0065><U0064><U0061>";/
|
||||
"<U0160><U0074><U0076><U00F3><U0072><U0074><U006B>";/
|
||||
"<U0050><U006A><U0061><U0074><U006B>";/
|
||||
"<U0053><U006F><U0062><U006F><U0074><U0061>"
|
||||
"<U0050><U00F3><U006E><U0064><U017A><U0065><U006C><U0061>";/
|
||||
"<U0057><U0075><U0074><U006F><U0072><U0061>";/
|
||||
"<U0053><U0072><U006A><U0065><U0064><U0061>";/
|
||||
"<U0160><U0074><U0076><U00F3><U0072><U0074><U006B>";/
|
||||
"<U0050><U006A><U0061><U0074><U006B>";/
|
||||
"<U0053><U006F><U0062><U006F><U0074><U0061>"
|
||||
abmon "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
|
||||
"<U004D><U011B><U0072>";"<U0041><U0070><U0072>";/
|
||||
"<U004D><U0065><U006A>";"<U004A><U0075><U006E>";/
|
||||
@@ -2172,6 +2172,10 @@ t_fmt_ampm ""
|
||||
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>"
|
||||
|
||||
week 7;19971130;4
|
||||
first_weekday 2
|
||||
first_workday 2
|
||||
END LC_TIME
|
||||
|
||||
LC_PAPER
|
||||
|
||||
@@ -928,8 +928,7 @@ toupper /
|
||||
(<U006D>,<U004D>);(<U006E>,<U004E>);(<U006F>,<U004F>);(<U0070>,<U0050>);/
|
||||
(<U0071>,<U0051>);(<U0072>,<U0052>);(<U0073>,<U0053>);(<U0074>,<U0054>);/
|
||||
(<U0075>,<U0055>);(<U0076>,<U0056>);(<U0077>,<U0057>);(<U0078>,<U0058>);/
|
||||
(<U0079>,<U0059>);(<U007A>,<U005A>);(<U00B5>,<U039C>);(<U00DF>,<U1E9E>);/
|
||||
(<U00E0>,<U00C0>);/
|
||||
(<U0079>,<U0059>);(<U007A>,<U005A>);(<U00B5>,<U039C>);(<U00E0>,<U00C0>);/
|
||||
(<U00E1>,<U00C1>);(<U00E2>,<U00C2>);(<U00E3>,<U00C3>);(<U00E4>,<U00C4>);/
|
||||
(<U00E5>,<U00C5>);(<U00E6>,<U00C6>);(<U00E7>,<U00C7>);(<U00E8>,<U00C8>);/
|
||||
(<U00E9>,<U00C9>);(<U00EA>,<U00CA>);(<U00EB>,<U00CB>);(<U00EC>,<U00CC>);/
|
||||
|
||||
+28
-24
@@ -88,33 +88,33 @@ END LC_NUMERIC
|
||||
|
||||
LC_TIME
|
||||
abday "<U007A><U006F>";"<U006D><U0061>";"<U0064><U0069>";/
|
||||
"<U0077><U006F>";"<U0064><U006F>";"<U0076><U0072>";/
|
||||
"<U007A><U0061>"
|
||||
"<U0077><U006F>";"<U0064><U006F>";"<U0076><U0072>";/
|
||||
"<U007A><U0061>"
|
||||
day "<U007A><U006F><U006E><U0064><U0061><U0067>";/
|
||||
"<U006D><U0061><U0061><U006E><U0064><U0061><U0067>";/
|
||||
"<U0064><U0069><U006E><U0073><U0064><U0061><U0067>";/
|
||||
"<U0077><U006F><U0065><U006E><U0073><U0064><U0061><U0067>";/
|
||||
"<U0064><U006F><U006E><U0064><U0065><U0072><U0064><U0061><U0067>";/
|
||||
"<U0076><U0072><U0069><U006A><U0064><U0061><U0067>";/
|
||||
"<U007A><U0061><U0074><U0065><U0072><U0064><U0061><U0067>"
|
||||
"<U006D><U0061><U0061><U006E><U0064><U0061><U0067>";/
|
||||
"<U0064><U0069><U006E><U0073><U0064><U0061><U0067>";/
|
||||
"<U0077><U006F><U0065><U006E><U0073><U0064><U0061><U0067>";/
|
||||
"<U0064><U006F><U006E><U0064><U0065><U0072><U0064><U0061><U0067>";/
|
||||
"<U0076><U0072><U0069><U006A><U0064><U0061><U0067>";/
|
||||
"<U007A><U0061><U0074><U0065><U0072><U0064><U0061><U0067>"
|
||||
abmon "<U006A><U0061><U006E>";"<U0066><U0065><U0062>";/
|
||||
"<U006D><U0072><U0074>";"<U0061><U0070><U0072>";/
|
||||
"<U006D><U0065><U0069>";"<U006A><U0075><U006E>";/
|
||||
"<U006A><U0075><U006C>";"<U0061><U0075><U0067>";/
|
||||
"<U0073><U0065><U0070>";"<U006F><U006B><U0074>";/
|
||||
"<U006E><U006F><U0076>";"<U0064><U0065><U0063>"
|
||||
"<U006D><U0072><U0074>";"<U0061><U0070><U0072>";/
|
||||
"<U006D><U0065><U0069>";"<U006A><U0075><U006E>";/
|
||||
"<U006A><U0075><U006C>";"<U0061><U0075><U0067>";/
|
||||
"<U0073><U0065><U0070>";"<U006F><U006B><U0074>";/
|
||||
"<U006E><U006F><U0076>";"<U0064><U0065><U0063>"
|
||||
mon "<U006A><U0061><U006E><U0075><U0061><U0072><U0069>";/
|
||||
"<U0066><U0065><U0062><U0072><U0075><U0061><U0072><U0069>";/
|
||||
"<U006D><U0061><U0061><U0072><U0074>";/
|
||||
"<U0061><U0070><U0072><U0069><U006C>";/
|
||||
"<U006D><U0065><U0069>";/
|
||||
"<U006A><U0075><U006E><U0069>";/
|
||||
"<U006A><U0075><U006C><U0069>";/
|
||||
"<U0061><U0075><U0067><U0075><U0073><U0074><U0075><U0073>";/
|
||||
"<U0073><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
|
||||
"<U006F><U006B><U0074><U006F><U0062><U0065><U0072>";/
|
||||
"<U006E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
|
||||
"<U0064><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
|
||||
"<U0066><U0065><U0062><U0072><U0075><U0061><U0072><U0069>";/
|
||||
"<U006D><U0061><U0061><U0072><U0074>";/
|
||||
"<U0061><U0070><U0072><U0069><U006C>";/
|
||||
"<U006D><U0065><U0069>";/
|
||||
"<U006A><U0075><U006E><U0069>";/
|
||||
"<U006A><U0075><U006C><U0069>";/
|
||||
"<U0061><U0075><U0067><U0075><U0073><U0074><U0075><U0073>";/
|
||||
"<U0073><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
|
||||
"<U006F><U006B><U0074><U006F><U0062><U0065><U0072>";/
|
||||
"<U006E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
|
||||
"<U0064><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
|
||||
d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
|
||||
d_fmt "<U0025><U0064><U002D><U0025><U006D><U002D><U0025><U0079>"
|
||||
t_fmt "<U0025><U0054>"
|
||||
@@ -123,6 +123,10 @@ t_fmt_ampm ""
|
||||
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>"
|
||||
|
||||
week 7;19971130;4
|
||||
first_weekday 2
|
||||
first_workday 2
|
||||
END LC_TIME
|
||||
|
||||
LC_PAPER
|
||||
|
||||
@@ -64,7 +64,7 @@ print_version (FILE *stream, struct argp_state *state)
|
||||
Copyright (C) %s Free Software Foundation, Inc.\n\
|
||||
This is free software; see the source for copying conditions. There is NO\n\
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
|
||||
"), "1999");
|
||||
"), "2011");
|
||||
}
|
||||
|
||||
static char *
|
||||
@@ -123,7 +123,7 @@ do_pt_chown (void)
|
||||
|
||||
/* Set the owner to the real user ID, and the group to that special
|
||||
group ID. */
|
||||
if (st.st_gid != gid && chown (pty, getuid (), gid) < 0)
|
||||
if (chown (pty, getuid (), gid) < 0)
|
||||
return FAIL_EACCES;
|
||||
|
||||
/* Set the permission mode to readable and writable by the owner,
|
||||
@@ -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);
|
||||
@@ -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
|
||||
|
||||
|
||||
+14
-11
@@ -1,5 +1,5 @@
|
||||
/* Malloc implementation for multiple threads without lock contention.
|
||||
Copyright (C) 1996-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2009, 2010 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Wolfram Gloger <wg@malloc.de>
|
||||
and Doug Lea <dl@cs.oswego.edu>, 2001.
|
||||
@@ -2351,7 +2351,8 @@ typedef struct malloc_chunk* mfastbinptr;
|
||||
*/
|
||||
|
||||
#define set_max_fast(s) \
|
||||
global_max_fast = ((s) == 0)? SMALLBIN_WIDTH: request2size(s)
|
||||
global_max_fast = (((s) == 0) \
|
||||
? SMALLBIN_WIDTH: ((s + SIZE_SZ) & ~MALLOC_ALIGN_MASK))
|
||||
#define get_max_fast() global_max_fast
|
||||
|
||||
|
||||
@@ -2831,7 +2832,7 @@ static void do_check_malloc_state(mstate av)
|
||||
max_fast_bin = fastbin_index(get_max_fast ());
|
||||
|
||||
for (i = 0; i < NFASTBINS; ++i) {
|
||||
p = av->fastbins[i];
|
||||
p = fastbin (av, i);
|
||||
|
||||
/* The following test can only be performed for the main arena.
|
||||
While mallopt calls malloc_consolidate to get rid of all fast
|
||||
@@ -3933,9 +3934,10 @@ public_vALLOc(size_t bytes)
|
||||
if(!p) {
|
||||
/* Maybe the failure is due to running out of mmapped areas. */
|
||||
if(ar_ptr != &main_arena) {
|
||||
(void)mutex_lock(&main_arena.mutex);
|
||||
p = _int_memalign(&main_arena, pagesz, bytes);
|
||||
(void)mutex_unlock(&main_arena.mutex);
|
||||
ar_ptr = &main_arena;
|
||||
(void)mutex_lock(&ar_ptr->mutex);
|
||||
p = _int_memalign(ar_ptr, pagesz, bytes);
|
||||
(void)mutex_unlock(&ar_ptr->mutex);
|
||||
} else {
|
||||
#if USE_ARENAS
|
||||
/* ... or sbrk() has failed and there is still a chance to mmap() */
|
||||
@@ -3978,9 +3980,10 @@ public_pVALLOc(size_t bytes)
|
||||
if(!p) {
|
||||
/* Maybe the failure is due to running out of mmapped areas. */
|
||||
if(ar_ptr != &main_arena) {
|
||||
(void)mutex_lock(&main_arena.mutex);
|
||||
p = _int_memalign(&main_arena, pagesz, rounded_bytes);
|
||||
(void)mutex_unlock(&main_arena.mutex);
|
||||
ar_ptr = &main_arena;
|
||||
(void)mutex_lock(&ar_ptr->mutex);
|
||||
p = _int_memalign(ar_ptr, pagesz, rounded_bytes);
|
||||
(void)mutex_unlock(&ar_ptr->mutex);
|
||||
} else {
|
||||
#if USE_ARENAS
|
||||
/* ... or sbrk() has failed and there is still a chance to mmap() */
|
||||
@@ -4847,7 +4850,7 @@ _int_free(mstate av, mchunkptr p)
|
||||
}
|
||||
|
||||
if (__builtin_expect (perturb_byte, 0))
|
||||
free_perturb (chunk2mem(p), size - SIZE_SZ);
|
||||
free_perturb (chunk2mem(p), size - 2 * SIZE_SZ);
|
||||
|
||||
set_fastchunks(av);
|
||||
fb = &fastbin (av, fastbin_index(size));
|
||||
@@ -4935,7 +4938,7 @@ _int_free(mstate av, mchunkptr p)
|
||||
}
|
||||
|
||||
if (__builtin_expect (perturb_byte, 0))
|
||||
free_perturb (chunk2mem(p), size - SIZE_SZ);
|
||||
free_perturb (chunk2mem(p), size - 2 * SIZE_SZ);
|
||||
|
||||
/* consolidate backward */
|
||||
if (!prev_inuse(p)) {
|
||||
|
||||
+21
-1
@@ -1,5 +1,6 @@
|
||||
/* Standard debugging hooks for `malloc'.
|
||||
Copyright (C) 1990-1997,1999,2000-2002,2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990-1997,1999,2000-2002,2007,2010
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written May 1989 by Mike Haertel.
|
||||
|
||||
@@ -25,6 +26,7 @@
|
||||
# include <stdint.h>
|
||||
# include <stdio.h>
|
||||
# include <libintl.h>
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
/* Old hook values. */
|
||||
@@ -209,6 +211,12 @@ mallochook (__malloc_size_t size, const __ptr_t caller)
|
||||
if (pedantic)
|
||||
mcheck_check_all ();
|
||||
|
||||
if (size > ~((size_t) 0) - (sizeof (struct hdr) + 1))
|
||||
{
|
||||
__set_errno (ENOMEM);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
__malloc_hook = old_malloc_hook;
|
||||
if (old_malloc_hook != NULL)
|
||||
hdr = (struct hdr *) (*old_malloc_hook) (sizeof (struct hdr) + size + 1,
|
||||
@@ -241,6 +249,12 @@ memalignhook (__malloc_size_t alignment, __malloc_size_t size,
|
||||
|
||||
slop = (sizeof *hdr + alignment - 1) & -alignment;
|
||||
|
||||
if (size > ~((size_t) 0) - (slop + 1))
|
||||
{
|
||||
__set_errno (ENOMEM);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
__memalign_hook = old_memalign_hook;
|
||||
if (old_memalign_hook != NULL)
|
||||
block = (*old_memalign_hook) (alignment, slop + size + 1, caller);
|
||||
@@ -276,6 +290,12 @@ reallochook (__ptr_t ptr, __malloc_size_t size, const __ptr_t caller)
|
||||
if (pedantic)
|
||||
mcheck_check_all ();
|
||||
|
||||
if (size > ~((size_t) 0) - (sizeof (struct hdr) + 1))
|
||||
{
|
||||
__set_errno (ENOMEM);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
hdr = ((struct hdr *) ptr) - 1;
|
||||
|
||||
+4
-1
@@ -232,7 +232,10 @@ ifdef objpfx
|
||||
.PHONY: stubs
|
||||
stubs: $(objpfx)stubs
|
||||
endif
|
||||
$(objpfx)stubs ../po/manual.pot $(objpfx)stamp%:
|
||||
$(objpfx)stubs ../po/manual.pot:
|
||||
$(make-target-directory)
|
||||
touch $@
|
||||
$(objpfx)stamp%:
|
||||
$(make-target-directory)
|
||||
touch $@
|
||||
|
||||
|
||||
+2
-1
@@ -1407,7 +1407,8 @@ do not raise the inexact exception if @var{x} is not an integer.
|
||||
@comment ISO
|
||||
@deftypefunx {long double} roundl (long double @var{x})
|
||||
These functions are similar to @code{rint}, but they round halfway
|
||||
cases away from zero instead of to the nearest even integer.
|
||||
cases away from zero instead of to the nearest integer (or other
|
||||
current rounding mode).
|
||||
@end deftypefun
|
||||
|
||||
@comment math.h
|
||||
|
||||
+5
-5
@@ -393,7 +393,7 @@ We already said above that the currently selected locale for the
|
||||
by the functions we are about to describe. Each locale uses its own
|
||||
character set (given as an argument to @code{localedef}) and this is the
|
||||
one assumed as the external multibyte encoding. The wide character
|
||||
character set always is UCS-4, at least on GNU systems.
|
||||
set is always UCS-4, at least on GNU systems.
|
||||
|
||||
A characteristic of each multibyte character set is the maximum number
|
||||
of bytes that can be necessary to represent one character. This
|
||||
@@ -577,8 +577,8 @@ The @code{btowc} function was introduced in @w{Amendment 1} to @w{ISO C90}
|
||||
and is declared in @file{wchar.h}.
|
||||
@end deftypefun
|
||||
|
||||
Despite the limitation that the single byte value always is interpreted
|
||||
in the initial state this function is actually useful most of the time.
|
||||
Despite the limitation that the single byte value is always interpreted
|
||||
in the initial state, this function is actually useful most of the time.
|
||||
Most characters are either entirely single-byte character sets or they
|
||||
are extension to ASCII. But then it is possible to write code like this
|
||||
(not that this specific example is very useful):
|
||||
@@ -607,10 +607,10 @@ that there is no guarantee that one can perform this kind of arithmetic
|
||||
on the character of the character set used for @code{wchar_t}
|
||||
representation. In other situations the bytes are not constant at
|
||||
compile time and so the compiler cannot do the work. In situations like
|
||||
this it is necessary @code{btowc}.
|
||||
this, using @code{btowc} is required.
|
||||
|
||||
@noindent
|
||||
There also is a function for the conversion in the other direction.
|
||||
There is also a function for the conversion in the other direction.
|
||||
|
||||
@comment wchar.h
|
||||
@comment ISO
|
||||
|
||||
+1
-1
@@ -1419,7 +1419,7 @@ available on all systems implementing @w{ISO C}. But often the text
|
||||
@code{perror} generates is not what is wanted and there is no way to
|
||||
extend or change what @code{perror} does. The GNU coding standard, for
|
||||
instance, requires error messages to be preceded by the program name and
|
||||
programs which read some input files should should provide information
|
||||
programs which read some input files should provide information
|
||||
about the input file name and the line number in case an error is
|
||||
encountered while reading the file. For these occasions there are two
|
||||
functions available which are widely used throughout the GNU project.
|
||||
|
||||
+1
-1
@@ -269,7 +269,7 @@ When @code{getopt_long} has no more options to handle, it returns
|
||||
@var{argv} of the next remaining argument.
|
||||
@end deftypefun
|
||||
|
||||
Since long option names were used before before the @code{getopt_long}
|
||||
Since long option names were used before the @code{getopt_long}
|
||||
options was invented there are program interfaces which require programs
|
||||
to recognize options like @w{@samp{-option value}} instead of
|
||||
@w{@samp{--option value}}. To enable these programs to use the GNU
|
||||
|
||||
+3
-2
@@ -348,11 +348,12 @@ floating-point support that may be triggered by the math library.
|
||||
Check the FAQ for any special compiler issues on particular platforms.
|
||||
|
||||
@item
|
||||
GNU @code{binutils} 2.15 or later
|
||||
GNU @code{binutils}
|
||||
|
||||
You must use GNU @code{binutils} (as and ld) to build the GNU C library.
|
||||
No other assembler or linker has the necessary functionality at the
|
||||
moment.
|
||||
moment. The configure scripts checks for the appropriate version
|
||||
for the platform. Too-old versions will prevent building glibc.
|
||||
|
||||
@item
|
||||
GNU @code{texinfo} 3.12f
|
||||
|
||||
+1
-1
@@ -1210,7 +1210,7 @@ This function would normally be used like this:
|
||||
/* @r{Prepare the @code{getline} call.} */
|
||||
line = NULL;
|
||||
len = 0;
|
||||
while (getline (&line, &len, stdout) >= 0)
|
||||
while (getline (&line, &len, stdin) >= 0)
|
||||
@{
|
||||
/* @r{Check the response.} */
|
||||
int res = rpmatch (line);
|
||||
|
||||
+1
-1
@@ -1421,7 +1421,7 @@ pseudo-random number generator.
|
||||
|
||||
The GNU C library contains four additional functions which contain the
|
||||
state as an explicit parameter and therefore make it possible to handle
|
||||
thread-local PRNGs. Beside this there are no difference. In fact, the
|
||||
thread-local PRNGs. Beside this there is no difference. In fact, the
|
||||
four functions already discussed are implemented internally using the
|
||||
following interfaces.
|
||||
|
||||
|
||||
+6
-1
@@ -702,6 +702,11 @@ be allocated via @code{mmap}.
|
||||
@item M_MMAP_MAX
|
||||
The maximum number of chunks to allocate with @code{mmap}. Setting this
|
||||
to zero disables all use of @code{mmap}.
|
||||
@item M_PERTURB
|
||||
If non-zero, memory blocks are filled with values depending on some
|
||||
low order bits of this parameter when they are allocated (except when
|
||||
allocated by @code{calloc}) and freed. This can be used to debug the
|
||||
use of uninitialized or freed heap memory.
|
||||
@end table
|
||||
|
||||
@end deftypefun
|
||||
@@ -2379,7 +2384,7 @@ exceed the process' data storage limit.
|
||||
@c The Brk system call in Linux (as opposed to the GNU C Library function)
|
||||
@c is considerably different. It always returns the new end of the data
|
||||
@c segment, whether it succeeds or fails. The GNU C library Brk determines
|
||||
@c it's a failure if and only if if the system call returns an address less
|
||||
@c it's a failure if and only if the system call returns an address less
|
||||
@c than the address requested.
|
||||
|
||||
@end deftypefun
|
||||
|
||||
+1
-1
@@ -1466,7 +1466,7 @@ have this problem. But there is a very simple and powerful method to
|
||||
handle these kind of problems with the @code{gettext} functions.
|
||||
|
||||
@noindent
|
||||
As as example consider the following fictional situation. A GUI program
|
||||
As an example consider the following fictional situation. A GUI program
|
||||
has a menu bar with the following entries:
|
||||
|
||||
@smallexample
|
||||
|
||||
@@ -1288,7 +1288,7 @@ protected from concurrent accesses from different processors.
|
||||
The POSIX standard up to this date is of not much help to solve this
|
||||
problem. The Linux kernel provides a set of interfaces to allow
|
||||
specifying @emph{affinity sets} for a process. The scheduler will
|
||||
schedule the thread or process on on CPUs specified by the affinity
|
||||
schedule the thread or process on CPUs specified by the affinity
|
||||
masks. The interfaces which the GNU C library define follow to some
|
||||
extend the Linux kernel interface.
|
||||
|
||||
|
||||
+1
-1
@@ -574,7 +574,7 @@ operation itself is avoided. More importantly, functions like
|
||||
introduction of threads) were implemented as macros which are very fast
|
||||
if the buffer is not empty. With the addition of locking requirements
|
||||
these functions are no longer implemented as macros since they would
|
||||
would expand to too much code.
|
||||
expand to too much code.
|
||||
But these macros are still available with the same functionality under the new
|
||||
names @code{putc_unlocked} and @code{getc_unlocked}. This possibly huge
|
||||
difference of speed also suggests the use of the @code{_unlocked}
|
||||
|
||||
+1
-1
@@ -972,7 +972,7 @@ This counter represents the number of calibration errors (caused by
|
||||
large offsets or jitter).
|
||||
|
||||
@item long int stbcnt
|
||||
This counter denotes the number of of calibrations where the stability
|
||||
This counter denotes the number of calibrations where the stability
|
||||
exceeded the threshold.
|
||||
@end table
|
||||
@end deftp
|
||||
|
||||
+3
-1
@@ -90,7 +90,8 @@ distribute += $(filter-out $(generated),$(long-m-yes:=.c) $(long-c-yes:=.c))
|
||||
# Rules for the test suite.
|
||||
tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \
|
||||
test-misc test-fpucw tst-definitions test-tgmath test-tgmath-ret \
|
||||
bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int test-tgmath2
|
||||
bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int \
|
||||
test-tgmath2 test-powl
|
||||
# We do the `long double' tests only if this data type is available and
|
||||
# distinct from `double'.
|
||||
test-longdouble-yes = test-ldouble test-ildoubl
|
||||
@@ -131,6 +132,7 @@ CFLAGS-test-ldouble.c = -fno-inline -ffloat-store -fno-builtin
|
||||
CFLAGS-test-tgmath.c = -fno-builtin
|
||||
CFLAGS-test-tgmath2.c = -fno-builtin
|
||||
CFLAGS-test-tgmath-ret.c = -fno-builtin
|
||||
CFLAGS-test-powl.c = -fno-builtin
|
||||
CPPFLAGS-test-ifloat.c = -U__LIBC_INTERNAL_MATH_INLINES -D__FAST_MATH__ \
|
||||
-DTEST_FAST_MATH -fno-builtin
|
||||
CPPFLAGS-test-idouble.c = -U__LIBC_INTERNAL_MATH_INLINES -D__FAST_MATH__ \
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
/* Test for powl
|
||||
Copyright (C) 2011 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
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
#include <ieee754.h>
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
#ifndef NO_LONG_DOUBLE
|
||||
# if LDBL_MANT_DIG == 64
|
||||
{
|
||||
long double x = 1e-20;
|
||||
union ieee854_long_double u;
|
||||
u.ieee.mantissa0 = 1;
|
||||
u.ieee.mantissa1 = 1;
|
||||
u.ieee.exponent = 0;
|
||||
u.ieee.negative = 0;
|
||||
(void) powl (0.2, u.d);
|
||||
x = powl (x, 1.5);
|
||||
if (fabsl (x - 1e-30) > 1e-10)
|
||||
{
|
||||
printf ("powl (1e-20, 1.5): wrong result: %Lg\n", x);
|
||||
result = 1;
|
||||
}
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/* Checking macros for syslog functions.
|
||||
Copyright (C) 2005, 2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005, 2007, 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
|
||||
@@ -29,7 +29,7 @@ extern void __syslog_chk (int __pri, int __flag, __const char *__fmt, ...)
|
||||
__extern_always_inline void
|
||||
syslog (int __pri, __const char *__fmt, ...)
|
||||
{
|
||||
return __syslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
|
||||
__syslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
|
||||
}
|
||||
#elif !defined __cplusplus
|
||||
# define syslog(pri, ...) \
|
||||
@@ -45,6 +45,6 @@ extern void __vsyslog_chk (int __pri, int __flag, __const char *__fmt,
|
||||
__extern_always_inline void
|
||||
vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
|
||||
{
|
||||
return __vsyslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
|
||||
__vsyslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
|
||||
}
|
||||
#endif
|
||||
|
||||
+4
-2
@@ -1,5 +1,5 @@
|
||||
/* Error handler for noninteractive utilities
|
||||
Copyright (C) 1990-1998, 2000-2005, 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990-1998, 2000-2006, 2011 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
|
||||
@@ -272,7 +272,9 @@ error_at_line (int status, int errnum, const char *file_name,
|
||||
|
||||
if (old_line_number == line_number
|
||||
&& (file_name == old_file_name
|
||||
|| strcmp (old_file_name, file_name) == 0))
|
||||
|| (old_file_name != NULL
|
||||
&& file_name != NULL
|
||||
&& strcmp (old_file_name, file_name) == 0)))
|
||||
/* Simply return and print nothing. */
|
||||
return;
|
||||
|
||||
|
||||
+2
-2
@@ -116,7 +116,8 @@ initshells()
|
||||
}
|
||||
if (statb.st_size > ~(size_t)0 / sizeof (char *) * 3)
|
||||
goto init_okshells;
|
||||
if ((strings = malloc(statb.st_size + 2)) == NULL)
|
||||
flen = statb.st_size + 3;
|
||||
if ((strings = malloc(flen)) == NULL)
|
||||
goto init_okshells;
|
||||
shells = malloc(statb.st_size / 3 * sizeof (char *));
|
||||
if (shells == NULL) {
|
||||
@@ -126,7 +127,6 @@ initshells()
|
||||
}
|
||||
sp = shells;
|
||||
cp = strings;
|
||||
flen = statb.st_size + 2;
|
||||
while (fgets_unlocked(cp, flen - (cp - strings), fp) != NULL) {
|
||||
while (*cp != '#' && *cp != '/' && *cp != '\0')
|
||||
cp++;
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
/* Utilities for reading/writing fstab, mtab, etc.
|
||||
Copyright (C) 1995-2000, 2001, 2002, 2003, 2006
|
||||
Copyright (C) 1995-2000, 2001, 2002, 2003, 2006, 2010, 2011
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
@@ -194,7 +194,7 @@ weak_alias (__getmntent_r, getmntent_r)
|
||||
const char *rp = name; \
|
||||
\
|
||||
while (*rp != '\0') \
|
||||
if (*rp == ' ' || *rp == '\t' || *rp == '\\') \
|
||||
if (*rp == ' ' || *rp == '\t' || *rp == '\n' || *rp == '\\') \
|
||||
break; \
|
||||
else \
|
||||
++rp; \
|
||||
@@ -202,7 +202,7 @@ weak_alias (__getmntent_r, getmntent_r)
|
||||
if (*rp != '\0') \
|
||||
{ \
|
||||
/* In the worst case the length of the string can increase to \
|
||||
founr times the current length. */ \
|
||||
four times the current length. */ \
|
||||
char *wp; \
|
||||
\
|
||||
rp = name; \
|
||||
@@ -263,8 +263,8 @@ __addmntent (FILE *stream, const struct mntent *mnt)
|
||||
mntcopy.mnt_type,
|
||||
mntcopy.mnt_opts,
|
||||
mntcopy.mnt_freq,
|
||||
mntcopy.mnt_passno)
|
||||
< 0 ? 1 : 0);
|
||||
mntcopy.mnt_passno) < 0
|
||||
|| fflush (stream) != 0);
|
||||
}
|
||||
weak_alias (__addmntent, addmntent)
|
||||
|
||||
|
||||
@@ -474,18 +474,21 @@ internal_getgrent_r (ent_t *ent, char *buffer, size_t buflen, const char *user,
|
||||
/* If the selected module does not support getgrent_r or
|
||||
initgroups_dyn, abort. We cannot find the needed group
|
||||
entries. */
|
||||
if (nss_getgrent_r == NULL && nss_initgroups_dyn == NULL)
|
||||
if (nss_initgroups_dyn == NULL || nss_getgrgid_r == NULL)
|
||||
{
|
||||
if (nss_setgrent != NULL)
|
||||
{
|
||||
nss_setgrent (1);
|
||||
ent->need_endgrent = true;
|
||||
}
|
||||
ent->skip_initgroups_dyn = true;
|
||||
}
|
||||
|
||||
if (ent->skip_initgroups_dyn && nss_getgrent_r == NULL)
|
||||
return NSS_STATUS_UNAVAIL;
|
||||
|
||||
ent->files = false;
|
||||
|
||||
if (nss_initgroups_dyn == NULL && nss_setgrent != NULL)
|
||||
{
|
||||
nss_setgrent (1);
|
||||
ent->need_endgrent = true;
|
||||
}
|
||||
ent->skip_initgroups_dyn = true;
|
||||
|
||||
return getgrent_next_nss (ent, buffer, buflen, user, group,
|
||||
start, size, groupsp, limit, errnop);
|
||||
}
|
||||
|
||||
+25
-22
@@ -70,20 +70,20 @@ LINE_PARSER
|
||||
{
|
||||
assert ((flags & AI_V4MAPPED) == 0 || af != AF_UNSPEC);
|
||||
if (flags & AI_V4MAPPED)
|
||||
{
|
||||
map_v4v6_address ((char *) entdata->host_addr,
|
||||
(char *) entdata->host_addr);
|
||||
result->h_addrtype = AF_INET6;
|
||||
result->h_length = IN6ADDRSZ;
|
||||
}
|
||||
{
|
||||
map_v4v6_address ((char *) entdata->host_addr,
|
||||
(char *) entdata->host_addr);
|
||||
result->h_addrtype = AF_INET6;
|
||||
result->h_length = IN6ADDRSZ;
|
||||
}
|
||||
else
|
||||
{
|
||||
result->h_addrtype = AF_INET;
|
||||
result->h_length = INADDRSZ;
|
||||
}
|
||||
{
|
||||
result->h_addrtype = AF_INET;
|
||||
result->h_length = INADDRSZ;
|
||||
}
|
||||
}
|
||||
else if (af != AF_INET
|
||||
&& inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
|
||||
&& inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
|
||||
{
|
||||
result->h_addrtype = AF_INET6;
|
||||
result->h_length = IN6ADDRSZ;
|
||||
@@ -164,14 +164,14 @@ internal_nis_gethostent_r (struct hostent *host, char *buffer,
|
||||
int keylen;
|
||||
int yperr;
|
||||
if (new_start)
|
||||
yperr = yp_first (domain, "hosts.byname", &outkey, &keylen, &result,
|
||||
yperr = yp_first (domain, "hosts.byname", &outkey, &keylen, &result,
|
||||
&len);
|
||||
else
|
||||
yperr = yp_next (domain, "hosts.byname", oldkey, oldkeylen, &outkey,
|
||||
yperr = yp_next (domain, "hosts.byname", oldkey, oldkeylen, &outkey,
|
||||
&keylen, &result, &len);
|
||||
|
||||
if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
|
||||
{
|
||||
{
|
||||
enum nss_status retval = yperr2nss (yperr);
|
||||
|
||||
switch (retval)
|
||||
@@ -191,12 +191,12 @@ internal_nis_gethostent_r (struct hostent *host, char *buffer,
|
||||
}
|
||||
|
||||
if (__builtin_expect ((size_t) (len + 1) > linebuflen, 0))
|
||||
{
|
||||
free (result);
|
||||
{
|
||||
free (result);
|
||||
*h_errnop = NETDB_INTERNAL;
|
||||
*errnop = ERANGE;
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
}
|
||||
*errnop = ERANGE;
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
}
|
||||
|
||||
char *p = strncpy (data->linebuffer, result, len);
|
||||
data->linebuffer[len] = '\0';
|
||||
@@ -233,7 +233,7 @@ _nss_nis_gethostent_r (struct hostent *host, char *buffer, size_t buflen,
|
||||
__libc_lock_lock (lock);
|
||||
|
||||
status = internal_nis_gethostent_r (host, buffer, buflen, errnop, h_errnop,
|
||||
((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET),
|
||||
((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET),
|
||||
((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0 ));
|
||||
|
||||
__libc_lock_unlock (lock);
|
||||
@@ -346,7 +346,7 @@ _nss_nis_gethostbyname2_r (const char *name, int af, struct hostent *host,
|
||||
|
||||
return internal_gethostbyname2_r (name, af, host, buffer, buflen, errnop,
|
||||
h_errnop,
|
||||
((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0));
|
||||
((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0));
|
||||
}
|
||||
|
||||
|
||||
@@ -456,7 +456,10 @@ _nss_nis_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
|
||||
{
|
||||
char *domain;
|
||||
if (yp_get_default_domain (&domain))
|
||||
return NSS_STATUS_UNAVAIL;
|
||||
{
|
||||
*herrnop = NO_DATA;
|
||||
return NSS_STATUS_UNAVAIL;
|
||||
}
|
||||
|
||||
/* Convert name to lowercase. */
|
||||
size_t namlen = strlen (name);
|
||||
|
||||
@@ -139,7 +139,7 @@ get_uid (const char *user, uid_t *uidp)
|
||||
if (r != ERANGE)
|
||||
break;
|
||||
|
||||
extend_alloca (buf, buflen, 2 * buflen);
|
||||
buf = extend_alloca (buf, buflen, 2 * buflen);
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1997-2003, 2005, 2006, 2008 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1997-2003, 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997.
|
||||
|
||||
@@ -38,10 +38,10 @@ static nis_name tablename_val;
|
||||
static u_long tablename_len;
|
||||
|
||||
#define NISENTRYVAL(idx, col, res) \
|
||||
(NIS_RES_OBJECT (res)[idx].EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val)
|
||||
(NIS_RES_OBJECT (res)[idx].EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val)
|
||||
|
||||
#define NISENTRYLEN(idx, col, res) \
|
||||
(NIS_RES_OBJECT (res)[idx].EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len)
|
||||
(NIS_RES_OBJECT (res)[idx].EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len)
|
||||
|
||||
/* Get implementation for some internal functions. */
|
||||
#include <resolv/mapv4v6addr.h>
|
||||
@@ -287,15 +287,15 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer,
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
}
|
||||
if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
|
||||
{
|
||||
enum nss_status retval = niserr2nss (result->status);
|
||||
if (retval == NSS_STATUS_TRYAGAIN)
|
||||
{
|
||||
*herrnop = NETDB_INTERNAL;
|
||||
*errnop = errno;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
{
|
||||
enum nss_status retval = niserr2nss (result->status);
|
||||
if (retval == NSS_STATUS_TRYAGAIN)
|
||||
{
|
||||
*herrnop = NETDB_INTERNAL;
|
||||
*errnop = errno;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
@@ -308,18 +308,18 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer,
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
}
|
||||
if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
|
||||
{
|
||||
enum nss_status retval= niserr2nss (result->status);
|
||||
{
|
||||
enum nss_status retval= niserr2nss (result->status);
|
||||
|
||||
nis_freeresult (result);
|
||||
result = saved_res;
|
||||
if (retval == NSS_STATUS_TRYAGAIN)
|
||||
{
|
||||
*herrnop = NETDB_INTERNAL;
|
||||
if (retval == NSS_STATUS_TRYAGAIN)
|
||||
{
|
||||
*herrnop = NETDB_INTERNAL;
|
||||
*errnop = errno;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
if (_res.options & RES_USE_INET6)
|
||||
@@ -330,13 +330,13 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer,
|
||||
buflen, errnop, 0);
|
||||
|
||||
if (parse_res == -1)
|
||||
{
|
||||
{
|
||||
nis_freeresult (result);
|
||||
result = saved_res;
|
||||
*herrnop = NETDB_INTERNAL;
|
||||
*herrnop = NETDB_INTERNAL;
|
||||
*errnop = ERANGE;
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
}
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
}
|
||||
if (saved_res != NULL)
|
||||
nis_freeresult (saved_res);
|
||||
|
||||
@@ -435,6 +435,7 @@ internal_gethostbyname2_r (const char *name, int af, struct hostent *host,
|
||||
if (result == NULL)
|
||||
{
|
||||
*errnop = ENOMEM;
|
||||
*herrnop = NETDB_INTERNAL;
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
}
|
||||
|
||||
@@ -444,10 +445,13 @@ internal_gethostbyname2_r (const char *name, int af, struct hostent *host,
|
||||
if (retval == NSS_STATUS_TRYAGAIN)
|
||||
{
|
||||
*errnop = errno;
|
||||
*herrnop = NETDB_INTERNAL;
|
||||
*herrnop = TRY_AGAIN;
|
||||
}
|
||||
else
|
||||
__set_errno (olderr);
|
||||
{
|
||||
__set_errno (olderr);
|
||||
*herrnop = NETDB_INTERNAL;
|
||||
}
|
||||
nis_freeresult (result);
|
||||
return retval;
|
||||
}
|
||||
@@ -502,7 +506,7 @@ _nss_nisplus_gethostbyname_r (const char *name, struct hostent *host,
|
||||
buflen, errnop, h_errnop,
|
||||
AI_V4MAPPED);
|
||||
if (status == NSS_STATUS_SUCCESS)
|
||||
return status;
|
||||
return status;
|
||||
}
|
||||
|
||||
return internal_gethostbyname2_r (name, AF_INET, host, buffer,
|
||||
|
||||
@@ -1,3 +1,46 @@
|
||||
2011-05-11 Ulrich Drepper <drepper@gmail.com>
|
||||
|
||||
[BZ #386]
|
||||
* allocatestack.c (allocate_stack): Convert ENOMEM error to EAGAIN.
|
||||
|
||||
2011-04-10 Ulrich Drepper <drepper@gmail.com>
|
||||
|
||||
[BZ #12650]
|
||||
* allocatestack.c (get_cached_stack): Deallocate DTV entries before
|
||||
clearing memory.
|
||||
Patch partly by Robert Rex <robert.rex@exasol.com>.
|
||||
|
||||
2011-01-13 Ulrich Drepper <drepper@gmail.com>
|
||||
|
||||
[BZ #10484]
|
||||
* Versions [libc] (GLIBC_PRIVATE): Export __libc_alloca_cutoff.
|
||||
* alloca_cutoff.c: Add libc_hidden_def.
|
||||
|
||||
2010-08-12 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* nptl/sysdeps/unix/sysv/linux/i386/Makefile: New file.
|
||||
|
||||
2010-07-01 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* Makefile (tst-_res1): Add tst-_res1mod1 to dependency list.
|
||||
|
||||
2010-10-13 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
[BZ #12113]
|
||||
* sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Changed to 32.
|
||||
* sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Defined with alignment
|
||||
of "struct pthread".
|
||||
|
||||
2010-06-01 Takashi Yoshii <takashi.yoshii.zj@renesas.com>
|
||||
|
||||
* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Fix incorrect
|
||||
location of ifndef __ASSUME_FUTEX_CLOCK_REALTIME.
|
||||
|
||||
2009-11-27 Andreas Schwab <schwab@redhat.com>
|
||||
|
||||
* sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
|
||||
THREAD_SELF->cancelhandling after returning from futex call.
|
||||
|
||||
2009-11-03 Andreas Schwab <schwab@linux-m68k.org>
|
||||
|
||||
[BZ #4457]
|
||||
|
||||
+2
-1
@@ -489,7 +489,8 @@ $(objpfx)tst-rwlock14: $(common-objpfx)rt/librt.so
|
||||
$(objpfx)tst-_res1mod2.so: $(objpfx)tst-_res1mod1.so
|
||||
LDFLAGS-tst-_res1mod1.so = -Wl,-soname,tst-_res1mod1.so
|
||||
LDFLAGS-tst-_res1mod2.so = -Wl,-soname,tst-_res1mod2.so
|
||||
$(objpfx)tst-_res1: $(objpfx)tst-_res1mod2.so $(shared-thread-library)
|
||||
$(objpfx)tst-_res1: $(objpfx)tst-_res1mod1.so $(objpfx)tst-_res1mod2.so \
|
||||
$(shared-thread-library)
|
||||
else
|
||||
$(objpfx)tst-cond11: $(common-objpfx)rt/librt.a
|
||||
$(objpfx)tst-cond19: $(common-objpfx)rt/librt.a
|
||||
|
||||
@@ -27,6 +27,7 @@ libc {
|
||||
pthread_cond_broadcast; pthread_cond_timedwait;
|
||||
}
|
||||
GLIBC_PRIVATE {
|
||||
__libc_alloca_cutoff;
|
||||
# Internal libc interface to libpthread
|
||||
__libc_dl_error_tsd;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Determine whether block of given size can be allocated on the stack or not.
|
||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2011 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
|
||||
@@ -34,3 +34,4 @@ __libc_alloca_cutoff (size_t size)
|
||||
assume the maximum available stack space. */
|
||||
?: __MAX_ALLOCA_CUTOFF * 4));
|
||||
}
|
||||
libc_hidden_def (__libc_alloca_cutoff)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002-2007, 2009 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2002-2007, 2009, 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <sys/mman.h>
|
||||
#include <sys/param.h>
|
||||
#include <dl-sysdep.h>
|
||||
#include <dl-tls.h>
|
||||
#include <tls.h>
|
||||
#include <lowlevellock.h>
|
||||
#include <kernel-features.h>
|
||||
@@ -238,6 +239,10 @@ get_cached_stack (size_t *sizep, void **memp)
|
||||
|
||||
/* Clear the DTV. */
|
||||
dtv_t *dtv = GET_DTV (TLS_TPADJ (result));
|
||||
for (size_t cnt = 0; cnt < dtv[-1].counter; ++cnt)
|
||||
if (! dtv[1 + cnt].pointer.is_static
|
||||
&& dtv[1 + cnt].pointer.val != TLS_DTV_UNALLOCATED)
|
||||
free (dtv[1 + cnt].pointer.val);
|
||||
memset (dtv, '\0', (dtv[-1].counter + 1) * sizeof (dtv_t));
|
||||
|
||||
/* Re-initialize the TLS. */
|
||||
@@ -623,7 +628,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
|
||||
{
|
||||
int err;
|
||||
mprot_error:
|
||||
err = errno;
|
||||
err = errno == ENOMEM ? EAGAIN : errno;
|
||||
|
||||
lll_lock (stack_cache_lock, LLL_PRIVATE);
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
ifeq ($(subdir),nptl)
|
||||
CFLAGS-pt-initfini.s += -fno-asynchronous-unwind-tables
|
||||
endif
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009
|
||||
/* Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
@@ -282,6 +282,7 @@ __lll_timedlock_wait:
|
||||
rts
|
||||
mov.l @r15+, r12
|
||||
|
||||
# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
|
||||
.align 2
|
||||
# ifdef PIC
|
||||
.Lgot:
|
||||
@@ -293,7 +294,6 @@ __lll_timedlock_wait:
|
||||
.long __have_futex_clock_realtime
|
||||
# endif
|
||||
|
||||
# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
|
||||
.Lreltmo:
|
||||
/* Check for a valid timeout value. */
|
||||
mov.l @(4,r6), r1
|
||||
|
||||
@@ -96,8 +96,8 @@ ENTRY(__pthread_disable_asynccancel)
|
||||
cmpxchgl %r11d, %fs:CANCELHANDLING
|
||||
jnz 2b
|
||||
|
||||
3: movl %r11d, %eax
|
||||
andl $(TCB_CANCELING_BITMASK|TCB_CANCELED_BITMASK), %eax
|
||||
movl %r11d, %eax
|
||||
3: andl $(TCB_CANCELING_BITMASK|TCB_CANCELED_BITMASK), %eax
|
||||
cmpl $TCB_CANCELING_BITMASK, %eax
|
||||
je 4f
|
||||
1: ret
|
||||
@@ -111,5 +111,6 @@ ENTRY(__pthread_disable_asynccancel)
|
||||
addq $CANCELHANDLING, %rdi
|
||||
LOAD_PRIVATE_FUTEX_WAIT (%esi)
|
||||
syscall
|
||||
movl %fs:CANCELHANDLING, %eax
|
||||
jmp 3b
|
||||
END(__pthread_disable_asynccancel)
|
||||
|
||||
@@ -27,8 +27,9 @@
|
||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||
#define MINIMAL_REST_STACK 2048
|
||||
|
||||
/* Alignment requirement for TCB. */
|
||||
#define TCB_ALIGNMENT 16
|
||||
/* Alignment requirement for TCB. Need to store post-AVX vector registers
|
||||
in the TCB and we want the storage to be aligned at 32-byte. */
|
||||
#define TCB_ALIGNMENT 32
|
||||
|
||||
|
||||
/* Location of current stack frame. The frame pointer is not usable. */
|
||||
|
||||
@@ -117,12 +117,7 @@ typedef struct
|
||||
# define TLS_TCB_SIZE sizeof (struct pthread)
|
||||
|
||||
/* Alignment requirements for the TCB. */
|
||||
//# define TLS_TCB_ALIGN __alignof__ (struct pthread)
|
||||
// Normally the above would be correct But we have to store post-AVX
|
||||
// vector registers in the TCB and we want the storage to be aligned.
|
||||
// unfortunately there isn't yet a type for these values and hence no
|
||||
// 32-byte alignment requirement. Make this explicit, for now.
|
||||
# define TLS_TCB_ALIGN 32
|
||||
# define TLS_TCB_ALIGN __alignof__ (struct pthread)
|
||||
|
||||
/* The TCB can have any size and the memory following the address the
|
||||
thread pointer points to is unspecified. Allocate the TCB there. */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user