Accepting request 208665 from home:Andreas_Schwab:Factory

- Update to glibc 2.18.90 bd12ab55c05e:
  * New locales: ak_GH, anp_IN, ar_SS, cmn_TW, hak_TW, lzh_TW, nan_TW, pap_AW,
    pap_CW, quz_PE, the_NP.
  * Substantially revised locales: gd_GB, ht_HT
  * The LC_ADDRESS field was updated to support country_car for almost all
    supported locales.
  * ISO 1427 definitions were updated.
  * ISO 3166 definitions were updated.
  * The localedef utility now supports --big-endian and --little-endian
    command-line options to generate locales for a different system from that
    for which the C library was built.
  * Binary locale files now only depend on the endianness of the system for
    which they are generated and not on other properties of that system.
  * ISO 639 definitions were updated for Chiga (cgg) and Chinese (gan, hak, czh,
    cjy, lzh, cmn, mnp, cdo, czo, cpx, wuu, hsn, yue).
  * SystemTap probes for malloc have been introduced.
  * Support for powerpc64le has been added.
  * The soft-float powerpc port now supports e500 processors.
- Remove upstreamed patches:
  cbrtl-ldbl-96.patch
  fcntl-o-tmpfile.patch
  getaddrinfo-overflow.patch
  glibc-2.18.tar.xz
  glibc-ld-profile.patch
  glibc-nscd-hconf.diff
  i686-strcasecmp-fallback.patch
  m68k-Scrt1.patch
  malloc-overflows.patch
  nonascii-case.patch
  nss-database.patch

OBS-URL: https://build.opensuse.org/request/show/208665
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=320
This commit is contained in:
Andreas Schwab 2013-11-27 11:31:05 +00:00 committed by Git OBS Bridge
parent a7a5db5322
commit 384789b673
27 changed files with 161 additions and 2534 deletions

View File

@ -1,17 +0,0 @@
[BZ #15749]
* sysdeps/ieee754/ldbl-96/s_cbrtl.c (__cbrtl): Use fabsl instead
of fabs.
Index: glibc-2.17.90/sysdeps/ieee754/ldbl-96/s_cbrtl.c
===================================================================
--- glibc-2.17.90.orig/sysdeps/ieee754/ldbl-96/s_cbrtl.c
+++ glibc-2.17.90/sysdeps/ieee754/ldbl-96/s_cbrtl.c
@@ -45,7 +45,7 @@ __cbrtl (long double x)
int xe;
/* Reduce X. XM now is an range 1.0 to 0.5. */
- xm = __frexpl (fabs (x), &xe);
+ xm = __frexpl (fabsl (x), &xe);
/* If X is not finite or is null return it (with raising exceptions
if necessary.

View File

@ -1,58 +0,0 @@
Index: glibc-2.18/ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
===================================================================
--- glibc-2.18.orig/ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
+++ glibc-2.18/ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
@@ -36,6 +36,7 @@
#define __O_DIRECT 02000000 /* Direct disk access. */
#define __O_NOATIME 04000000 /* Do not set atime. */
#define __O_PATH 040000000 /* Resolve pathname but do not open file. */
+#define __O_TMPFILE 0100100000 /* Atomically create nameless file. */
/* Not necessary, files are always with 64bit off_t. */
#define __O_LARGEFILE 0
Index: glibc-2.18/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
===================================================================
--- glibc-2.18.orig/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
+++ glibc-2.18/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
@@ -37,6 +37,7 @@
#define __O_CLOEXEC 010000000 /* Set close_on_exec. */
#define __O_NOATIME 004000000 /* Do not set atime. */
#define __O_PATH 020000000
+#define __O_TMPFILE 040010000 /* Atomically create nameless file. */
#define __O_LARGEFILE 00004000
Index: glibc-2.18/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
===================================================================
--- glibc-2.18.orig/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
+++ glibc-2.18/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
@@ -96,6 +96,9 @@
#ifndef __O_DSYNC
# define __O_DSYNC 010000
#endif
+#ifndef __O_TMPFILE
+# define __O_TMPFILE 020200000
+#endif
#ifndef F_GETLK
# ifndef __USE_FILE_OFFSET64
@@ -128,6 +131,7 @@
# define O_DIRECT __O_DIRECT /* Direct disk access. */
# define O_NOATIME __O_NOATIME /* Do not set atime. */
# define O_PATH __O_PATH /* Resolve pathname but do not open file. */
+# define O_TMPFILE __O_TMPFILE /* Atomically create nameless file. */
#endif
/* For now, Linux has no separate synchronicitiy options for read
Index: glibc-2.18/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
===================================================================
--- glibc-2.18.orig/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
+++ glibc-2.18/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
@@ -39,6 +39,7 @@
#define __O_DIRECT 0x100000 /* direct disk access hint */
#define __O_NOATIME 0x200000 /* Do not set atime. */
#define __O_PATH 0x1000000 /* Resolve pathname but do not open file. */
+#define __O_TMPFILE 0x2010000 /* Atomically create nameless file. */
#if __WORDSIZE == 64
# define __O_LARGEFILE 0

View File

@ -1,8 +1,8 @@
Index: glibc-2.17.90/sysdeps/posix/getaddrinfo.c
Index: glibc-2.18.90/sysdeps/posix/getaddrinfo.c
===================================================================
--- glibc-2.17.90.orig/sysdeps/posix/getaddrinfo.c
+++ glibc-2.17.90/sysdeps/posix/getaddrinfo.c
@@ -270,7 +270,7 @@ extern service_user *__nss_hosts_databas
--- glibc-2.18.90.orig/sysdeps/posix/getaddrinfo.c
+++ glibc-2.18.90/sysdeps/posix/getaddrinfo.c
@@ -286,7 +286,7 @@ extern service_user *__nss_hosts_databas
static int
gaih_inet (const char *name, const struct gaih_service *service,
const struct addrinfo *req, struct addrinfo **pai,
@ -11,7 +11,7 @@ Index: glibc-2.17.90/sysdeps/posix/getaddrinfo.c
{
const struct gaih_typeproto *tp = gaih_inet_typeproto;
struct gaih_servtuple *st = (struct gaih_servtuple *) &nullserv;
@@ -840,7 +840,10 @@ gaih_inet (const char *name, const struc
@@ -855,7 +855,10 @@ gaih_inet (const char *name, const struc
if (req->ai_family == PF_UNSPEC)
fct4 = __nss_lookup_function (nip, "gethostbyname4_r");
@ -23,7 +23,7 @@ Index: glibc-2.17.90/sysdeps/posix/getaddrinfo.c
{
int herrno;
@@ -943,7 +946,7 @@ gaih_inet (const char *name, const struc
@@ -958,7 +961,7 @@ gaih_inet (const char *name, const struc
if (fct != NULL)
{
if (req->ai_family == AF_INET6
@ -32,7 +32,7 @@ Index: glibc-2.17.90/sysdeps/posix/getaddrinfo.c
{
gethosts (AF_INET6, struct in6_addr);
no_inet6_data = no_data;
@@ -2471,7 +2474,11 @@ getaddrinfo (const char *name, const cha
@@ -2418,7 +2421,11 @@ getaddrinfo (const char *name, const cha
if (hints->ai_family == AF_UNSPEC || hints->ai_family == AF_INET
|| hints->ai_family == AF_INET6)
{

View File

@ -1,44 +0,0 @@
2013-10-25 Siddhesh Poyarekar <siddhesh@redhat.com>
[BZ #16072]
* sysdeps/posix/getaddrinfo.c (gethosts): Allocate tmpbuf on
heap for large requests.
Index: glibc-2.18/sysdeps/posix/getaddrinfo.c
===================================================================
--- glibc-2.18.orig/sysdeps/posix/getaddrinfo.c
+++ glibc-2.18/sysdeps/posix/getaddrinfo.c
@@ -197,7 +197,22 @@ gaih_inet_serv (const char *servicename,
&rc, &herrno, NULL, &localcanon)); \
if (rc != ERANGE || herrno != NETDB_INTERNAL) \
break; \
- tmpbuf = extend_alloca (tmpbuf, tmpbuflen, 2 * tmpbuflen); \
+ if (!malloc_tmpbuf && __libc_use_alloca (alloca_used + 2 * tmpbuflen)) \
+ tmpbuf = extend_alloca_account (tmpbuf, tmpbuflen, 2 * tmpbuflen, \
+ alloca_used); \
+ else \
+ { \
+ char *newp = realloc (malloc_tmpbuf ? tmpbuf : NULL, \
+ 2 * tmpbuflen); \
+ if (newp == NULL) \
+ { \
+ result = -EAI_MEMORY; \
+ goto free_and_return; \
+ } \
+ tmpbuf = newp; \
+ malloc_tmpbuf = true; \
+ tmpbuflen = 2 * tmpbuflen; \
+ } \
} \
if (status == NSS_STATUS_SUCCESS && rc == 0) \
h = &th; \
@@ -209,7 +224,8 @@ gaih_inet_serv (const char *servicename,
{ \
__set_h_errno (herrno); \
_res.options |= old_res_options & RES_USE_INET6; \
- return -EAI_SYSTEM; \
+ result = -EAI_SYSTEM; \
+ goto free_and_return; \
} \
if (herrno == TRY_AGAIN) \
no_data = EAI_AGAIN; \

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:27ce32970ab8633d7a9cf1b11d3787c206b78e19732a53e2f309ba14fedeb561
size 11868220

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2cb4e1e381928f1e5e55e71ab1ba8e0ea7ede75ff9709770435bfd018ea257a3
size 11150148

View File

@ -1,12 +1,11 @@
-------------------------------------------------------------------
Wed Jun 4 14:29:07 CEST 2003 - kukuk@suse.de
- Make --no-archive default for localedef
Index: glibc-2.17.90/locale/programs/localedef.c
Index: glibc-2.18.90/locale/programs/localedef.c
===================================================================
--- glibc-2.17.90.orig/locale/programs/localedef.c
+++ glibc-2.17.90/locale/programs/localedef.c
--- glibc-2.18.90.orig/locale/programs/localedef.c
+++ glibc-2.18.90/locale/programs/localedef.c
@@ -81,7 +81,7 @@ const char *alias_file;
static struct localedef_t *locales;
@ -21,10 +20,10 @@ Index: glibc-2.17.90/locale/programs/localedef.c
#define OPT_DELETE_FROM_ARCHIVE 308
#define OPT_LIST_ARCHIVE 309
+#define OPT_ARCHIVE 310
#define OPT_LITTLE_ENDIAN 400
#define OPT_BIG_ENDIAN 401
/* Definitions of arguments for argp functions. */
static const struct argp_option options[] =
@@ -134,6 +135,8 @@ static const struct argp_option options[
@@ -136,6 +137,8 @@ static const struct argp_option options[
N_("Suppress warnings and information messages") },
{ "verbose", 'v', NULL, 0, N_("Print more messages") },
{ NULL, 0, NULL, 0, N_("Archive control:") },
@ -33,7 +32,7 @@ Index: glibc-2.17.90/locale/programs/localedef.c
{ "no-archive", OPT_NO_ARCHIVE, NULL, 0,
N_("Don't add new data to archive") },
{ "add-to-archive", OPT_ADD_TO_ARCHIVE, NULL, 0,
@@ -311,6 +314,9 @@ parse_opt (int key, char *arg, struct ar
@@ -317,6 +320,9 @@ parse_opt (int key, char *arg, struct ar
case OPT_PREFIX:
output_prefix = arg;
break;

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:10f1db566a96ef0e012c79fc18844593f56424a1e5a7d1b3f6521b2fdc1753e9
size 329284
oid sha256:d2311caa4855d8269d8fae0c3aab97ce9f1a30abea4b40955471adf7b5413b93
size 329303

View File

@ -1,7 +1,7 @@
Index: glibc-2.17.90/intl/locale.alias
Index: glibc-2.18.90/intl/locale.alias
===================================================================
--- glibc-2.17.90.orig/intl/locale.alias
+++ glibc-2.17.90/intl/locale.alias
--- glibc-2.18.90.orig/intl/locale.alias
+++ glibc-2.18.90/intl/locale.alias
@@ -56,8 +56,6 @@ korean ko_KR.eucKR
korean.euc ko_KR.eucKR
ko_KR ko_KR.eucKR
@ -11,11 +11,11 @@ Index: glibc-2.17.90/intl/locale.alias
norwegian nb_NO.ISO-8859-1
nynorsk nn_NO.ISO-8859-1
polish pl_PL.ISO-8859-2
Index: glibc-2.17.90/localedata/SUPPORTED
Index: glibc-2.18.90/localedata/SUPPORTED
===================================================================
--- glibc-2.17.90.orig/localedata/SUPPORTED
+++ glibc-2.17.90/localedata/SUPPORTED
@@ -324,6 +324,8 @@ nl_NL/ISO-8859-1 \
--- glibc-2.18.90.orig/localedata/SUPPORTED
+++ glibc-2.18.90/localedata/SUPPORTED
@@ -331,6 +331,8 @@ nl_NL/ISO-8859-1 \
nl_NL@euro/ISO-8859-15 \
nn_NO.UTF-8/UTF-8 \
nn_NO/ISO-8859-1 \
@ -24,10 +24,10 @@ Index: glibc-2.17.90/localedata/SUPPORTED
nr_ZA/UTF-8 \
nso_ZA/UTF-8 \
oc_FR.UTF-8/UTF-8 \
Index: glibc-2.17.90/localedata/locales/no_NO
Index: glibc-2.18.90/localedata/locales/no_NO
===================================================================
--- /dev/null
+++ glibc-2.17.90/localedata/locales/no_NO
+++ glibc-2.18.90/localedata/locales/no_NO
@@ -0,0 +1,69 @@
+escape_char /
+comment_char %

View File

@ -1,95 +0,0 @@
Index: glibc-2.17.90/locale/iso-4217.def
===================================================================
--- glibc-2.17.90.orig/locale/iso-4217.def
+++ glibc-2.17.90/locale/iso-4217.def
@@ -8,6 +8,7 @@
*
* !!! The list has to be sorted !!!
*/
+DEFINE_INT_CURR("ADP") /* Andorran Peseta -> EUR */
DEFINE_INT_CURR("AED") /* United Arab Emirates Dirham */
DEFINE_INT_CURR("AFN") /* Afghanistan Afgani */
DEFINE_INT_CURR("ALL") /* Albanian Lek */
@@ -15,12 +16,14 @@ DEFINE_INT_CURR("AMD") /* Armenia Dram
DEFINE_INT_CURR("ANG") /* Netherlands Antilles */
DEFINE_INT_CURR("AOA") /* Angolan Kwanza */
DEFINE_INT_CURR("ARS") /* Argentine Peso */
+DEFINE_INT_CURR("ATS") /* Austrian Schilling -> EUR */
DEFINE_INT_CURR("AUD") /* Australian Dollar */
DEFINE_INT_CURR("AWG") /* Aruba Guilder */
DEFINE_INT_CURR("AZM") /* Azerbaijan Manat */
DEFINE_INT_CURR("BAM") /* Bosnian and Herzegovina Convertible Mark */
DEFINE_INT_CURR("BBD") /* Barbados Dollar */
DEFINE_INT_CURR("BDT") /* Bangladesh Taka */
+DEFINE_INT_CURR("BEF") /* Belgian Franc -> EUR */
DEFINE_INT_CURR("BGN") /* Bulgarian Lev */
DEFINE_INT_CURR("BHD") /* Bahraini Dinar */
DEFINE_INT_CURR("BIF") /* Burundi Franc */
@@ -44,6 +47,7 @@ DEFINE_INT_CURR("CUP") /* Cuban Peso *
DEFINE_INT_CURR("CVE") /* Cape Verde Escudo */
DEFINE_INT_CURR("CYP") /* Cypriot Pound */
DEFINE_INT_CURR("CZK") /* Czech Koruna */
+DEFINE_INT_CURR("DEM") /* German Mark -> EUR */
DEFINE_INT_CURR("DJF") /* Djibouti Franc */
DEFINE_INT_CURR("DKK") /* Danish Krone (Faroe Islands, Greenland) */
DEFINE_INT_CURR("DOP") /* Dominican Republic */
@@ -51,16 +55,20 @@ DEFINE_INT_CURR("DZD") /* Algerian Dina
DEFINE_INT_CURR("EEK") /* Estonian Kroon */
DEFINE_INT_CURR("EGP") /* Egyptian Pound */
DEFINE_INT_CURR("ERN") /* Eritrean Nakfa */
+DEFINE_INT_CURR("ESP") /* Spanish Peseta -> EUR */
DEFINE_INT_CURR("ETB") /* Ethiopian Birr */
DEFINE_INT_CURR("EUR") /* European Union Euro */
+DEFINE_INT_CURR("FIM") /* Finnish Markka -> EUR */
DEFINE_INT_CURR("FJD") /* Fiji Dollar */
DEFINE_INT_CURR("FKP") /* Falkland Islands Pound (Malvinas) */
+DEFINE_INT_CURR("FRF") /* French Franc -> EUR */
DEFINE_INT_CURR("GBP") /* British Pound */
DEFINE_INT_CURR("GEL") /* Georgia Lari */
DEFINE_INT_CURR("GHC") /* Ghana Cedi */
DEFINE_INT_CURR("GIP") /* Gibraltar Pound */
DEFINE_INT_CURR("GMD") /* Gambian Dalasi */
DEFINE_INT_CURR("GNF") /* Guinea Franc */
+DEFINE_INT_CURR("GRD") /* Greek Drachma -> EUR */
DEFINE_INT_CURR("GTQ") /* Guatemala Quetzal */
DEFINE_INT_CURR("GYD") /* Guyana Dollar */
DEFINE_INT_CURR("HKD") /* Hong Kong Dollar */
@@ -69,12 +77,14 @@ DEFINE_INT_CURR("HRK") /* Croatia Kuna
DEFINE_INT_CURR("HTG") /* Haiti Gourde */
DEFINE_INT_CURR("HUF") /* Hungarian Forint */
DEFINE_INT_CURR("IDR") /* Indonesia Rupiah */
+DEFINE_INT_CURR("IEP") /* Irish Pound -> EUR */
DEFINE_INT_CURR("ILS") /* Israeli Shekel */
DEFINE_INT_CURR("IMP") /* Isle of Man Pounds */
DEFINE_INT_CURR("INR") /* Indian Rupee (Bhutan) */
DEFINE_INT_CURR("IQD") /* Iraqi Dinar */
DEFINE_INT_CURR("IRR") /* Iranian Rial */
DEFINE_INT_CURR("ISK") /* Iceland Krona */
+DEFINE_INT_CURR("ITL") /* Italian Lira -> EUR */
DEFINE_INT_CURR("JEP") /* Jersey Pound */
DEFINE_INT_CURR("JMD") /* Jamaican Dollar */
DEFINE_INT_CURR("JOD") /* Jordanian Dinar */
@@ -94,6 +104,7 @@ DEFINE_INT_CURR("LKR") /* Sri Lankan Ru
DEFINE_INT_CURR("LRD") /* Liberian Dollar */
DEFINE_INT_CURR("LSL") /* Lesotho Maloti */
DEFINE_INT_CURR("LTL") /* Lithuanian Litas */
+DEFINE_INT_CURR("LUF") /* Luxembourg Franc -> EUR */
DEFINE_INT_CURR("LVL") /* Latvia Lat */
DEFINE_INT_CURR("LYD") /* Libyan Arab Jamahiriya Dinar */
DEFINE_INT_CURR("MAD") /* Moroccan Dirham */
@@ -114,6 +125,7 @@ DEFINE_INT_CURR("MZM") /* Mozambique Me
DEFINE_INT_CURR("NAD") /* Namibia Dollar */
DEFINE_INT_CURR("NGN") /* Nigeria Naira */
DEFINE_INT_CURR("NIO") /* Nicaragua Cordoba Oro */
+DEFINE_INT_CURR("NLG") /* Netherlands Guilder -> EUR */
DEFINE_INT_CURR("NOK") /* Norwegian Krone */
DEFINE_INT_CURR("NPR") /* Nepalese Rupee */
DEFINE_INT_CURR("NZD") /* New Zealand Dollar */
@@ -124,6 +136,7 @@ DEFINE_INT_CURR("PGK") /* Papau New Gui
DEFINE_INT_CURR("PHP") /* Philippines Peso */
DEFINE_INT_CURR("PKR") /* Pakistan Rupee */
DEFINE_INT_CURR("PLN") /* Polish Zloty */
+DEFINE_INT_CURR("PTE") /* Portugese Escudo -> EUR */
DEFINE_INT_CURR("PYG") /* Paraguay Guarani */
DEFINE_INT_CURR("QAR") /* Qatar Rial */
DEFINE_INT_CURR("ROL") /* Romanian Leu */

View File

@ -1,79 +0,0 @@
glibc bug #13818
2012-03-07 Jeff Law <law@redhat.com>
* elf/dl-reloc.c (_dl_relocate_object): Move code to allocate
l_reloc_result prior to calling ELF_DYNAMIC_RELOCATE.
diff -rup a/elf/dl-reloc.c b/elf/dl-reloc.c
--- a/elf/dl-reloc.c 2012-01-01 05:16:32.000000000 -0700
+++ b/elf/dl-reloc.c 2012-03-06 15:41:56.486242640 -0700
@@ -238,32 +238,9 @@ _dl_relocate_object (struct link_map *l,
/* String table object symbols. */
const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]);
- /* This macro is used as a callback from the ELF_DYNAMIC_RELOCATE code. */
-#define RESOLVE_MAP(ref, version, r_type) \
- (ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \
- ? ((__builtin_expect ((*ref) == l->l_lookup_cache.sym, 0) \
- && elf_machine_type_class (r_type) == l->l_lookup_cache.type_class) \
- ? (bump_num_cache_relocations (), \
- (*ref) = l->l_lookup_cache.ret, \
- l->l_lookup_cache.value) \
- : ({ lookup_t _lr; \
- int _tc = elf_machine_type_class (r_type); \
- l->l_lookup_cache.type_class = _tc; \
- l->l_lookup_cache.sym = (*ref); \
- const struct r_found_version *v = NULL; \
- if ((version) != NULL && (version)->hash != 0) \
- v = (version); \
- _lr = _dl_lookup_symbol_x (strtab + (*ref)->st_name, l, (ref), \
- scope, v, _tc, \
- DL_LOOKUP_ADD_DEPENDENCY, NULL); \
- l->l_lookup_cache.ret = (*ref); \
- l->l_lookup_cache.value = _lr; })) \
- : l)
-
-#include "dynamic-link.h"
-
- ELF_DYNAMIC_RELOCATE (l, lazy, consider_profiling, skip_ifunc);
-
+ /* ELF_DYNAMIC_RELOCATE may need to examine l_reloc_result
+ when handling MACHINE_IRELATIVE relocs. So we must
+ allocate l_reloc_result prior to calling ELF_DYNAMIC_RELOCATE. */
#ifndef PROF
if (__builtin_expect (consider_profiling, 0))
{
@@ -290,6 +267,32 @@ _dl_relocate_object (struct link_map *l,
}
}
#endif
+
+ /* This macro is used as a callback from the ELF_DYNAMIC_RELOCATE code. */
+#define RESOLVE_MAP(ref, version, r_type) \
+ (ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \
+ ? ((__builtin_expect ((*ref) == l->l_lookup_cache.sym, 0) \
+ && elf_machine_type_class (r_type) == l->l_lookup_cache.type_class) \
+ ? (bump_num_cache_relocations (), \
+ (*ref) = l->l_lookup_cache.ret, \
+ l->l_lookup_cache.value) \
+ : ({ lookup_t _lr; \
+ int _tc = elf_machine_type_class (r_type); \
+ l->l_lookup_cache.type_class = _tc; \
+ l->l_lookup_cache.sym = (*ref); \
+ const struct r_found_version *v = NULL; \
+ if ((version) != NULL && (version)->hash != 0) \
+ v = (version); \
+ _lr = _dl_lookup_symbol_x (strtab + (*ref)->st_name, l, (ref), \
+ scope, v, _tc, \
+ DL_LOOKUP_ADD_DEPENDENCY, NULL); \
+ l->l_lookup_cache.ret = (*ref); \
+ l->l_lookup_cache.value = _lr; })) \
+ : l)
+
+#include "dynamic-link.h"
+
+ ELF_DYNAMIC_RELOCATE (l, lazy, consider_profiling, skip_ifunc);
}
/* Mark the object so we know this work has been done. */

View File

@ -1,38 +0,0 @@
See:
http://sourceware.org/bugzilla/show_bug.cgi?id=11928
Index: glibc-2.17.90/nscd/aicache.c
===================================================================
--- glibc-2.17.90.orig/nscd/aicache.c
+++ glibc-2.17.90/nscd/aicache.c
@@ -25,6 +25,7 @@
#include <time.h>
#include <unistd.h>
#include <sys/mman.h>
+#include <resolv/res_hconf.h>
#include "dbg_log.h"
#include "nscd.h"
@@ -102,6 +103,8 @@ addhstaiX (struct database_dyn *db, int
if (__res_maybe_init (&_res, 0) == -1)
no_more = 1;
+ if (!_res_hconf.initialized)
+ _res_hconf_init ();
/* If we are looking for both IPv4 and IPv6 address we don't want
the lookup functions to automatically promote IPv4 addresses to
Index: glibc-2.17.90/resolv/res_hconf.c
===================================================================
--- glibc-2.17.90.orig/resolv/res_hconf.c
+++ glibc-2.17.90/resolv/res_hconf.c
@@ -81,7 +81,9 @@ static const struct cmd
};
/* Structure containing the state. */
+#ifndef NOT_IN_libc
struct hconf _res_hconf;
+#endif
/* Skip white space. */
static const char *

View File

@ -1,3 +1,42 @@
-------------------------------------------------------------------
Mon Nov 25 13:59:52 UTC 2013 - schwab@suse.de
- Update to glibc 2.18.90 bd12ab55c05e:
* New locales: ak_GH, anp_IN, ar_SS, cmn_TW, hak_TW, lzh_TW, nan_TW, pap_AW,
pap_CW, quz_PE, the_NP.
* Substantially revised locales: gd_GB, ht_HT
* The LC_ADDRESS field was updated to support country_car for almost all
supported locales.
* ISO 1427 definitions were updated.
* ISO 3166 definitions were updated.
* The localedef utility now supports --big-endian and --little-endian
command-line options to generate locales for a different system from that
for which the C library was built.
* Binary locale files now only depend on the endianness of the system for
which they are generated and not on other properties of that system.
* ISO 639 definitions were updated for Chiga (cgg) and Chinese (gan, hak, czh,
cjy, lzh, cmn, mnp, cdo, czo, cpx, wuu, hsn, yue).
* SystemTap probes for malloc have been introduced.
* Support for powerpc64le has been added.
* The soft-float powerpc port now supports e500 processors.
- Remove upstreamed patches:
cbrtl-ldbl-96.patch
fcntl-o-tmpfile.patch
getaddrinfo-overflow.patch
glibc-2.18.tar.xz
glibc-ld-profile.patch
glibc-nscd-hconf.diff
i686-strcasecmp-fallback.patch
m68k-Scrt1.patch
malloc-overflows.patch
nonascii-case.patch
nss-database.patch
printf-overrun.patch
readdir_r-overflow.patch
strcoll-overflow.patch
- Remove obsolete patches:
glibc-2.4.90-revert-only-euro.diff
-------------------------------------------------------------------
Wed Oct 30 14:05:30 UTC 2013 - schwab@suse.de

View File

@ -106,14 +106,14 @@ BuildRequires: gd-devel
# 2.6.16 is the SLES 10 kernel, use this as oldest supported kernel
%define enablekernel 2.6.16
%endif
Version: 2.18
Version: 2.18.90
Release: 0
%define glibc_major_version 2.18
%define git_id %{nil}
%define glibc_major_version 2.18.90
%define git_id bd12ab55c05e
Url: http://www.gnu.org/software/libc/libc.html
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#Source: glibc-%{version}-%{git_id}.tar.xz
Source: http://ftp.gnu.org/pub/gnu/glibc/glibc-%{version}.tar.xz
Source: glibc-%{version}-%{git_id}.tar.xz
#Source: http://ftp.gnu.org/pub/gnu/glibc/glibc-%{version}.tar.xz
Source3: noversion.tar.bz2
Source4: manpages.tar.bz2
Source5: nsswitch.conf
@ -217,8 +217,6 @@ Patch20: i686-no-sse42-strstr.patch
### Locale related patches
# PATCH-FIX-OPENSUSE Add additional locales
Patch100: glibc-2.3.locales.diff.bz2
# PATCH-FIX-OPENSUSE Support pre-EURO currencies (XXX: Still needed?)
Patch101: glibc-2.4.90-revert-only-euro.diff
# PATCH-FIX-OPENSUSE -- Add no_NO back (XXX: Still needed?)
Patch102: glibc-2.4.90-no_NO.diff
# PATCH-FIX-OPENSUSE -- Renames for China
@ -236,44 +234,18 @@ Patch301: glibc-2.2-sunrpc.diff
Patch302: getaddrinfo-ipv6-sanity.diff
# PATCH-FIX-OPENSUSE Warn about usage of mdns in resolv.conv
Patch304: glibc-resolv-mdnshint.diff
# PATCH-FIX-OPENSUSE nscd does not account for 'multi on' in /etc/host.conf when ai-resolving host bso#11928
Patch305: glibc-nscd-hconf.diff
# PATCH-FIX-OPENSUSE disable rewriting ::1 to 127.0.0.1 for /etc/hosts bnc#684534, bnc#706719
Patch306: glibc-fix-double-loopback.diff
###
# Patches from upstream
###
# PATCH-FIX-UPSTREAM Add O_TMPFILE to <fcntl.h>
Patch1000: fcntl-o-tmpfile.patch
# PATCH-FIX-UPSTREAM Integer overflows in malloc
Patch1001: malloc-overflows.patch
# PATCH-FIX-UPSTREAM m68k: Use PIC for Scrt1.o
Patch1002: m68k-Scrt1.patch
# PATCH-FIX-UPSTREAM Fix stack overflow due to large AF_INET6 requests (CVE-2013-4458)
Patch1003: getaddrinfo-overflow.patch
###
# Patches awaiting upstream approval
###
# PATCH-FIX-UPSTREAM Fix LD_PROFILE (glibc bug#13818) - aj@suse.de
Patch2008: glibc-ld-profile.patch
# PATCH-FIX-UPSTREAM Properly cache the result from looking up the nss database config
Patch2013: nss-database.patch
# PATCH-FIX-UPSTREAM Revert problematic fixes for [BZ #11741]
Patch2015: printf-overrun.patch
# PATCH-FIX-UPSTREAM Fix strcasecmp for tr_TR.ISO-8859-9
Patch2017: nonascii-case.patch
# PATCH-FIX-UPSTREAM Fix fallback in i686 strcasecmp/strncasecmp
Patch2018: i686-strcasecmp-fallback.patch
# PATCH-FIX-UPSTREAM Fix pldd not to leave process stopped after detaching
Patch2019: pldd-wait-ptrace-stop.patch
# PATCH-FIX-UPSTREAM Fix cbrtl for ldbl-96
Patch2020: cbrtl-ldbl-96.patch
# PATCH-FIX-UPSTREAM Fix buffer overflow in strcoll (CVE-2012-4412)
Patch2021: strcoll-overflow.patch
# PATCH-FIX-UPSTREAM Fix readdir_r with long file names (CVE-2013-4237)
Patch2022: readdir_r-overflow.patch
# Non-glibc patches
# PATCH-FIX-OPENSUSE Remove debianisms from manpages
@ -466,7 +438,6 @@ rm nscd/s-stamp
%patch20 -p1
%patch100 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
@ -474,24 +445,9 @@ rm nscd/s-stamp
%patch301 -p1
%patch302 -p1
%patch304 -p1
%patch305 -p1
%patch306 -p1
%patch1000 -p1
%patch1001 -p1
%patch1002 -p1
%patch1003 -p1
# XXX Disable, it breaks the testsuite, test elf/tst-audit2
# %patch2008 -p1
%patch2013 -p1
%patch2015 -p1
%patch2017 -p1
%patch2018 -p1
%patch2019 -p1
%patch2020 -p1
%patch2021 -p1
%patch2022 -p1
%patch3000

View File

@ -1,3 +1,42 @@
-------------------------------------------------------------------
Mon Nov 25 13:59:52 UTC 2013 - schwab@suse.de
- Update to glibc 2.18.90 bd12ab55c05e:
* New locales: ak_GH, anp_IN, ar_SS, cmn_TW, hak_TW, lzh_TW, nan_TW, pap_AW,
pap_CW, quz_PE, the_NP.
* Substantially revised locales: gd_GB, ht_HT
* The LC_ADDRESS field was updated to support country_car for almost all
supported locales.
* ISO 1427 definitions were updated.
* ISO 3166 definitions were updated.
* The localedef utility now supports --big-endian and --little-endian
command-line options to generate locales for a different system from that
for which the C library was built.
* Binary locale files now only depend on the endianness of the system for
which they are generated and not on other properties of that system.
* ISO 639 definitions were updated for Chiga (cgg) and Chinese (gan, hak, czh,
cjy, lzh, cmn, mnp, cdo, czo, cpx, wuu, hsn, yue).
* SystemTap probes for malloc have been introduced.
* Support for powerpc64le has been added.
* The soft-float powerpc port now supports e500 processors.
- Remove upstreamed patches:
cbrtl-ldbl-96.patch
fcntl-o-tmpfile.patch
getaddrinfo-overflow.patch
glibc-2.18.tar.xz
glibc-ld-profile.patch
glibc-nscd-hconf.diff
i686-strcasecmp-fallback.patch
m68k-Scrt1.patch
malloc-overflows.patch
nonascii-case.patch
nss-database.patch
printf-overrun.patch
readdir_r-overflow.patch
strcoll-overflow.patch
- Remove obsolete patches:
glibc-2.4.90-revert-only-euro.diff
-------------------------------------------------------------------
Wed Oct 30 14:05:30 UTC 2013 - schwab@suse.de

View File

@ -105,14 +105,14 @@ BuildRequires: gd-devel
# 2.6.16 is the SLES 10 kernel, use this as oldest supported kernel
%define enablekernel 2.6.16
%endif
Version: 2.18
Version: 2.18.90
Release: 0
%define glibc_major_version 2.18
%define git_id %{nil}
%define glibc_major_version 2.18.90
%define git_id bd12ab55c05e
Url: http://www.gnu.org/software/libc/libc.html
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#Source: glibc-%{version}-%{git_id}.tar.xz
Source: http://ftp.gnu.org/pub/gnu/glibc/glibc-%{version}.tar.xz
Source: glibc-%{version}-%{git_id}.tar.xz
#Source: http://ftp.gnu.org/pub/gnu/glibc/glibc-%{version}.tar.xz
Source3: noversion.tar.bz2
Source4: manpages.tar.bz2
Source5: nsswitch.conf
@ -216,8 +216,6 @@ Patch20: i686-no-sse42-strstr.patch
### Locale related patches
# PATCH-FIX-OPENSUSE Add additional locales
Patch100: glibc-2.3.locales.diff.bz2
# PATCH-FIX-OPENSUSE Support pre-EURO currencies (XXX: Still needed?)
Patch101: glibc-2.4.90-revert-only-euro.diff
# PATCH-FIX-OPENSUSE -- Add no_NO back (XXX: Still needed?)
Patch102: glibc-2.4.90-no_NO.diff
# PATCH-FIX-OPENSUSE -- Renames for China
@ -235,44 +233,18 @@ Patch301: glibc-2.2-sunrpc.diff
Patch302: getaddrinfo-ipv6-sanity.diff
# PATCH-FIX-OPENSUSE Warn about usage of mdns in resolv.conv
Patch304: glibc-resolv-mdnshint.diff
# PATCH-FIX-OPENSUSE nscd does not account for 'multi on' in /etc/host.conf when ai-resolving host bso#11928
Patch305: glibc-nscd-hconf.diff
# PATCH-FIX-OPENSUSE disable rewriting ::1 to 127.0.0.1 for /etc/hosts bnc#684534, bnc#706719
Patch306: glibc-fix-double-loopback.diff
###
# Patches from upstream
###
# PATCH-FIX-UPSTREAM Add O_TMPFILE to <fcntl.h>
Patch1000: fcntl-o-tmpfile.patch
# PATCH-FIX-UPSTREAM Integer overflows in malloc
Patch1001: malloc-overflows.patch
# PATCH-FIX-UPSTREAM m68k: Use PIC for Scrt1.o
Patch1002: m68k-Scrt1.patch
# PATCH-FIX-UPSTREAM Fix stack overflow due to large AF_INET6 requests (CVE-2013-4458)
Patch1003: getaddrinfo-overflow.patch
###
# Patches awaiting upstream approval
###
# PATCH-FIX-UPSTREAM Fix LD_PROFILE (glibc bug#13818) - aj@suse.de
Patch2008: glibc-ld-profile.patch
# PATCH-FIX-UPSTREAM Properly cache the result from looking up the nss database config
Patch2013: nss-database.patch
# PATCH-FIX-UPSTREAM Revert problematic fixes for [BZ #11741]
Patch2015: printf-overrun.patch
# PATCH-FIX-UPSTREAM Fix strcasecmp for tr_TR.ISO-8859-9
Patch2017: nonascii-case.patch
# PATCH-FIX-UPSTREAM Fix fallback in i686 strcasecmp/strncasecmp
Patch2018: i686-strcasecmp-fallback.patch
# PATCH-FIX-UPSTREAM Fix pldd not to leave process stopped after detaching
Patch2019: pldd-wait-ptrace-stop.patch
# PATCH-FIX-UPSTREAM Fix cbrtl for ldbl-96
Patch2020: cbrtl-ldbl-96.patch
# PATCH-FIX-UPSTREAM Fix buffer overflow in strcoll (CVE-2012-4412)
Patch2021: strcoll-overflow.patch
# PATCH-FIX-UPSTREAM Fix readdir_r with long file names (CVE-2013-4237)
Patch2022: readdir_r-overflow.patch
# Non-glibc patches
# PATCH-FIX-OPENSUSE Remove debianisms from manpages
@ -466,7 +438,6 @@ rm nscd/s-stamp
%patch20 -p1
%patch100 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
@ -474,24 +445,9 @@ rm nscd/s-stamp
%patch301 -p1
%patch302 -p1
%patch304 -p1
%patch305 -p1
%patch306 -p1
%patch1000 -p1
%patch1001 -p1
%patch1002 -p1
%patch1003 -p1
# XXX Disable, it breaks the testsuite, test elf/tst-audit2
# %patch2008 -p1
%patch2013 -p1
%patch2015 -p1
%patch2017 -p1
%patch2018 -p1
%patch2019 -p1
%patch2020 -p1
%patch2021 -p1
%patch2022 -p1
%patch3000

View File

@ -1,3 +1,42 @@
-------------------------------------------------------------------
Mon Nov 25 13:59:52 UTC 2013 - schwab@suse.de
- Update to glibc 2.18.90 bd12ab55c05e:
* New locales: ak_GH, anp_IN, ar_SS, cmn_TW, hak_TW, lzh_TW, nan_TW, pap_AW,
pap_CW, quz_PE, the_NP.
* Substantially revised locales: gd_GB, ht_HT
* The LC_ADDRESS field was updated to support country_car for almost all
supported locales.
* ISO 1427 definitions were updated.
* ISO 3166 definitions were updated.
* The localedef utility now supports --big-endian and --little-endian
command-line options to generate locales for a different system from that
for which the C library was built.
* Binary locale files now only depend on the endianness of the system for
which they are generated and not on other properties of that system.
* ISO 639 definitions were updated for Chiga (cgg) and Chinese (gan, hak, czh,
cjy, lzh, cmn, mnp, cdo, czo, cpx, wuu, hsn, yue).
* SystemTap probes for malloc have been introduced.
* Support for powerpc64le has been added.
* The soft-float powerpc port now supports e500 processors.
- Remove upstreamed patches:
cbrtl-ldbl-96.patch
fcntl-o-tmpfile.patch
getaddrinfo-overflow.patch
glibc-2.18.tar.xz
glibc-ld-profile.patch
glibc-nscd-hconf.diff
i686-strcasecmp-fallback.patch
m68k-Scrt1.patch
malloc-overflows.patch
nonascii-case.patch
nss-database.patch
printf-overrun.patch
readdir_r-overflow.patch
strcoll-overflow.patch
- Remove obsolete patches:
glibc-2.4.90-revert-only-euro.diff
-------------------------------------------------------------------
Wed Oct 30 14:05:30 UTC 2013 - schwab@suse.de

View File

@ -106,14 +106,14 @@ BuildRequires: gd-devel
# 2.6.16 is the SLES 10 kernel, use this as oldest supported kernel
%define enablekernel 2.6.16
%endif
Version: 2.18
Version: 2.18.90
Release: 0
%define glibc_major_version 2.18
%define git_id %{nil}
%define glibc_major_version 2.18.90
%define git_id bd12ab55c05e
Url: http://www.gnu.org/software/libc/libc.html
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#Source: glibc-%{version}-%{git_id}.tar.xz
Source: http://ftp.gnu.org/pub/gnu/glibc/glibc-%{version}.tar.xz
Source: glibc-%{version}-%{git_id}.tar.xz
#Source: http://ftp.gnu.org/pub/gnu/glibc/glibc-%{version}.tar.xz
Source3: noversion.tar.bz2
Source4: manpages.tar.bz2
Source5: nsswitch.conf
@ -217,8 +217,6 @@ Patch20: i686-no-sse42-strstr.patch
### Locale related patches
# PATCH-FIX-OPENSUSE Add additional locales
Patch100: glibc-2.3.locales.diff.bz2
# PATCH-FIX-OPENSUSE Support pre-EURO currencies (XXX: Still needed?)
Patch101: glibc-2.4.90-revert-only-euro.diff
# PATCH-FIX-OPENSUSE -- Add no_NO back (XXX: Still needed?)
Patch102: glibc-2.4.90-no_NO.diff
# PATCH-FIX-OPENSUSE -- Renames for China
@ -236,44 +234,18 @@ Patch301: glibc-2.2-sunrpc.diff
Patch302: getaddrinfo-ipv6-sanity.diff
# PATCH-FIX-OPENSUSE Warn about usage of mdns in resolv.conv
Patch304: glibc-resolv-mdnshint.diff
# PATCH-FIX-OPENSUSE nscd does not account for 'multi on' in /etc/host.conf when ai-resolving host bso#11928
Patch305: glibc-nscd-hconf.diff
# PATCH-FIX-OPENSUSE disable rewriting ::1 to 127.0.0.1 for /etc/hosts bnc#684534, bnc#706719
Patch306: glibc-fix-double-loopback.diff
###
# Patches from upstream
###
# PATCH-FIX-UPSTREAM Add O_TMPFILE to <fcntl.h>
Patch1000: fcntl-o-tmpfile.patch
# PATCH-FIX-UPSTREAM Integer overflows in malloc
Patch1001: malloc-overflows.patch
# PATCH-FIX-UPSTREAM m68k: Use PIC for Scrt1.o
Patch1002: m68k-Scrt1.patch
# PATCH-FIX-UPSTREAM Fix stack overflow due to large AF_INET6 requests (CVE-2013-4458)
Patch1003: getaddrinfo-overflow.patch
###
# Patches awaiting upstream approval
###
# PATCH-FIX-UPSTREAM Fix LD_PROFILE (glibc bug#13818) - aj@suse.de
Patch2008: glibc-ld-profile.patch
# PATCH-FIX-UPSTREAM Properly cache the result from looking up the nss database config
Patch2013: nss-database.patch
# PATCH-FIX-UPSTREAM Revert problematic fixes for [BZ #11741]
Patch2015: printf-overrun.patch
# PATCH-FIX-UPSTREAM Fix strcasecmp for tr_TR.ISO-8859-9
Patch2017: nonascii-case.patch
# PATCH-FIX-UPSTREAM Fix fallback in i686 strcasecmp/strncasecmp
Patch2018: i686-strcasecmp-fallback.patch
# PATCH-FIX-UPSTREAM Fix pldd not to leave process stopped after detaching
Patch2019: pldd-wait-ptrace-stop.patch
# PATCH-FIX-UPSTREAM Fix cbrtl for ldbl-96
Patch2020: cbrtl-ldbl-96.patch
# PATCH-FIX-UPSTREAM Fix buffer overflow in strcoll (CVE-2012-4412)
Patch2021: strcoll-overflow.patch
# PATCH-FIX-UPSTREAM Fix readdir_r with long file names (CVE-2013-4237)
Patch2022: readdir_r-overflow.patch
# Non-glibc patches
# PATCH-FIX-OPENSUSE Remove debianisms from manpages
@ -466,7 +438,6 @@ rm nscd/s-stamp
%patch20 -p1
%patch100 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
@ -474,24 +445,9 @@ rm nscd/s-stamp
%patch301 -p1
%patch302 -p1
%patch304 -p1
%patch305 -p1
%patch306 -p1
%patch1000 -p1
%patch1001 -p1
%patch1002 -p1
%patch1003 -p1
# XXX Disable, it breaks the testsuite, test elf/tst-audit2
# %patch2008 -p1
%patch2013 -p1
%patch2015 -p1
%patch2017 -p1
%patch2018 -p1
%patch2019 -p1
%patch2020 -p1
%patch2021 -p1
%patch2022 -p1
%patch3000

View File

@ -89,7 +89,7 @@ Index: glibc-2.18/sysdeps/i386/i686/multiarch/strstr-c.c
-#include "init-arch.h"
-
-#define STRSTR __strstr_ia32
-#if defined SHARED && defined DO_VERSIONING && !defined NO_HIDDEN
-#if defined SHARED && !defined NO_HIDDEN
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name) \
- __hidden_ver1 (__strstr_ia32, __GI_strstr, __strstr_ia32);

View File

@ -1,74 +0,0 @@
* sysdeps/i386/i686/multiarch/strcmp-sse4.S (__strcasecmp_sse4_2)
(__strncasecmp_sse4_2) [PIC]: Restore %ebx before falling through
to __strcasecmp_nonascii and __strncasecmp_nonascii.
* sysdeps/i386/i686/multiarch/strcmp-ssse3.S (__strcasecmp_ssse3)
(__strncasecmp_ssse3) [PIC]: Likewise.
Index: glibc-2.17.90/sysdeps/i386/i686/multiarch/strcmp-sse4.S
===================================================================
--- glibc-2.17.90.orig/sysdeps/i386/i686/multiarch/strcmp-sse4.S
+++ glibc-2.17.90/sysdeps/i386/i686/multiarch/strcmp-sse4.S
@@ -121,8 +121,14 @@ ENTRY (__strcasecmp_sse4_2)
movl (%eax), %eax
# endif
testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%eax)
+# ifdef PIC
+ je L(ascii)
+ POP (%ebx)
+ jmp __strcasecmp_nonascii
+# else
jne __strcasecmp_nonascii
jmp L(ascii)
+# endif
END (__strcasecmp_sse4_2)
#endif
@@ -152,8 +158,14 @@ ENTRY (__strncasecmp_sse4_2)
movl (%eax), %eax
# endif
testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%eax)
+# ifdef PIC
+ je L(ascii)
+ POP (%ebx)
+ jmp __strncasecmp_nonascii
+# else
jne __strncasecmp_nonascii
jmp L(ascii)
+# endif
END (__strncasecmp_sse4_2)
#endif
Index: glibc-2.17.90/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
===================================================================
--- glibc-2.17.90.orig/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
+++ glibc-2.17.90/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
@@ -138,8 +138,14 @@ ENTRY (__strcasecmp_ssse3)
movl (%eax), %eax
# endif
testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%eax)
+# ifdef PIC
+ je L(ascii)
+ POP (%ebx)
+ jmp __strcasecmp_nonascii
+# else
jne __strcasecmp_nonascii
jmp L(ascii)
+# endif
END (__strcasecmp_ssse3)
#endif
@@ -169,8 +175,14 @@ ENTRY (__strncasecmp_ssse3)
movl (%eax), %eax
# endif
testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%eax)
+# ifdef PIC
+ je L(ascii)
+ POP (%ebx)
+ jmp __strncasecmp_nonascii
+# else
jne __strncasecmp_nonascii
jmp L(ascii)
+# endif
END (__strncasecmp_ssse3)
#endif

View File

@ -1,50 +0,0 @@
2013-10-08 Andreas Schwab <schwab@suse.de>
* sysdeps/m68k/start.S [SHARED]: Use PIC.
Index: glibc-2.18/ports/sysdeps/m68k/start.S
===================================================================
--- glibc-2.18.orig/ports/sysdeps/m68k/start.S
+++ glibc-2.18/ports/sysdeps/m68k/start.S
@@ -52,6 +52,8 @@
NULL
*/
+#include <sysdep.h>
+
.text
.globl _start
.type _start,@function
@@ -74,6 +76,24 @@ _start:
pea (%a1) /* Push address of the shared library
termination function. */
+#ifdef SHARED
+ /* Load PIC register. */
+ LOAD_GOT (%a5)
+
+ /* Push the address of our own entry points to `.fini' and
+ `.init'. */
+ move.l __libc_csu_fini@GOT(%a5), -(%sp)
+ move.l __libc_csu_init@GOT(%a5), -(%sp)
+
+ pea (%a0) /* Push second argument: argv. */
+ move.l %d0, -(%sp) /* Push first argument: argc. */
+
+ move.l main@GOT(%a5), -(%sp)
+
+ /* Call the user's main function, and exit with its value. But
+ let the libc call main. */
+ jbsr __libc_start_main@PLTPC
+#else
/* Push the address of our own entry points to `.fini' and
`.init'. */
pea __libc_csu_fini
@@ -87,6 +107,7 @@ _start:
/* Call the user's main function, and exit with its value. But
let the libc call main. */
jbsr __libc_start_main
+#endif
illegal /* Crash if somehow `exit' does return. */

View File

@ -1,60 +0,0 @@
2013-09-11 Will Newton <will.newton@linaro.org>
[BZ #15857]
* malloc/malloc.c (__libc_memalign): Check the value of bytes
does not overflow.
[BZ #15856]
* malloc/malloc.c (__libc_valloc): Check the value of bytes
does not overflow.
[BZ #15855]
* malloc/malloc.c (__libc_pvalloc): Check the value of bytes
does not overflow.
Index: glibc-2.18/malloc/malloc.c
===================================================================
--- glibc-2.18.orig/malloc/malloc.c
+++ glibc-2.18/malloc/malloc.c
@@ -3015,6 +3015,13 @@ __libc_memalign(size_t alignment, size_t
/* Otherwise, ensure that it is at least a minimum chunk size */
if (alignment < MINSIZE) alignment = MINSIZE;
+ /* Check for overflow. */
+ if (bytes > SIZE_MAX - alignment - MINSIZE)
+ {
+ __set_errno (ENOMEM);
+ return 0;
+ }
+
arena_get(ar_ptr, bytes + alignment + MINSIZE);
if(!ar_ptr)
return 0;
@@ -3046,6 +3053,13 @@ __libc_valloc(size_t bytes)
size_t pagesz = GLRO(dl_pagesize);
+ /* Check for overflow. */
+ if (bytes > SIZE_MAX - pagesz - MINSIZE)
+ {
+ __set_errno (ENOMEM);
+ return 0;
+ }
+
void *(*hook) (size_t, size_t, const void *) =
force_reg (__memalign_hook);
if (__builtin_expect (hook != NULL, 0))
@@ -3082,6 +3096,13 @@ __libc_pvalloc(size_t bytes)
size_t page_mask = GLRO(dl_pagesize) - 1;
size_t rounded_bytes = (bytes + page_mask) & ~(page_mask);
+ /* Check for overflow. */
+ if (bytes > SIZE_MAX - 2*pagesz - MINSIZE)
+ {
+ __set_errno (ENOMEM);
+ return 0;
+ }
+
void *(*hook) (size_t, size_t, const void *) =
force_reg (__memalign_hook);
if (__builtin_expect (hook != NULL, 0))

View File

@ -1,148 +0,0 @@
[BZ #15736]
* locale/categories.def (LC_CTYPE): Add "nonascii-case" element.
* string/Makefile (test-strcasecmp-ENV, test-strncasecmp-ENV)
(test-strcasecmp-ifunc-ENV, test-strncasecmp-ifunc-ENV): Define.
* string/test-strcasecmp.c (test_main): Run tests in several
locales.
* string/test-strncasecmp.c (test_main): Likewise.
Index: glibc-2.17.90/locale/categories.def
===================================================================
--- glibc-2.17.90.orig/locale/categories.def
+++ glibc-2.17.90/locale/categories.def
@@ -133,6 +133,7 @@ DEFINE_CATEGORY
DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_IGNORE_LEN, "ctype-translit-ignore-len", std, word)
DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_IGNORE, "ctype-translit-ignore", std, string)
DEFINE_ELEMENT (_NL_CTYPE_MAP_TO_NONASCII, "map-to-nonascii", std, word)
+ DEFINE_ELEMENT (_NL_CTYPE_NONASCII_CASE, "nonascii-case", std, word)
), _nl_postload_ctype)
Index: glibc-2.17.90/string/Makefile
===================================================================
--- glibc-2.17.90.orig/string/Makefile
+++ glibc-2.17.90/string/Makefile
@@ -65,6 +65,10 @@ noinl-tester-ENV = LANGUAGE=C
tst-strxfrm-ENV = LOCPATH=$(common-objpfx)localedata
tst-strxfrm2-ENV = LOCPATH=$(common-objpfx)localedata
bug-strcoll1-ENV = LOCPATH=$(common-objpfx)localedata
+test-strcasecmp-ENV = LOCPATH=$(common-objpfx)localedata
+test-strncasecmp-ENV = LOCPATH=$(common-objpfx)localedata
+test-strcasecmp-ifunc-ENV = LOCPATH=$(common-objpfx)localedata
+test-strncasecmp-ifunc-ENV = LOCPATH=$(common-objpfx)localedata
CFLAGS-inl-tester.c = -fno-builtin
CFLAGS-noinl-tester.c = -fno-builtin
CFLAGS-tst-strlen.c = -fno-builtin
Index: glibc-2.17.90/string/test-strcasecmp.c
===================================================================
--- glibc-2.17.90.orig/string/test-strcasecmp.c
+++ glibc-2.17.90/string/test-strcasecmp.c
@@ -17,6 +17,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <locale.h>
#include <ctype.h>
#define TEST_MAIN
#define TEST_NAME "strcasecmp"
@@ -206,14 +207,18 @@ do_random_tests (void)
}
}
-int
-test_main (void)
+static void
+test_locale (const char *locale)
{
size_t i;
- test_init ();
+ if (setlocale (LC_CTYPE, locale) == NULL)
+ {
+ error (0, 0, "cannot set locale \"%s\"", locale);
+ ret = 1;
+ }
- printf ("%23s", "");
+ printf ("%-23s", locale);
FOR_EACH_IMPL (impl, 0)
printf ("\t%s", impl->name);
putchar ('\n');
@@ -246,6 +251,19 @@ test_main (void)
}
do_random_tests ();
+}
+
+int
+test_main (void)
+{
+ test_init ();
+
+ test_locale ("C");
+ test_locale ("en_US.ISO-8859-1");
+ test_locale ("en_US.UTF-8");
+ test_locale ("tr_TR.ISO-8859-9");
+ test_locale ("tr_TR.UTF-8");
+
return ret;
}
Index: glibc-2.17.90/string/test-strncasecmp.c
===================================================================
--- glibc-2.17.90.orig/string/test-strncasecmp.c
+++ glibc-2.17.90/string/test-strncasecmp.c
@@ -17,6 +17,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <locale.h>
#include <ctype.h>
#define TEST_MAIN
#define TEST_NAME "strncasecmp"
@@ -256,17 +257,21 @@ bz14195 (void)
check_result (impl, empty_string, "", 5, 0);
}
-int
-test_main (void)
+static void
+test_locale (const char *locale)
{
size_t i;
- test_init ();
+ if (setlocale (LC_CTYPE, locale) == NULL)
+ {
+ error (0, 0, "cannot set locale \"%s\"", locale);
+ ret = 1;
+ }
bz12205 ();
bz14195 ();
- printf ("%23s", "");
+ printf ("%23s", locale);
FOR_EACH_IMPL (impl, 0)
printf ("\t%s", impl->name);
putchar ('\n');
@@ -329,6 +334,19 @@ test_main (void)
}
do_random_tests ();
+}
+
+int
+test_main (void)
+{
+ test_init ();
+
+ test_locale ("C");
+ test_locale ("en_US.ISO-8859-1");
+ test_locale ("en_US.UTF-8");
+ test_locale ("tr_TR.ISO-8859-9");
+ test_locale ("tr_TR.UTF-8");
+
return ret;
}

View File

@ -1,112 +0,0 @@
From a6856a042a0669ac3f8bc675e8e1de14b5d09b94 Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@suse.de>
Date: Thu, 24 Jan 2013 12:32:09 +0100
Subject: [PATCH] Properly cache the result from looking up the nss database
config
[BZ #15048]
* nscd/aicache.c (addhstaiX): Properly use the cache variable for
the nss database lookup.
* nscd/initgrcache.c (addinitgroupsX): Likewise.
* sysdeps/posix/getaddrinfo.c (gaih_inet): Likewise.
---
nscd/aicache.c | 15 +++++++--------
nscd/initgrcache.c | 15 +++++++--------
sysdeps/posix/getaddrinfo.c | 14 ++++++--------
3 files changed, 20 insertions(+), 24 deletions(-)
Index: glibc-2.17.90/nscd/aicache.c
===================================================================
--- glibc-2.17.90.orig/nscd/aicache.c
+++ glibc-2.17.90/nscd/aicache.c
@@ -86,20 +86,19 @@ addhstaiX (struct database_dyn *db, int
}
static service_user *hosts_database;
- service_user *nip = NULL;
+ service_user *nip;
int no_more;
int rc6 = 0;
int rc4 = 0;
int herrno = 0;
- if (hosts_database != NULL)
- {
- nip = hosts_database;
- no_more = 0;
- }
- else
+ if (hosts_database == NULL)
no_more = __nss_database_lookup ("hosts", NULL,
- "dns [!UNAVAIL=return] files", &nip);
+ "dns [!UNAVAIL=return] files",
+ &hosts_database);
+ else
+ no_more = 0;
+ nip = hosts_database;
if (__res_maybe_init (&_res, 0) == -1)
no_more = 1;
Index: glibc-2.17.90/nscd/initgrcache.c
===================================================================
--- glibc-2.17.90.orig/nscd/initgrcache.c
+++ glibc-2.17.90/nscd/initgrcache.c
@@ -80,17 +80,16 @@ addinitgroupsX (struct database_dyn *db,
}
static service_user *group_database;
- service_user *nip = NULL;
+ service_user *nip;
int no_more;
- if (group_database != NULL)
- {
- nip = group_database;
- no_more = 0;
- }
- else
+ if (group_database == NULL)
no_more = __nss_database_lookup ("group", NULL,
- "compat [NOTFOUND=return] files", &nip);
+ "compat [NOTFOUND=return] files",
+ &group_database);
+ else
+ no_more = 0;
+ nip = group_database;
/* We always use sysconf even if NGROUPS_MAX is defined. That way, the
limit can be raised in the kernel configuration without having to
Index: glibc-2.17.90/sysdeps/posix/getaddrinfo.c
===================================================================
--- glibc-2.17.90.orig/sysdeps/posix/getaddrinfo.c
+++ glibc-2.17.90/sysdeps/posix/getaddrinfo.c
@@ -558,7 +558,7 @@ gaih_inet (const char *name, const struc
struct gaih_addrtuple **pat = &at;
int no_data = 0;
int no_inet6_data = 0;
- service_user *nip = NULL;
+ service_user *nip;
enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
enum nss_status status = NSS_STATUS_UNAVAIL;
int no_more;
@@ -791,15 +791,13 @@ gaih_inet (const char *name, const struc
}
#endif
- if (__nss_hosts_database != NULL)
- {
- no_more = 0;
- nip = __nss_hosts_database;
- }
- else
+ if (__nss_hosts_database == NULL)
no_more = __nss_database_lookup ("hosts", NULL,
"dns [!UNAVAIL=return] files",
- &nip);
+ &__nss_hosts_database);
+ else
+ no_more = 0;
+ nip = __nss_hosts_database;
/* Initialize configurations. */
if (__builtin_expect (!_res_hconf.initialized, 0))

View File

@ -1,179 +0,0 @@
From 1aa92494e55792b568663b5aad81a58fad35490d Mon Sep 17 00:00:00 2001
From: Eric Biggers <ebiggers3@gmail.com>
Date: Thu, 18 Apr 2013 17:46:08 +0200
Subject: [PATCH] PR15362
[BZ #15362]
* libio/fileops.c: Revert problematic fixes for [BZ #11741]
* libio/iofwrite.c: Likewise.
* libio/iofwrite_u.c: Likewise.
* libio/iopadn.c: Likewise.
* libio/iowpadn.c: Likewise.
* stdio-common/vfprintf.c: Fix [BZ #11741] properly by checking whether
_IO_padn() returned the full count written.
---
libio/fileops.c | 21 +++++++++------------
libio/iofwrite.c | 10 +++++-----
libio/iofwrite_u.c | 10 +++++-----
libio/iopadn.c | 2 +-
libio/iowpadn.c | 2 +-
stdio-common/vfprintf.c | 12 ++++++------
6 files changed, 27 insertions(+), 30 deletions(-)
Index: glibc-2.17.90/libio/fileops.c
===================================================================
--- glibc-2.17.90.orig/libio/fileops.c
+++ glibc-2.17.90/libio/fileops.c
@@ -1245,13 +1245,12 @@ _IO_new_file_write (f, data, n)
_IO_ssize_t n;
{
_IO_ssize_t to_do = n;
- _IO_ssize_t count = 0;
while (to_do > 0)
{
- count = (__builtin_expect (f->_flags2
- & _IO_FLAGS2_NOTCANCEL, 0)
- ? write_not_cancel (f->_fileno, data, to_do)
- : write (f->_fileno, data, to_do));
+ _IO_ssize_t count = (__builtin_expect (f->_flags2
+ & _IO_FLAGS2_NOTCANCEL, 0)
+ ? write_not_cancel (f->_fileno, data, to_do)
+ : write (f->_fileno, data, to_do));
if (count < 0)
{
f->_flags |= _IO_ERR_SEEN;
@@ -1263,7 +1262,7 @@ _IO_new_file_write (f, data, n)
n -= to_do;
if (f->_offset >= 0)
f->_offset += n;
- return count < 0 ? count : n;
+ return n;
}
_IO_size_t
@@ -1323,13 +1322,11 @@ _IO_new_file_xsputn (f, data, n)
_IO_size_t block_size, do_write;
/* Next flush the (full) buffer. */
if (_IO_OVERFLOW (f, EOF) == EOF)
- /* If nothing else has to be written or nothing has been written, we
- must not signal the caller that the call was even partially
- successful. */
- return (to_do == 0 || to_do == n) ? EOF : n - to_do;
+ /* If nothing else has to be written we must not signal the
+ caller that everything has been written. */
+ return to_do == 0 ? EOF : n - to_do;
- /* Try to maintain alignment: write a whole number of blocks.
- dont_write is what gets left over. */
+ /* Try to maintain alignment: write a whole number of blocks. */
block_size = f->_IO_buf_end - f->_IO_buf_base;
do_write = to_do - (block_size >= 128 ? to_do % block_size : 0);
Index: glibc-2.17.90/libio/iofwrite.c
===================================================================
--- glibc-2.17.90.orig/libio/iofwrite.c
+++ glibc-2.17.90/libio/iofwrite.c
@@ -42,12 +42,12 @@ _IO_fwrite (buf, size, count, fp)
if (_IO_vtable_offset (fp) != 0 || _IO_fwide (fp, -1) == -1)
written = _IO_sputn (fp, (const char *) buf, request);
_IO_release_lock (fp);
- /* We are guaranteed to have written all of the input, none of it, or
- some of it. */
- if (written == request)
+ /* We have written all of the input in case the return value indicates
+ this or EOF is returned. The latter is a special case where we
+ simply did not manage to flush the buffer. But the data is in the
+ buffer and therefore written as far as fwrite is concerned. */
+ if (written == request || written == EOF)
return count;
- else if (written == EOF)
- return 0;
else
return written / size;
}
Index: glibc-2.17.90/libio/iofwrite_u.c
===================================================================
--- glibc-2.17.90.orig/libio/iofwrite_u.c
+++ glibc-2.17.90/libio/iofwrite_u.c
@@ -44,12 +44,12 @@ fwrite_unlocked (buf, size, count, fp)
if (_IO_fwide (fp, -1) == -1)
{
written = _IO_sputn (fp, (const char *) buf, request);
- /* We are guaranteed to have written all of the input, none of it, or
- some of it. */
- if (written == request)
+ /* We have written all of the input in case the return value indicates
+ this or EOF is returned. The latter is a special case where we
+ simply did not manage to flush the buffer. But the data is in the
+ buffer and therefore written as far as fwrite is concerned. */
+ if (written == request || written == EOF)
return count;
- else if (written == EOF)
- return 0;
}
return written / size;
Index: glibc-2.17.90/libio/iopadn.c
===================================================================
--- glibc-2.17.90.orig/libio/iopadn.c
+++ glibc-2.17.90/libio/iopadn.c
@@ -59,7 +59,7 @@ _IO_padn (fp, pad, count)
w = _IO_sputn (fp, padptr, PADSIZE);
written += w;
if (w != PADSIZE)
- return w == EOF ? w : written;
+ return written;
}
if (i > 0)
Index: glibc-2.17.90/libio/iowpadn.c
===================================================================
--- glibc-2.17.90.orig/libio/iowpadn.c
+++ glibc-2.17.90/libio/iowpadn.c
@@ -65,7 +65,7 @@ _IO_wpadn (fp, pad, count)
w = _IO_sputn (fp, (char *) padptr, PADSIZE);
written += w;
if (w != PADSIZE)
- return w == EOF ? w : written;
+ return written;
}
if (i > 0)
Index: glibc-2.17.90/stdio-common/vfprintf.c
===================================================================
--- glibc-2.17.90.orig/stdio-common/vfprintf.c
+++ glibc-2.17.90/stdio-common/vfprintf.c
@@ -90,13 +90,13 @@
do { \
if (width > 0) \
{ \
- unsigned int d = _IO_padn (s, (Padchar), width); \
- if (__glibc_unlikely (d == EOF)) \
+ _IO_ssize_t written = _IO_padn (s, (Padchar), width); \
+ if (__glibc_unlikely (written != width)) \
{ \
done = -1; \
goto all_done; \
} \
- done_add (d); \
+ done_add (written); \
} \
} while (0)
# define PUTC(C, F) _IO_putc_unlocked (C, F)
@@ -119,13 +119,13 @@
do { \
if (width > 0) \
{ \
- unsigned int d = _IO_wpadn (s, (Padchar), width); \
- if (__glibc_unlikely (d == EOF)) \
+ _IO_ssize_t written = _IO_wpadn (s, (Padchar), width); \
+ if (__glibc_unlikely (written != width)) \
{ \
done = -1; \
goto all_done; \
} \
- done_add (d); \
+ done_add (written); \
} \
} while (0)
# define PUTC(C, F) _IO_putwc_unlocked (C, F)

View File

@ -1,297 +0,0 @@
2013-06-12 Florian Weimer <fweimer@redhat.com>
[BZ #14699]
* sysdeps/posix/dirstream.h (struct __dirstream): Add errcode
member.
* sysdeps/posix/opendir.c (__alloc_dir): Initialize errcode
member.
* sysdeps/posix/rewinddir.c (rewinddir): Reset errcode member.
* sysdeps/posix/readdir_r.c (__READDIR_R): Enforce NAME_MAX limit.
Return delayed error code. Remove GETDENTS_64BIT_ALIGNED
conditional.
* sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Do not define
GETDENTS_64BIT_ALIGNED.
* sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise.
* manual/filesys.texi (Reading/Closing Directory): Document
ENAMETOOLONG return value of readdir_r. Recommend readdir more
strongly.
* manual/conf.texi (Limits for Files): Add portability note to
NAME_MAX, PATH_MAX.
(Pathconf): Add portability note for _PC_NAME_MAX, _PC_PATH_MAX.
Index: glibc-2.18/manual/conf.texi
===================================================================
--- glibc-2.18.orig/manual/conf.texi
+++ glibc-2.18/manual/conf.texi
@@ -1149,6 +1149,9 @@ typed ahead as input. @xref{I/O Queues}
@deftypevr Macro int NAME_MAX
The uniform system limit (if any) for the length of a file name component, not
including the terminating null character.
+
+@strong{Portability Note:} On some systems, @theglibc{} defines
+@code{NAME_MAX}, but does not actually enforce this limit.
@end deftypevr
@comment limits.h
@@ -1157,6 +1160,9 @@ including the terminating null character
The uniform system limit (if any) for the length of an entire file name (that
is, the argument given to system calls such as @code{open}), including the
terminating null character.
+
+@strong{Portability Note:} @Theglibc{} does not enforce this limit
+even if @code{PATH_MAX} is defined.
@end deftypevr
@cindex limits, pipe buffer size
@@ -1476,6 +1482,9 @@ Inquire about the value of @code{POSIX_R
Inquire about the value of @code{POSIX_REC_XFER_ALIGN}.
@end table
+@strong{Portability Note:} On some systems, @theglibc{} does not
+enforce @code{_PC_NAME_MAX} or @code{_PC_PATH_MAX} limits.
+
@node Utility Limits
@section Utility Program Capacity Limits
Index: glibc-2.18/manual/filesys.texi
===================================================================
--- glibc-2.18.orig/manual/filesys.texi
+++ glibc-2.18/manual/filesys.texi
@@ -444,9 +444,9 @@ symbols are declared in the header file
@comment POSIX.1
@deftypefun {struct dirent *} readdir (DIR *@var{dirstream})
This function reads the next entry from the directory. It normally
-returns a pointer to a structure containing information about the file.
-This structure is statically allocated and can be rewritten by a
-subsequent call.
+returns a pointer to a structure containing information about the
+file. This structure is associated with the @var{dirstream} handle
+and can be rewritten by a subsequent call.
@strong{Portability Note:} On some systems @code{readdir} may not
return entries for @file{.} and @file{..}, even though these are always
@@ -461,19 +461,59 @@ conditions are defined for this function
The @var{dirstream} argument is not valid.
@end table
-@code{readdir} is not thread safe. Multiple threads using
-@code{readdir} on the same @var{dirstream} may overwrite the return
-value. Use @code{readdir_r} when this is critical.
+To distinguish between an end-of-directory condition or an error, you
+must set @code{errno} to zero before calling @code{readdir}. To avoid
+entering an infinite loop, you should stop reading from the directory
+after the first error.
+
+In POSIX.1-2008, @code{readdir} is not thread-safe. In @theglibc{}
+implementation, it is safe to call @code{readdir} concurrently on
+different @var{dirstream}s (but multiple threads accessing the same
+@var{dirstream} result in undefined behavior). @code{readdir_r} is a
+fully thread-safe alternative, but suffers from poor portability (see
+below). It is recommended that you use @code{readdir}, with external
+locking if multiple threads access the same @var{dirstream}.
@end deftypefun
@comment dirent.h
@comment GNU
@deftypefun int readdir_r (DIR *@var{dirstream}, struct dirent *@var{entry}, struct dirent **@var{result})
-This function is the reentrant version of @code{readdir}. Like
-@code{readdir} it returns the next entry from the directory. But to
-prevent conflicts between simultaneously running threads the result is
-not stored in statically allocated memory. Instead the argument
-@var{entry} points to a place to store the result.
+This function is a version of @code{readdir} which performs internal
+locking. Like @code{readdir} it returns the next entry from the
+directory. To prevent conflicts between simultaneously running
+threads the result is stored inside the @var{entry} object.
+
+@strong{Portability Note:} It is recommended to use @code{readdir}
+instead of @code{readdir_r} for the following reasons:
+
+@itemize @bullet
+@item
+On systems which do not define @code{NAME_MAX}, it may not be possible
+to use @code{readdir_r} safely because the caller does not specify the
+length of the buffer for the directory entry.
+
+@item
+On some systems, @code{readdir_r} cannot read directory entries with
+very long names. If such a name is encountered, @theglibc{}
+implementation of @code{readdir_r} returns with an error code of
+@code{ENAMETOOLONG} after the final directory entry has been read. On
+other systems, @code{readdir_r} may return successfully, but the
+@code{d_name} member may not be NUL-terminated or may be truncated.
+
+@item
+POSIX-1.2008 does not guarantee that @code{readdir} is thread-safe,
+even when access to the same @var{dirstream} is serialized. But in
+current implementations (including @theglibc{}), it is safe to call
+@code{readdir} concurrently on different @var{dirstream}s, so there is
+no requirement to use @code{readdir_r} even in multi-threaded
+programs.
+
+@item
+It is expected that future versions of POSIX will obsolete
+@code{readdir_r} and mandate the level of thread safety for
+@code{readdir} which is provided by @theglibc{} and other
+implementations today.
+@end itemize
Normally @code{readdir_r} returns zero and sets @code{*@var{result}}
to @var{entry}. If there are no more entries in the directory or an
@@ -481,15 +521,6 @@ error is detected, @code{readdir_r} sets
null pointer and returns a nonzero error code, also stored in
@code{errno}, as described for @code{readdir}.
-@strong{Portability Note:} On some systems @code{readdir_r} may not
-return a NUL terminated string for the file name, even when there is no
-@code{d_reclen} field in @code{struct dirent} and the file
-name is the maximum allowed size. Modern systems all have the
-@code{d_reclen} field, and on old systems multi-threading is not
-critical. In any case there is no such problem with the @code{readdir}
-function, so that even on systems without the @code{d_reclen} member one
-could use multiple threads by using external locking.
-
It is also important to look at the definition of the @code{struct
dirent} type. Simply passing a pointer to an object of this type for
the second parameter of @code{readdir_r} might not be enough. Some
Index: glibc-2.18/sysdeps/posix/dirstream.h
===================================================================
--- glibc-2.18.orig/sysdeps/posix/dirstream.h
+++ glibc-2.18/sysdeps/posix/dirstream.h
@@ -39,6 +39,8 @@ struct __dirstream
off_t filepos; /* Position of next entry to read. */
+ int errcode; /* Delayed error code. */
+
/* Directory block. */
char data[0] __attribute__ ((aligned (__alignof__ (void*))));
};
Index: glibc-2.18/sysdeps/posix/opendir.c
===================================================================
--- glibc-2.18.orig/sysdeps/posix/opendir.c
+++ glibc-2.18/sysdeps/posix/opendir.c
@@ -231,6 +231,7 @@ __alloc_dir (int fd, bool close_fd, int
dirp->size = 0;
dirp->offset = 0;
dirp->filepos = 0;
+ dirp->errcode = 0;
return dirp;
}
Index: glibc-2.18/sysdeps/posix/readdir_r.c
===================================================================
--- glibc-2.18.orig/sysdeps/posix/readdir_r.c
+++ glibc-2.18/sysdeps/posix/readdir_r.c
@@ -40,6 +40,7 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *ent
DIRENT_TYPE *dp;
size_t reclen;
const int saved_errno = errno;
+ int ret;
__libc_lock_lock (dirp->lock);
@@ -70,10 +71,10 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *ent
bytes = 0;
__set_errno (saved_errno);
}
+ if (bytes < 0)
+ dirp->errcode = errno;
dp = NULL;
- /* Reclen != 0 signals that an error occurred. */
- reclen = bytes != 0;
break;
}
dirp->size = (size_t) bytes;
@@ -106,29 +107,46 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *ent
dirp->filepos += reclen;
#endif
- /* Skip deleted files. */
+#ifdef NAME_MAX
+ if (reclen > offsetof (DIRENT_TYPE, d_name) + NAME_MAX + 1)
+ {
+ /* The record is very long. It could still fit into the
+ caller-supplied buffer if we can skip padding at the
+ end. */
+ size_t namelen = _D_EXACT_NAMLEN (dp);
+ if (namelen <= NAME_MAX)
+ reclen = offsetof (DIRENT_TYPE, d_name) + namelen + 1;
+ else
+ {
+ /* The name is too long. Ignore this file. */
+ dirp->errcode = ENAMETOOLONG;
+ dp->d_ino = 0;
+ continue;
+ }
+ }
+#endif
+
+ /* Skip deleted and ignored files. */
}
while (dp->d_ino == 0);
if (dp != NULL)
{
-#ifdef GETDENTS_64BIT_ALIGNED
- /* The d_reclen value might include padding which is not part of
- the DIRENT_TYPE data structure. */
- reclen = MIN (reclen,
- offsetof (DIRENT_TYPE, d_name) + sizeof (dp->d_name));
-#endif
*result = memcpy (entry, dp, reclen);
-#ifdef GETDENTS_64BIT_ALIGNED
+#ifdef _DIRENT_HAVE_D_RECLEN
entry->d_reclen = reclen;
#endif
+ ret = 0;
}
else
- *result = NULL;
+ {
+ *result = NULL;
+ ret = dirp->errcode;
+ }
__libc_lock_unlock (dirp->lock);
- return dp != NULL ? 0 : reclen ? errno : 0;
+ return ret;
}
#ifdef __READDIR_R_ALIAS
Index: glibc-2.18/sysdeps/posix/rewinddir.c
===================================================================
--- glibc-2.18.orig/sysdeps/posix/rewinddir.c
+++ glibc-2.18/sysdeps/posix/rewinddir.c
@@ -33,6 +33,7 @@ rewinddir (dirp)
dirp->filepos = 0;
dirp->offset = 0;
dirp->size = 0;
+ dirp->errcode = 0;
#ifndef NOT_IN_libc
__libc_lock_unlock (dirp->lock);
#endif
Index: glibc-2.18/sysdeps/unix/sysv/linux/i386/readdir64_r.c
===================================================================
--- glibc-2.18.orig/sysdeps/unix/sysv/linux/i386/readdir64_r.c
+++ glibc-2.18/sysdeps/unix/sysv/linux/i386/readdir64_r.c
@@ -18,7 +18,6 @@
#define __READDIR_R __readdir64_r
#define __GETDENTS __getdents64
#define DIRENT_TYPE struct dirent64
-#define GETDENTS_64BIT_ALIGNED 1
#include <sysdeps/posix/readdir_r.c>
Index: glibc-2.18/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
===================================================================
--- glibc-2.18.orig/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
+++ glibc-2.18/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
@@ -1,5 +1,4 @@
#define readdir64_r __no_readdir64_r_decl
-#define GETDENTS_64BIT_ALIGNED 1
#include <sysdeps/posix/readdir_r.c>
#undef readdir64_r
weak_alias (__readdir_r, readdir64_r)

File diff suppressed because it is too large Load Diff