Compare commits

...
Author SHA1 Message Date
Petr Baudis 7372b19962 glibc 2.11.3 release 2010-11-30 03:24:32 +01:00
Petr Baudis 977bbf5c18 Allow aux_cache_file open()ing to fail silently even in the chroot mode.
The aux_cache fix of bug 11149 introduced a new bug - normally,
ldconfig -r never cares if the auxiliary cache is not available and
that is not a fatal problem, however this is not the case in case
of ldconfig -r when executed as non-root. In that case, ldconfig -r
fails hard unless var/cache/ldconfig/ exists within the chroot. This
patch fixes that.

Conflicts:

	ChangeLog
(cherry picked from commit 6db52fbb27)
2010-11-30 03:24:32 +01:00
Ulrich Drepper 491e94705b Fix multiple nss_compat initgroups() bugs
Compat initgroups() is completely broken; the code will always set
skip_initgroups_dyn to true, so initgroups() will never be actually
called, but due to the nature of the code, setgrent() won't be called
either - thus, subsequent invocations of initgroups() will not return
the NIS group list anymore.

This is a simple patch that makes sure skip_initgroups_dyn is set only
in case initgroups is not available; it also attempts to handle the
unavailability of other NSS interfaces better.

Conflicts:

	ChangeLog
(cherry picked from commit 3056dcdb78)
2010-11-30 03:24:31 +01:00
Petr Baudis 5c26c0f7f9 Remove duplicate ChangeLog entry for f906814 2010-11-30 03:24:31 +01:00
Petr Baudis 353ade4f9b Re-sync INSTALL and manual/install.texi
Required for flawless make dist run.
2010-11-30 03:24:31 +01:00
Petr Baudis d795f23c92 Allow arbitrary whitespace in INSTALL (autogenerated by makeinfo) 2010-11-30 03:21:52 +01:00
Andreas Schwab 42c95109b2 Properly convert f_fsid in statvfs
(cherry picked from commit c21cc9bcb3)
2010-11-20 18:58:52 +01:00
Ulrich Drepper 1e0bcc2ee3 Define MAP_HUGETLB.
(cherry picked from commit cf7c9078a5)
2010-11-20 15:40:22 +01:00
Ulrich Drepper 7112fd02ab Define SWAP_FLAG_DISCARD.
(cherry picked from commit a1fb5e3ebe)
2010-11-20 15:40:21 +01:00
Andreas Schwab dd2fde461e Fix memory leak in fnmatch
(cherry picked from commit 3540d66b66)
2010-11-15 18:38:17 +01:00
Ulrich Drepper c01f7d05b8 Avoid too much stack use in fnmatch.
(cherry picked from commit f15ce4d8dc)
2010-11-15 18:36:47 +01:00
Luis Machado 49a47e5a16 Fix comparison in sqrtl for IBM long double 128.
(cherry picked from commit da93d21475)
2010-11-15 18:27:04 +01:00
Ulrich Drepper 2ea9855d59 Fix warnings in __bswap_16.
(cherry picked from commit 69da074d7a)
2010-11-15 18:26:11 +01:00
Mike Frysinger 457c305d8a Update sparc epoll.h from epoll_create2 to epoll_create1
(cherry picked from commit fdc0c10d9b)
2010-11-15 18:11:53 +01:00
Andreas Schwab 5a647459c8 Don't mix pattern rules with normal rules
(cherry picked from commit 32cf406993)
2010-11-15 18:08:30 +01:00
Andreas Schwab cbca5989ba Properly quote output of locale
(cherry picked from commit 026373745e)
2010-11-15 18:07:57 +01:00
Petr Baudis 5da0ad5538 Remove duplicate ChangeLog entry for 8e9f92e 2010-11-15 18:06:00 +01:00
Andreas Krebbel 4e951b5938 Fix concurrency problem between dl_open and dl_iterate_phdr
(cherry picked from commit f09677388a)

Fix assertion in ld.so, introduced by delayed adding to global list.

(cherry picked from commit fa41c84d73)
2010-11-15 18:03:57 +01:00
Ulrich Drepper fa55fd7e5b Fix perturbing in malloc on free.
(cherry picked from commit fdc0f374bc)
2010-11-09 02:43:15 +01:00
Andreas Schwab 7f5aef2309 Work around shortest-stem feature in make 3.82+
(cherry picked from commit bc96fbda27)
2010-11-09 02:42:31 +01:00
Andreas Schwab 1d81ee7397 Require suid bit on audit objects in privileged programs
(cherry picked from commit 8e9f92e9d5)
2010-11-09 02:42:25 +01:00
Andreas Schwab 8b1cd765b2 Don't expand DST twice in dl_open
(cherry picked from commit 22cd1c9bcf)
2010-11-09 02:42:11 +01:00
Andreas Schwab c88ea0dfe1 Expect PLT call to _Unwind_Find_FDE on s390*-linux
(cherry picked from commit 14d43591fa)
2010-11-09 02:40:22 +01:00
H.J. Lu 3f0ccf6ea5 Fix alignment of AVX safe area on x86-64.
(cherry picked from commit f90681487d)
2010-11-09 02:39:55 +01:00
Ulrich Drepper 1f260d0fdc One more regex memory leak fixed.
(cherry picked from commit b833d51fbb)
2010-11-09 02:38:44 +01:00
Ulrich Drepper 153501dc10 More regex memory leak fixes and testcases
(cherry picked from commit ef06edbee6)
(cherry picked from commit e9b9cbf5e9)
2010-11-09 02:38:07 +01:00
Ulrich Drepper 8a69e300d5 Fix memory leak for some invalid regular expressions.
(cherry picked from commit a129c80d54)
2010-11-09 02:34:05 +01:00
Ulrich Drepper f3a97f4c2c Linux getifaddrs might return entries with ->ifa_addr being NULL.
(cherry picked from commit 1751705d1c)
2010-11-09 02:32:21 +01:00
Ulrich Drepper 4eedc59901 Remove specific binutils version recommendation in INSTALL file.
(cherry picked from commit 10be485191)
2010-11-09 02:31:01 +01:00
Ulrich Drepper 72f754daa0 Handle large requests.
(cherry picked from commit 3b11189345)
2010-11-09 02:30:49 +01:00
Joseph Myers bca48e9a92 getdents64 fallback d_type support
(cherry picked from commit 1ac7a2c7b4)
2010-11-09 02:17:40 +01:00
Andreas Schwab dca25feaf7 Fix register conflict in s390 ____longjmp_chk
(cherry picked from commit 7291c56f9d)
2010-11-09 02:16:20 +01:00
Chung-Lin Tang e6ff4b8b26 Fix _FORITY_SOURCE version of longjmp for Linux/x86-64.
(cherry picked from commit c044aa7535)
2010-11-09 02:14:32 +01:00
Mike Frysinger 254fea5e8f Fix typo in x86-64 epoll.h.
(cherry picked from commit e53a31fe57)
2010-11-09 02:13:10 +01:00
Andreas Schwab 5f353d1e05 Fix array overflow in floating point parser
(cherry picked from commit a726d7960e)
2010-11-09 02:12:46 +01:00
Ulrich Drepper 311ad04d94 Actually make it possible to user the default name server.
(cherry picked from commit e66e7419a6)
2010-11-09 02:10:32 +01:00
Ulrich Drepper 0ea58d8be3 Missing server address again leads to localhost being used
(cherry picked from commit df24a73ecd)
2010-11-09 02:10:19 +01:00
H.J. Lu 9d70662339 Add -fno-asynchronous-unwind-tables to initfini.s for i386
(cherry picked from commit f8392f4004)
2010-11-09 02:03:36 +01:00
Samuel Thibault 07b72c0b42 Hurd: fix timeout rounding in select
(cherry picked from commit 5a42321d43)
2010-11-09 01:47:25 +01:00
Roland McGrath 720be42915 BZ 11856: fix manual nit
(cherry picked from commit 48cbc0d6d0)
2010-11-09 01:46:26 +01:00
Andreas Schwab de8b6f612a Document M_PERTURB
(cherry picked from commit deb9cabbf4)
2010-11-09 01:46:02 +01:00
Roland McGrath 5881b3d981 BZ #11840: Fix config.cache usage for -fgnu89-inline check.
(cherry picked from commit 1c7570ff36)
2010-11-09 01:45:38 +01:00
Roland McGrath 62724d5f1e Fix vDSO synthetic hwcap handling so they are not masked out from ld.so.cache matching.
(cherry picked from commit 5dbc3b6cc0)
2010-11-09 01:44:35 +01:00
Roland McGrath 553fe7087a Manual wording fix for round{,f,l}.
(cherry picked from commit 713df3d547)
2010-11-09 01:42:31 +01:00
Ulrich Drepper 9b44d3dad9 More linking issues fixed.
(cherry picked from commit 702e8f1450)
2010-11-09 01:41:18 +01:00
Ulrich Drepper a17f00a815 Fix build with newer linker.
(cherry picked from commit 72b6e8c85b)
2010-11-09 01:38:11 +01:00
Emilio Pozuelo Monfort 9ca2c3cc19 Hurd: Fix linkat symlink handling.
(cherry picked from commit 2a50c07836)
2010-11-09 01:36:03 +01:00
Ulrich Drepper 827face44b 32bit memset-sse2.S fails with uneven cache size
32bit memset-sse2.S assumes cache size is multiple of 128 bytes.  If
it isn't true, memset-sse2.S will fail.  For example, a processor can
have 24576 KB L3 cache and 20 cores. That is 2516582 byte per core. Half
of it is 1258291, which isn't helpful for vector instructions.  This
patch rounds cache sizes to multiple of 256 bytes.

(cherry picked from commit c0dde15b5d
but removed introduction of new variables)
2010-11-09 01:33:18 +01:00
Miklos Szeredi ca47880178 Verify in ttyname() that the symlink is valid.
(cherry picked from commit 0e516e0e14)
2010-11-09 01:22:02 +01:00
Richard Li 0cd8f10947 Fix x86-64 strchr propagation of search byte into all bytes of SSE register
(cherry picked from commit dbf3a06904)
2010-11-01 22:29:35 +01:00
Andreas Schwab cd8ba92d34 Require suid bit on audit objects in privileged programs
(cherry picked from commit 8e9f92e9d5)
2010-11-01 22:28:48 +01:00
H.J. Lu b001725149 Fix alignment of AVX safe area on x86-64.
(cherry picked from commit f90681487d)
2010-11-01 22:27:07 +01:00
Ulrich Drepper a99e880cd8 Add test case for strstr problem.
(cherry picked from commit 67a67b950b)
2010-11-01 22:25:12 +01:00
Eric Blake 831daea2c9 Fix strstr and memmem algorithm.
(cherry picked from commit 5fb308bca2)
2010-11-01 22:25:06 +01:00
Ulrich Drepper 38e894eec8 Fix handling of tail bytes of buffer in SSE2/SSSE3 x86-64 version strn{,case}cmp
(cherry picked from commit 45db99c7d0)
2010-11-01 22:21:04 +01:00
Kirill A. Shutemov 0a15401613 Flush cache after solving TEXTRELs if arch requires it.
(cherry picked from commit 80da2e093c)
2010-11-01 22:04:23 +01:00
Takashi Yoshii 88731ee916 [sh] Fix incorrect location of ifndef for __ASSUME_FUTEX_CLOCK_REALTIME.
(cherry picked from commit 4bc93b3033)
2010-11-01 22:04:01 +01:00
Andreas Schwab a4c0656f24 Fix use of extend_alloca in NIS
(cherry picked from commit caa78cf824)
2010-11-01 22:03:34 +01:00
Jakub Jelinek f4b045b4b9 Fix a couple of __REDIRECT () __THROW occurrences
This patch fixes some cases which fail to parse with C++.
(cherry picked from commit f32f28695d)
2010-11-01 22:03:00 +01:00
H.J. Lu 2158096703 Incorrect x86 CPU family and model check.
(cherry picked from commit 3c88fe1e3a)
2010-05-31 19:05:33 +02:00
Takashi Yoshii ef43572852 Fix iov[] size in SH register_dump()
(cherry picked from commit d2f7315176)
2010-05-31 19:02:36 +02:00
Ulrich Drepper 4d4e902530 Don't crash on unresolved weak symbol reference when auditing.
(cherry picked from commit b32b8b451b)
2010-05-31 19:00:37 +02:00
Andreas Schwab d0d308e32b Don't crash on unresolved weak symbol reference
(cherry picked from commit 9acbe24da8)
2010-05-31 19:00:16 +02:00
Andreas Schwab a8226edc79 sunrpc: Fix spurious fall-through
(cherry picked from commit f0ccf6ea41)
2010-05-31 18:59:48 +02:00
Petr Baudis f2020c6459 glibc 2.11.2 release 2010-05-19 22:38:20 +02:00
Andrew Stubbs 6be390f354 Fix FP exception control.
(cherry picked from commit 21a2b1aeeb)
2010-05-19 22:38:15 +02:00
Ulrich Drepper 6d270188ef Fix typos I added in malloc.c
(cherry picked from commit 9d2569846c)
2010-05-12 04:01:28 +02:00
Roland McGrath 32901cc363 Fix a const warning in ldconfig.
(cherry picked from commit 3f7dcb2b0f)
2010-05-12 03:22:45 +02:00
Andreas Schwab b9b562e8bc Fix lookup of collation sequence value during regexp matching
(cherry picked from commit d84acf388e)
2010-05-12 03:21:23 +02:00
Ulrich Drepper 50a66cf517 Fix ldconfig to handle symlinks in chroot correctly.
(cherry picked from commit 7dee26605b)
2010-05-12 03:21:22 +02:00
Ulrich Drepper c4e15a30bd Simplify OOM handling in ldconfig.
(cherry picked from commit f297602394)
2010-05-12 03:21:21 +02:00
Ulrich Drepper 8ef4dbaf6d One more bug in ldconfig -r handling.
(cherry picked from commit 49bd556d43)
2010-05-12 03:21:21 +02:00
Ulrich Drepper 850121f39d Fix handling if newline in addmntent.
(cherry picked from commit ab00f4eac8)
2010-05-12 03:21:20 +02:00
Bruno Haible 15290d7086 BZ #11538: Fix ttyname_r callers not to expect errno was set.
(cherry picked from commit 8c0677fe5d)
2010-05-12 03:21:19 +02:00
Bruno Haible ca27df35b7 BZ #11537: Hurd: Fix ttyname_r error return value.
(cherry picked from commit 6cffee3611)
2010-05-12 03:21:19 +02:00
Emilio Pozuelo Monfort 49c6fd1ff2 Hurd: Fix file_name_lookup_at error case return value.
(cherry picked from commit 67481400c5)
2010-05-12 03:21:18 +02:00
Andreas Schwab 59d5bd49df Don't crash in trace mode when dependencies are missing
(cherry picked from commit 18a26b301b)
2010-05-12 03:21:17 +02:00
Ulrich Drepper 39879d17a4 Fix crash on reloading of gai data in nscd.
(cherry picked from commit ea42a20cae)
2010-05-12 03:21:17 +02:00
Andreas Schwab 1aa9c16a2a Fix fallocate error return on i386.
(cherry picked from commit de240a05b3)
2010-05-12 03:21:16 +02:00
Eric Blake 6b6e2d505c getopt mishandles optstring of "+:"
(cherry picked from commit 66b93be793)
2010-05-12 03:21:15 +02:00
Eric Blake d75c76e1d7 getopt mistakenly allows '-;' as short option
(cherry picked from commit cf0b68196c)
2010-05-12 03:21:15 +02:00
Eric Blake 443a33d804 Fix -W with optional parameters in getopt.
According to the getopt documentation, if "W;" is part of optstring, then '-W
foo' should behave like '--foo'.  But if "foo" uses an optional_argument, this
is not the case, since optarg is not NULL when using -W.

(cherry picked from commit aa7f642769)
2010-05-12 03:21:14 +02:00
Ulrich Drepper 52ade99fe5 Handle DNS timeouts in old-style lookkup code.
(cherry picked from commit 4535680d03)
2010-05-12 03:21:13 +02:00
Ulrich Drepper fbca690a79 Fix aux cache handling in ldconfig with chroot.
(cherry picked from commit 4bc2bcba67)
2010-05-12 03:21:13 +02:00
Ulrich Drepper ed5e4f5aac Fix printing error messages in getopt.
(cherry picked from commit 247fdc8ee6)
2010-05-12 03:21:11 +02:00
Ulrich Drepper 1845ca2309 Declare iruserok and iruserok_af.
(cherry picked from commit 2cd9670885)
2010-05-12 03:21:11 +02:00
Ulrich Drepper 14b56bb117 Add test case for last argp bug.
(cherry picked from commit 7ebaec64a0)
2010-05-12 03:21:10 +02:00
Sergey Poznyakoff ec2c681f5d Fix option aliasing in argp.
(cherry picked from commit 8c6de69d00)
2010-05-12 03:21:09 +02:00
Ulrich Drepper 16c1804e69 Fix retrieving of kernel header version.
(cherry picked from commit 9e37946dba)
2010-05-12 03:21:09 +02:00
Ulrich Drepper 159aeed982 Fix concurrent handling of __cpu_features.
(cherry picked from commit 22f4f44b67)
2010-05-12 03:21:08 +02:00
Ulrich Drepper 043ea9e79d Handle unnecessary padding in getdents64.
The getdents64 syscall adds on 32-but platforms padding which isn't needed
and not included in the userlevel data structure definition.  We have to
avoid copying those padding bytes in the readdir64_r function.

(cherry picked from commit 1a81139728)
2010-05-12 03:21:07 +02:00
Ulrich Drepper ea614f680d Add missing include.
(cherry picked from commit 3fedf0feb7)
2010-05-12 03:21:07 +02:00
Ulrich Drepper 6c4a23bc8d Fix changes to interface list during getifaddrs calls.
(cherry picked from commit b8b14c4cc3)
2010-05-12 03:21:06 +02:00
Ulrich Drepper 02c9c5d2be Document problem with NATs in getaddrinfo.
(cherry picked from commit ed08740859)
2010-05-12 03:21:04 +02:00
Ulrich Drepper 888fec4045 Missing memory barrier in DES initialization.
(cherry picked from commit 647450cfb0)
2010-05-12 03:20:00 +02:00
Ulrich Drepper 64a532ff2c Fix set_max_fast in malloc.
(cherry picked from commit 991eda1ec1)
2010-05-12 02:27:16 +02:00
Andreas Schwab 9914417d12 Fix spurious UNAVAIL status is getaddrinfo
(cherry picked from commit c3dfadb87e)
2010-05-12 02:23:42 +02:00
Andreas Schwab 8469d71f1f Fix typo in cuserid
(cherry picked from commit 34b514dff6)
2010-05-12 02:22:09 +02:00
Jonathan Geisler f273badc6b calls to cuserid() can result in buffer overruns and/or overflows
(cherry picked from commit fd8ccb0427)
2010-05-12 02:21:02 +02:00
Paul Pluzhnikov 877103176f Fix missing dependency of localedata tests on gconv-modules
(cherry picked from commit 234333153e)
2010-05-12 02:17:09 +02:00
Richard Guenther 7dab764e60 Fix R_X86_64_PC32 overflow detection
(cherry picked from commit e39acb1f16)
2010-05-12 02:08:49 +02:00
Ulrich Drepper a82e74eb46 Fix reporting of I/O errors in *dprintf functions.
(cherry picked from commit 7ca890b88e)
2010-05-12 02:03:13 +02:00
Petr Baudis fae1e90fa1 Fix assertion in palloc and pvalloc as well.
(cherry picked from commit 8c0b5f148e)
2010-05-12 02:02:03 +02:00
Jim Meyering 3c0fb4080d manual: fix typo: s/are/is/
* manual/math.texi (BSD Random): Fix a typo: s/are/is/

(cherry picked from commit e2f4aa547a)
2010-05-12 02:01:03 +02:00
Jim Meyering 2da4488386 manual: adjust grammar
* manual/charset.texi: Adjust grammar.

(cherry picked from commit 82acaacb9c)
2010-05-12 02:00:47 +02:00
Jim Meyering a4b67d9bcd manual: fix doubled-words and typos
* manual/charset.texi (Selecting the Conversion): Likewise.
* manual/errno.texi (Error Messages): Likewise.
* manual/getopt.texi (Getopt Long Options): Likewise.
* manual/memory.texi (Resizing the Data Segment): Likewise.
* manual/message.texi (GUI program problems): Likewise.
* manual/resource.texi (CPU Affinity): Likewise.
* manual/stdio.texi (Streams and Threads): Likewise.
* manual/time.texi (High Accuracy Clock): Likewise.

(cherry picked from commit bbf70ae9ce)
2010-05-12 02:00:32 +02:00
Andreas Krebbel f514e0b227 S/390: Disable two UTF conversion instructions
(cherry picked from commit a3dc465852)
2010-05-12 01:57:36 +02:00
Ulrich Drepper 69ad8afe74 Fix file descriotor leak in nftw with FTW_CHDIR
(cherry picked from commit 247fdf2e2b)
2010-05-12 01:56:33 +02:00
Ulrich Drepper c648b3046e Fix i386 __mpn_lshift unwind info
(cherry picked from commit 1d7223f31a)
2010-05-12 01:54:24 +02:00
Ulrich Drepper b204d65517 Fix endless loop with invalid /etc/shells file.
(cherry picked from commit caa6e77293)
2010-05-12 01:41:59 +02:00
Andreas Schwab 272eb2b141 Don't map U00DF to U1E9E in toupper table.
(cherry picked from commit 1112095740)
2010-05-12 01:40:23 +02:00
Andreas Schwab 4aa960e79d Fix error checking in iconv.
(cherry picked from commit 7a51836002)
2010-05-12 01:40:00 +02:00
Ulrich Drepper 2ce2bf1a98 Add BZ number.
(cherry picked from commit 8549abcb9c)
2010-05-12 01:39:42 +02:00
Joe Landers 721d1acb10 _nl_load_locale() incorrectly handles mmap() failures
(cherry picked from commit 8b2f25c233)
2010-05-12 01:39:27 +02:00
Ulrich Drepper ea8e535ed1 Extend overflow detection in re_dfa_add_node.
(cherry picked from commit 2236464488)
2010-05-12 01:35:30 +02:00
Ulrich Drepper 5238213a22 regex: avoid internal re_realloc overflow
(cherry picked from commit 54dd0ab31f)
2010-05-12 01:33:46 +02:00
Andreas Schwab b95387484e Fix ____longjmp_chk for s390/s390x.
(cherry picked from commit e3b7670be2)
2010-05-12 01:31:53 +02:00
Ulrich Drepper b0e8ad9e4b Remove unnecessary returns.
(cherry picked from commit a7bbf3d742)
2010-05-12 01:30:07 +02:00
Andreas Schwab 72fe1ad152 Use correct type when casting d_tag.
(cherry picked from commit db07e962b6)
2010-05-12 01:28:15 +02:00
Andreas Schwab e73ad37f15 Ignore negative dynamic entry types.
(cherry picked from commit 7a033a828d)
2010-05-12 01:27:29 +02:00
Ulrich Drepper 8c55b16c2f Make unistd.h pre-c((-safe.
(cherry picked from commit 0b689682ad)
2010-05-12 00:53:22 +02:00
H.J. Lu ec10a41982 memchr overshoots on ia64
(cherry picked from commit 70b7d00fc7)
2010-05-11 01:26:57 +02:00
Ryan S. Arnold 71197fe61f Remove incorrect paring of /proc/stat etc.
(cherry picked from commit 3ed8e24122)
2010-05-10 21:37:36 +02:00
Paul Eggert 11c19d374b regcomp.c: do not ignore memory allocation failure
(cherry picked from commit 21f5de55ec)
2010-01-18 18:01:41 +01:00
Ulrich Drepper 2dfab6cf7c Fix typo in feature selection macro use.
(cherry picked from commit 44dcc00292)
2010-01-18 17:58:38 +01:00
Ulrich Drepper 7b35a400cf Avoid ELF lookup race.
On some architectures the update of the l_used field in the lookup
functions races with setting the other bits in the bitfield.  Simply
avoid this and optimize use of l_used in general.

(cherry picked from commit 2af6396817)
2010-01-18 17:56:49 +01:00
Ulrich Drepper a4b737aa08 Fix a few error cases in *name4_r lookup handling.
(cherry picked from commit a682a1bf55)
2010-01-18 17:54:36 +01:00
Petr Baudis 3decedce64 glibc 2.11.1 release 2009-12-08 21:10:20 +01:00
Andreas Schwab 1db8b35487 Fix infloop in __pthread_disable_asynccancel on x86_64
(cherry picked from commit b55ec98c64)
2009-12-04 14:52:25 +01:00
Ulrich Drepper bc207ace44 Avoid local PLTs.
(cherry picked from commit 0f622686af)
2009-12-04 14:51:20 +01:00
Ulrich Drepper 65a27b0b41 Prevent unintended file desriptor leak in grantpt.
The pt_chown program is completely transparently called.  It might
not be able to live with the various file descriptors the program
has open at the time of the call (e.g., under SELinux).  Close all
but the needed descriptor and connect stdin, stdout, and stderr
with /dev/null.  pt_chown shouldn't print anything when called to
do real work.

(cherry picked from commit 139ee080b6)
2009-12-04 14:50:39 +01:00
Ulrich Drepper 4f9d265e05 Fix startup to security-relevant statically linked binaries.
Before the change they crash on startup.  Perform IREL relocations
earlier to prevent this.

(cherry picked from commit 1c3c269b55)
2009-12-04 14:47:33 +01:00
Ulrich Drepper b15f34af1c Define week, first_weekday, and first_workday for hsb_DE locale.
(cherry picked from commit ee5a5ba672)
2009-12-04 14:47:20 +01:00
Ulrich Drepper ede3f7ef5c Define week, first_weekday, and first_workday for en_DK locale.
(cherry picked from commit 49c7f27194)
2009-12-04 14:47:10 +01:00
Ulrich Drepper 360f6f3a25 Fix week information for nl_NL locale.
(cherry picked from commit 6503cfe2de)
2009-12-04 14:46:56 +01:00
Ulrich Drepper 93721a641a Reinitialize _create_xid state after fork.
Programs forking and using RPC in the forks would use the same XIDs.

(cherry picked from commit c5a8b997e2)
2009-12-04 14:45:00 +01:00
H.J. Lu 8d7c09b162 Properly recover from shorter read.
(cherry picked from commit 6622141795)
2009-11-20 20:23:35 +01:00
Jakub Jelinek 1bc1954c73 Fix sync_file_range on ppc/ppc64.
I've noticed that sync_file_range is a stub on ppc/ppc64.
The kernel on these arches provides sync_file_range2 syscall with swapped
parameters.
The following completely untested patch ought to fix this.
(cherry picked from commit 8ad81b316b)
2009-11-19 23:03:21 +01:00
Ulrich Drepper 16b583ea7e Fix getwc* and putwc* on non-wide streams.
(cherry picked from commit df1934daa7)
2009-11-19 22:18:18 +01:00
Ulrich Drepper 488e337a17 Avoid warnings in CPU_* macros when using const bitsets.
(cherry picked from commit 03ebadd9ea)
2009-11-19 22:16:56 +01:00
Ulrich Drepper b12103e146 Whitespace fixes.
(cherry picked from commit 3933378fd3)
2009-11-18 10:10:40 +01:00
Ulrich Drepper c35a44f325 Add missing test files.
(cherry picked from commit 3a00b16da4)
2009-11-18 10:10:25 +01:00
Paolo Bonzini 1960ded78b Fix ranges with multibyte characters as endpoints.
This is another bug in computing the fastmap.  It was reported by a user
of sed because it usually does not happen with !_LIBC.  However, it is
there in that case too.

The bug is that whenever we have a range at the beginning of the regex,
the regex must be tested on any possible multibyte character.  The reason
why _LIBC masks it, is that in general there is a collation symbol for
each possible multibyte-character lead byte, so all the lead bytes are
in general already part of the fastmap.

The tests use cyrillic characters as an example.  With _LIBC, they pass
without the patch too, but you can make them fail by removing collation
symbols handling.

(cherry picked from commit 815d8147a3)
2009-11-18 10:09:58 +01:00
Ulrich Drepper b39591e9c1 Handle LC_GLOBAL_LOCALE in duplocale.
(cherry picked from commit 7443244740)
2009-11-18 10:09:35 +01:00
Ulrich Drepper c086031db0 Fix _NC_LOCALE_NAME definition.
(cherry picked from commit 4fb9241e4e)
2009-11-18 10:09:03 +01:00
Ulrich Drepper 22bdb3aa5b Add missing Linux MADV_* definitions.
(cherry picked from commit 2866eeb1b7)
2009-11-18 10:08:32 +01:00
Mike Frsyinger c0ca09284e Missing CL.
(cherry picked from commit fabe43aba8)
2009-11-18 10:07:41 +01:00
Mike Frsyinger c78e33c312 Fix building on x86 with older kernel headers.
Fix building on x86 when older linux headers lack __NR_fallocate define.

(cherry picked from commit f9a7bd536e)
2009-11-18 10:06:45 +01:00
Mike Frsyinger 3e224a852a Add missing stdio.h include.
(cherry picked from commit 5ec794b4b5)
2009-11-18 10:06:22 +01:00
Ulrich Drepper dc2d2c7e91 Fix F_SETOWN_EX and F_GETOWN_EX definitions.
(cherry picked from commit 8964681064)
2009-11-14 21:37:33 +01:00
178 changed files with 2679 additions and 929 deletions
+1
View File
@@ -1 +1,2 @@
timezone/* -whitespace
INSTALL -whitespace
+734
View File
@@ -1,3 +1,737 @@
2010-05-31 Petr Baudis <pasky@suse.cz>
[BZ #11149]
* elf/ldconfig.c (main): Allow aux_cache_file open()ing to fail
silently even in the chroot mode.
2010-05-31 Petr Baudis <pasky@suse.cz>
[BZ #10085]
* nis/nss_compat/compat-initgroups.c (internal_getgrent_r): Fix
initialization of skip_initgroups_dyn.
2010-09-27 Andreas Schwab <schwab@redhat.com>
[BZ #11611]
* sysdeps/unix/sysv/linux/internal_statvfs.c (INTERNAL_STATVFS):
Mask out sign-bit copies when constructing f_fsid.
2010-11-19 Ulrich Drepper <drepper@gmail.com>
* sysdeps/unix/sysv/linux/i386/bits/mman.h: Define MAP_HUGETLB.
* sysdeps/unix/sysv/linux/x86_64/bits/mman.h: Likewise.
2010-11-16 Ulrich Drepper <drepper@gmail.com>
* sysdeps/unix/sysv/linux/sys/swap.h (SWAP_FLAG_DISCARD): Define.
2010-11-11 Andreas Schwab <schwab@redhat.com>
* posix/fnmatch_loop.c (NEW_PATTERN): Fix use of alloca.
* posix/Makefile (tests): Add $(objpfx)tst-fnmatch-mem.
(tst-fnmatch-ENV): Set MALLOC_TRACE.
($(objpfx)tst-fnmatch-mem): New rule.
(generated): Add tst-fnmatch-mem and tst-fnmatch.mtrace.
* posix/tst-fnmatch.c (main): Call mtrace.
2010-08-09 Ulrich Drepper <drepper@redhat.com>
[BZ #11883]
* posix/fnmatch.c: Keep track of alloca use and fall back on malloc.
* posix/fnmatch_loop.c: Likewise.
2010-11-10 Luis Machado <luisgpm@br.ibm.com>
* sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c (__ieee754_sqrtl): Force
signed comparison.
2010-11-08 Ulrich Drepper <drepper@gmail.com>
[BZ #12194]
* sysdeps/i386/bits/byteswap.h: Avoid warning in __bswap_16.
* sysdeps/x86_64/bits/byteswap.h: Likewise.
2010-09-06 Andreas Schwab <schwab@redhat.com>
* manual/Makefile: Don't mix pattern rules with normal rules.
2010-08-12 Andreas Schwab <schwab@redhat.com>
[BZ #11904]
* locale/programs/locale.c (print_assignment): New function.
(show_locale_vars): Use it.
2010-10-26 Ulrich Drepper <drepper@gmail.com>
* elf/rtld.c (dl_main): Move assertion after the point where rtld map
is added to the list.
2010-10-20 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
Ulrich Drepper <drepper@gmail.com>
* elf/dl-object.c (_dl_new_object): Don't append the new object to
the global list here. Move code to...
(_dl_add_to_namespace_list): ...here. New function.
* elf/rtld.c (dl_main): Invoke _dl_add_to_namespace_list.
* sysdeps/generic/ldsodefs.h (_dl_add_to_namespace_list): Declare.
* elf/dl-load.c (lose): Don't remove the element from the list.
(_dl_map_object_from_fd): Invoke _dl_add_to_namespace_list.
(_dl_map_object): Likewise.
2010-10-24 Ulrich Drepper <drepper@redhat.com>
[BZ #12140]
* malloc/malloc.c (_int_free): Fill correct number of bytes when
perturbing.
2010-09-09 Andreas Schwab <schwab@redhat.com>
* Makeconfig (sysd-rules-patterns): Add rtld-%:rtld-%.
(sysd-rules-targets): Remove duplicates.
* elf/rtld-Rules ($(objpfx)rtld-%.os): Add pattern rules with
rtld-%.$o dependency.
2010-10-18 Andreas Schwab <schwab@redhat.com>
* elf/dl-open.c (dl_open_worker): Don't expand DST here, let
_dl_map_object do it.
2010-10-15 Andreas Schwab <schwab@redhat.com>
* scripts/data/localplt-s390-linux-gnu.data: New file.
* scripts/data/localplt-s390x-linux-gnu.data: New file.
2010-10-12 Ulrich Drepper <drepper@redhat.com>
[BZ #12078]
* posix/regcomp.c (parse_branch): One more memory leak plugged.
* posix/bug-regex31.input: Add test case.
2010-10-11 Ulrich Drepper <drepper@gmail.com>
* posix/bug-regex31.c: Rewrite to run multiple tests from stdin.
* posix/bug-regex31.input: New file.
[BZ #12078]
* posix/regcomp.c (parse_branch): Free memory when allocation failed.
(parse_sub_exp): Fix last change, use postorder.
* posix/bug-regex31.c: New file.
* posix/Makefile: Add rules to build and run bug-regex31.
* posix/regcomp.c (parse_bracket_exp): Add missing re_free calls.
[BZ #12078]
* posix/regcomp.c (parse_sub_exp): Free tree data when it is not used.
[BZ #12093]
* sysdeps/unix/sysv/linux/check_pf.c (__check_pf): ->ifa_addr might
be NULL.
2010-09-15 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/getdents.c (__GETDENTS): When
implementing getdents64 using getdents syscall, set d_type if
__ASSUME_GETDENTS32_D_TYPE.
2010-09-14 Andreas Schwab <schwab@redhat.com>
* sysdeps/s390/s390-32/__longjmp.c (__longjmp): Define register
variables after CHECK_SP call.
* sysdeps/s390/s390-64/__longjmp.c (__longjmp): Likewise.
2010-09-08 Chung-Lin Tang <cltang@codesourcery.com>
Ulrich Drepper <drepper@redhat.com>
[BZ #11968]
* sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
(____longjmp_chk): Use %ebx for saving value across system call.
Add unwind info.
2010-08-31 Mike Frysinger <vapier@gentoo.org>
* sysdeps/unix/sysv/linux/sparc/sys/epoll.h (epoll_create2): Delete.
(epoll_create1): Declare.
* sysdeps/unix/sysv/linux/x86_64/sys/epoll.h: Fix typo.
2010-08-31 Andreas Schwab <schwab@redhat.com>
[BZ #7066]
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix array overflow when
shifting retval into place.
2010-09-14 Ulrich Drepper <drepper@redhat.com>
* resolv/res_init.c (__res_vinit): Count the default server we added.
2010-08-25 Ulrich Drepper <drepper@redhat.com>
[BZ #10851]
* resolv/res_init.c (__res_vinit): When no server address at all
is given default to loopback.
2010-08-12 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/i386/elf/Makefile: New file.
2010-07-31 Samuel Thibault <samuel.thibault@ens-lyon.org>
* hurd/hurdselect.c (_hurd_select): Round timeout up instead of down
when converting to ms.
2010-07-29 Roland McGrath <roland@redhat.com>
[BZ 11856]
* manual/locale.texi (Yes-or-No Questions): Fix example code.
2010-07-27 Andreas Schwab <schwab@redhat.com>
* manual/memory.texi (Malloc Tunable Parameters): Document
M_PERTURB.
2010-07-26 Roland McGrath <roland@redhat.com>
[BZ #11840]
* configure.in (-fgnu89-inline check): Set and substitute
gnu89_inline, not libc_cv_gnu89_inline.
* configure: Regenerated.
* config.make.in (gnu89-inline-CFLAGS): Use @gnu89_inline@.
2010-07-20 Roland McGrath <roland@redhat.com>
* elf/dl-sysdep.c (_dl_important_hwcaps): Add dsocaps mask to
dl_hwcap_mask as well as dl_hwcap. Without this, dsocaps matching in
ld.so.cache was broken. With it, there is no way to disable dsocaps
like LD_HWCAP_MASK can disable hwcaps.
2010-07-05 Roland McGrath <roland@redhat.com>
* manual/arith.texi (Rounding Functions): Fix rint description
implicit in round description.
2010-07-02 Ulrich Drepper <drepper@redhat.com>
* elf/Makefile: Fix linking for a few tests to make recent linker
happy.
2010-06-02 Emilio Pozuelo Monfort <pochu27@gmail.com>
* hurd/lookup-at.c (__file_name_lookup_at): Accept
AT_SYMLINK_FOLLOW in AT_FLAGS. Fail with EINVAL if both
AT_SYMLINK_FOLLOW and AT_SYMLINK_NOFOLLOW are present
in AT_FLAGS.
* hurd/hurd/fd.h (__file_name_lookup_at): Update comment.
* sysdeps/mach/hurd/linkat.c (linkat): Pass O_NOLINK in FLAGS.
2010-11-03 H.J. Lu <hongjiu.lu@intel.com>
[BZ #12191]
* sysdeps/x86_64/cacheinfo.c (init_cacheinfo): Round
__x86_64_data_cache_size_half, __x86_64_data_cache_size
__x86_64_shared_cache_size_half and __x86_64_shared_cache_size,
to multiple of 256 bytes.
2010-11-03 Ulrich Drepper <drepper@gmail.com>
[BZ #12167]
* sysdeps/unix/sysv/linux/ttyname.c (ttyname): Recognize new mangling
of inacessible symlinks. Verify result of symlink before returning it.
* sysdeps/unix/sysv/linux/ttyname_r.c (__ttyname_r): Likewise.
Patch mostly by Miklos Szeredi <miklos@szeredi.hu>.
2010-10-25 Ulrich Drepper <drepper@redhat.com>
[BZ #12159]
* sysdeps/x86_64/multiarch/strchr.S: Fix propagation of search byte
into all bytes of SSE register.
Patch by Richard Li <richardpku@gmail.com>.
2010-10-22 Andreas Schwab <schwab@redhat.com>
* include/dlfcn.h (__RTLD_SECURE): Define.
* elf/dl-load.c (_dl_map_object): Remove preloaded parameter. Use
mode & __RTLD_SECURE instead.
(open_path): Rename preloaded parameter to secure.
* sysdeps/generic/ldsodefs.h (_dl_map_object): Adjust declaration.
* elf/dl-open.c (dl_open_worker): Adjust call to _dl_map_object.
* elf/dl-deps.c (openaux): Likewise.
* elf/rtld.c (struct map_args): Remove is_preloaded.
(map_doit): Don't use it.
(dl_main): Likewise.
(do_preload): Use __RTLD_SECURE instead of is_preloaded.
(dlmopen_doit): Add __RTLD_SECURE to mode bits.
2010-10-06 Ulrich Drepper <drepper@gmail.com>
* string/bug-strstr1.c: New file.
* string/Makefile: Add rules to build and run bug-strstr1.
2010-10-05 Eric Blake <eblake@redhat.com>
[BZ #12092]
* string/str-two-way.h (two_way_long_needle): Always clear memory
when skipping input due to the shift table.
2010-10-03 Ulrich Drepper <drepper@gmail.com>
[BZ #12005]
* malloc/mcheck.c: Handle large requests.
[BZ #12077]
* sysdeps/x86_64/strcmp.S: Fix handling of remaining bytes in buffer
for strncmp and strncasecmp.
* string/stratcliff.c: Add tests for strcmp and strncmp.
* wcsmbs/wcsatcliff.c: Adjust for stratcliff change.
2010-06-02 Kirill A. Shutemov <kirill@shutemov.name>
* elf/dl-reloc.c: Flush cache after solving TEXTRELs if arch
requires it.
2010-06-02 Andreas Schwab <schwab@redhat.com>
* nis/nss_nis/nis-initgroups.c (get_uid): Properly resize buffer.
2010-06-07 Jakub Jelinek <jakub@redhat.com>
* libio/stdio.h (sscanf, vsscanf): Use __REDIRECT_NTH instead of
__REDIRECT followed by __THROW.
* wcsmbs/wchar.h (swscanf, vswscanf): Likewise.
* posix/getopt.h (getopt): Likewise.
2010-05-26 H.J. Lu <hongjiu.lu@intel.com>
[BZ #11640]
* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features):
Properly check family and model.
2010-05-26 Takashi Yoshii <takashi.yoshii.zj@renesas.com>
* sysdeps/unix/sysv/linux/sh/sh4/register-dump.h: Fix iov[] size.
2010-05-21 Ulrich Drepper <drepper@redhat.com>
* elf/dl-runtime.c (_dl_profile_fixup): Don't crash on unresolved weak
symbol reference.
2010-05-19 Andreas Schwab <schwab@redhat.com>
* elf/dl-runtime.c (_dl_fixup): Don't crash on unresolved weak
symbol reference.
2010-05-21 Andreas Schwab <schwab@redhat.com>
* sunrpc/clnt_tcp.c (clnttcp_control): Add missing break.
* sunrpc/clnt_udp.c (clntudp_control): Likewise.
* sunrpc/clnt_unix.c (clntunix_control): Likewise.
2010-05-12 Andrew Stubbs <ams@codesourcery.com>
* sysdeps/sh/sh4/fpu/feholdexcpt.c (feholdexcept): Really disable all
exceptions. Return 0.
2010-05-07 Roland McGrath <roland@redhat.com>
* elf/ldconfig.c (main): Add a const.
2010-05-04 Andreas Schwab <schwab@redhat.com>
* posix/regexec.c (find_collation_sequence_value): Fix skipping
the wide char sequence of the collating element.
2010-05-03 Ulrich Drepper <drepper@redhat.com>
[BZ #11149]
* elf/ldconfig.c (search_dir): Fix handling of symlinks in chroot.
* elf/chroot_canon.c (chroot_canon): Use xmalloc and xrealloc.
* elf/ldconfig.c (parse_conf_include): Don't fall back to
directories named in config file outside the chroot.
2010-05-02 Ulrich Drepper <drepper@redhat.com>
* misc/mntent_r.c (encode_name): The slow loop handles newlines so we
should recognize them as an abort condition.
Patch by Jan Lieskovsky <jlieskov@redhat.com>.
2010-04-25 Bruno Haible <bruno@clisp.org>
[BZ #11538]
* sysdeps/unix/bsd/ptsname.c (__ptsname_r): Use __ttyname_r's return
value instead of errno.
* sysdeps/unix/getlogin.c (getlogin): Likewise.
[BZ #11537]
* sysdeps/mach/hurd/ttyname_r.c (__ttyname_r): Upon failure, return
errno, not -1.
2010-04-24 Emilio Pozuelo Monfort <pochu27@gmail.com>
* hurd/lookup-at.c (__file_name_lookup_at): Fix error return value.
2010-04-14 Andreas Schwab <schwab@redhat.com>
* elf/dl-version.c (_dl_check_map_versions): Avoid index overflow
when dependencies are missing.
2010-04-09 Ulrich Drepper <drepper@redhat.com>
* nscd/aicache.c (addhstaiX): Correct passing memory to address
list to gethostbyname4_r functions.
* resolv/nss_dns/dns-host.c (gaih_getanswer_slice): Optimize
copying of h_name.
2010-04-07 Andreas Schwab <schwab@redhat.com>
* sysdeps/unix/sysv/linux/i386/fallocate.c: Set errno on error.
* sysdeps/unix/sysv/linux/i386/fallocate64.c: Likewise.
2009-12-01 Eric Blake <ebb9@byu.net>
[BZ #11039]
* posix/getopt.c (_getopt_internal_r): Skip optional - or + before
checking lead byte of optstring for :.
[BZ #11040]
* posix/getopt.c (_getopt_internal_r): Reject '-;' as short
option, since it conflicts with "W;" optstring extension.
2009-12-02 Eric Blake <ebb9@byu.net>
[BZ #11041]
* posix/getopt.c (_getopt_internal_r): Handle '-Wfoo' identically
to '--foo', with optional argument or non-ambiguous prefix.
2010-04-05 Ulrich Drepper <drepper@redhat.com>
[BZ #11010]
* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r): Handle
timeouts from servers.
[BZ #11149]
* elf/ldconfig.c (main): Respect chroot setting when looking for
the aux cache.
2010-04-04 Ulrich Drepper <drepper@redhat.com>
[BZ #11043]
* posix/getopt.c (_getopt_internal_r): Fix arguments printed in error
messages.
[BZ #11070]
* resolv/netdb.h: Declare iruserok and iruserok_af.
* argp/Makefile: Add rules to build and run bug-argp2.
* argp/bug-argp2.c: New file.
2010-02-05 Sergey Poznyakoff <gray@gnu.org.ua>
[BZ #11254]
* argp/argp-parse.c (convert_options): Fix improper use of `|'
between character values.
2010-04-04 Ulrich Drepper <drepper@redhat.com>
[BZ #11287]
* csu/Makefile ($(objpfx)version-info.h): Handle newer kernel headers
which don't define UTS_RELEASE.
2010-04-04 H.J. Lu <hongjiu.lu@intel.com>
Ulrich Drepper <drepper@redhat.com>
[BZ #11292]
* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features): Allow
concurrent initialization and use of __cpu_features.
2010-04-04 Ulrich Drepper <drepper@redhat.com>
* sysdeps/x86_64/multiarch/init-arch.h (cpu_features): Add tag to
the enum.
2010-04-03 Ulrich Drepper <drepper@redhat.com>
[BZ #11333]
* sysdeps/unix/readdir_r.c (__READDIR_R): Add support for platforms
which include unnecessary padding in d_reclen.
* sysdeps/unix/sysv/linux/i386/readdir64_r.c: Select work-around for
unnecessary padding.
[BZ #11387]
* sysdeps/unix/sysv/linux/ifaddrs.c (map_newlin): Don't abort on
unknown interface, return -1.
(getifaddrs_internal): Rename from getifaddrs. Handle errors in
map_newlink be returning -EAGAIN.
(getifaddrs): If -EAGAIN is returned from getifaddrs_internal try
again.
2010-04-03 Ulrich Drepper <drepper@redhat.com>
[BZ #11438]
* posix/gai.conf: Document problems with IPv4 site-local addresses and
NATs.
[BZ #11449]
* crypt/crypt_util.c (__init_des_r): Add memory barrier before setting
small_tables_initialized.
* malloc/malloc.c (set_max_fast): Fix computation of the value.
2010-03-25 Andreas Schwab <schwab@redhat.com>
* sysdeps/posix/getaddrinfo.c (gaih_inet): Reset no_data before
each action.
2010-03-25 Andreas Schwab <schwab@redhat.com>
* sysdeps/posix/cuserid.c: Fix typo.
2010-03-24 Ulrich Drepper <drepper@redhat.com>
[BZ #11397]
* sysdeps/posix/cuserid.c (cuserid): Make sure the returned string
is NUL terminated.
Patch by Jonathan Geisler <jgeisler@cse.taylor.edu>.
2010-03-02 Richard Guenther <rguenther@suse.de>
* sysdeps/x86_64/dl-machine.h (elf_machine_rela): R_X86_64_PC32
is sign-extending.
2010-02-24 Ulrich Drepper <drepper@redhat.com>
[BZ #11319]
* libio/iovdprintf.c (_IO_vdprintf): Explicitly flush stream before
undoing the stream because _IO_FINISH doesn't report failures.
[BZ #5553]
* malloc/malloc.c (public_vALLOc): Set ar_ptr when trying main_arena.
(public_pVALLOc): Likewise.
Patch by Petr Baudis.
2010-02-22 Jim Meyering <meyering@redhat.com>
* manual/math.texi (BSD Random): Fix a typo: s/are/is/
* manual/charset.texi: Adjust grammar.
* manual/errno.texi (Error Messages): Fix doubled-words and typos.
* manual/charset.texi (Selecting the Conversion): Likewise.
* manual/getopt.texi (Getopt Long Options): Likewise.
* manual/memory.texi (Resizing the Data Segment): Likewise.
* manual/message.texi (GUI program problems): Likewise.
* manual/resource.texi (CPU Affinity): Likewise.
* manual/stdio.texi (Streams and Threads): Likewise.
* manual/time.texi (High Accuracy Clock): Likewise.
2010-02-11 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* sysdeps/s390/s390-64/utf8-utf16-z9.c: Disable hardware
instructions cu21 and cu24. Add well-formedness checking
parameter and adjust the software implementation.
* sysdeps/s390/s390-64/utf16-utf32-z9.c: Likewise.
2010-02-10 Ulrich Drepper <drepper@redhat.com>
[BZ #11271]
* io/ftw.c (ftw_startup): Close descriptor for initial directory
after changing back to it.
2010-02-09 Ulrich Drepper <drepper@redhat.com>
* sysdeps/i386/lshift.S: Fix unwind information.
2010-02-03 Ulrich Drepper <drepper@redhat.com>
[BZ #11242]
* misc/getusershell.c (initshells): Allocate one more byte in input
buffer so that fgets doesn't loop undefinitely.
2010-01-25 Andreas Schwab <schwab@redhat.com>
* iconv/iconv_prog.c (write_output): Fix check for open failure.
2010-01-22 Ulrich Drepper <drepper@redhat.com>
[BZ #11200]
* locale/loadlocale.c (_nl_load_locale): Fix recognition of genuine
mmap resource problem. Patch by Joe Landers <jlanders@vmware.com>.
2010-01-22 Jim Meyering <jim@meyering.net>
[BZ #11184]
* posix/regex_internal.c (re_dfa_add_node): Extend the overflow
detection test. Patch by Paul Eggert.
[BZ #11183]
* posix/regex_internal.c (re_string_realloc_buffers):
Detect and handle internal overflow. Patch by Paul Eggert
2010-01-20 Andreas Schwab <schwab@redhat.com>
* sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
(CHECK_SP): Fix check for alternate stack.
* sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
(CHECK_SP): Likewise.
2010-01-19 Ulrich Drepper <drepper@redhat.com>
[BZ #11194]
* misc/bits/syslog.h (syslog, vsyslog): Remove unnecessary return.
2010-01-18 Andreas Schwab <schwab@redhat.com>
* elf/dynamic-link.h (elf_get_dynamic_info): Use correct type when
casting d_tag.
* elf/dynamic-link.h (elf_get_dynamic_info): Ignore negative
dynamic entry types.
2010-01-14 Ulrich Drepper <drepper@redhat.com>
* bits/confname.h: Make pre-C99-safe.
2010-02-05 H.J. Lu <hongjiu.lu@intel.com>
[BZ #11230]
* sysdeps/ia64/memchr.S: Don't read beyond the last byte
during recovery.
2010-03-25 Ryan S. Arnold <rsa@us.ibm.com>
* sysdeps/unix/sysv/linux/getsysstats.c (next_line): Remove
redundant and incorrect else block which overwrites current line
with the partial next line.
2010-01-14 Ulrich Drepper <drepper@redhat.com>
[BZ #11127]
* posix/regcomp.c (alc_eclosure_iter): Do not ignore
re_node_set_insert failure; return REG_ESPACE.
Patch by Paul Eggert.
2010-01-06 Ulrich Drepper <drepper@redhat.com>
* dirent/dirent.h: Fix typo in feature selection macro use.
2009-12-15 Ulrich Drepper <drepper@redhat.com>
* include/link.h (struct link_map): Move l_used into its own word.
* elf/dl-lookup.c (_dl_lookup_symbol_x): Only update l_used when it is
still zero.
* elf/dl-object.c (_dl_new_object): Set dl_used if we know it is
never really used.
2009-12-10 Ulrich Drepper <drepper@redhat.com>
[BZ #11000]
* nis/nss_nis/nis-hosts.c (_nss_nis_gethostbyname4_r): Always set
*herrnop before returning.
* nis/nss_nisplus/nisplus-hosts.c (internal_gethostbyname2_r):
Likewise.
* nss/nss_files/files-hosts.c (_nss_files_gethostbyname4_r): Handle
TRYAGAIN errors separately.
* sysdeps/posix/getaddrinfo.c (gaih_inet): Fix error handling of
*name4_r after functions.
2009-11-24 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/grantpt.c (grantpt): Use CLOSE_ALL_FDS is available
before the exec.
* sysdeps/unix/sysv/linux/grantpt.c: New file.
* login/programs/pt_chown.c (main): Don't print message on errors
when doing real work.
* csu/elf-init.c (__libc_csu_irel): New function. Code to perform
irel relocations split out from...
(__libc_csu_init): ...here.
* csu/libc-start.c [!SHARED]: Call __libc_csu_irel early.
2009-11-22 Ulrich Drepper <drepper@redhat.com>
* sunrpc/create_xid.c (_create_xid): Reinitialize state after fork.
2009-11-18 H.J. Lu <hongjiu.lu@intel.com>
[BZ #10162]
* sysdeps/ia64/memchr.S: Don't use a simple loop on data shorter
than software pipeline. Properly recover from shorter read.
2009-11-16 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/sync_file_range.c (sync_file_range):
Implement using sync_file_range2 syscall if __NR_sync_file_range2
is defined.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c: New
file.
2009-11-19 Ulrich Drepper <drepper@redhat.com>
[BZ #10958]
* libio/libio.h (_IO_getwc_unlocked): Check for _wide_data being
initialized before using it.
(_IO_putwc_unlocked): Likewise.
[BZ #10918]
* sysdeps/unix/sysv/linux/bits/sched.h (__CPU_ISSET_S): Use __const
in cast to not throw away const-ness of parameters.
(__CPU_EQUAL_S): Likewise.
(__CPU_OP_S): Likewise.
2009-11-17 Paolo Bonzini <bonzini@gnu.org>
* posix/bug-regex30.c: New file.
* posix/Makefile: Add rules to build and run bug-regex30.
* posix/regcomp.c (re_compile_fastmap_iter): Add all multibyte
character lead bytes when there is a range in a COMPLEX_BRACKET.
Reported by Oleg Bylatov.
2009-11-17 Ulrich Drepper <drepper@redhat.com>
[BZ #10969]
* locale/duplocale.c (__duplocale): Handle LC_GLOBAL_LOCALE special.
* locale/tst-duplocale.c: New file.
* locale/Makefile (tests): Add tst-duplocale.
[BZ #10968]
* locale/langinfo.h (_NL_LOCALE_NAME): Correct definition.
Patch by Bruno Haible <bruno@clisp.org>.
* locale/tst-locname.c: New file.
* locale/Makefile (tests): Add tst-locname.
[BZ #10972]
* sysdeps/unix/sysv/linux/powerpc/bits/mman.h: Add new MADV_*
constants from recent kernels.
* sysdeps/unix/sysv/linux/i386/bits/mman.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/bits/mman.h: Likewise.
* sysdeps/unix/sysv/linux/s390/bits/mman.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/mman.h: Likewise.
* sysdeps/unix/sysv/linux/sh/bits/mman.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/bits/mman.h: Likewise.
2009-11-09 Mike Frysinger <vapier@gentoo.org>
* sysdeps/unix/sysv/linux/i386/fallocate.c: Include errno.h.
(fallocate): Return ENOSYS if __NR_fallocate is not defined.
* sysdeps/unix/sysv/linux/i386/fallocate64.c: Likewise.
2009-11-06 Mike Frysinger <vapier@gentoo.org>
* posix/bug-regex29.c: Include stdio.h.
2009-11-14 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Update F_SETOWN_EX and
F_GETOWN_EX definitions according to corrected kernel definitions.
* sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
* sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise.
* sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise.
2009-11-10 Andreas Schwab <schwab@redhat.com>
* resolv/mapv4v6hostent.h (map_v4v6_hostent): Return non-zero if
+3 -2
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
+55
View File
@@ -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
View File
@@ -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
View File
@@ -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@
Vendored
+3 -3
View File
@@ -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
View File
@@ -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,
+43 -41
View File
@@ -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
View File
@@ -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
View File
@@ -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;
+6
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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;
+1 -1
View File
@@ -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,
+22 -23
View File
@@ -801,19 +801,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 +886,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 +1483,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 +1796,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 +1878,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 +1947,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 +2051,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 +2067,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 +2084,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,
@@ -2159,7 +2155,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. */
@@ -2204,7 +2200,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 +2218,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)
+4 -3
View File
@@ -777,7 +777,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 +822,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 +845,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
View File
@@ -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
View File
@@ -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
View File
@@ -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;
}
+7 -5
View File
@@ -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 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)
{
+5
View File
@@ -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)
{
+8 -4
View File
@@ -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
View File
@@ -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;
+26 -10
View File
@@ -773,7 +773,18 @@ search_dir (const struct dir_entry *entry)
{
/* In case of symlink, we check if the symlink refers to
a directory. */
if (__builtin_expect (stat64 (real_file_name, &stat_buf), 0))
char *target_name = real_file_name;
if (opt_chroot)
{
target_name = chroot_canon (opt_chroot, file_name);
if (target_name == NULL)
{
if (strstr (file_name, ".so") == NULL)
error (0, 0, _("Input file %s not found.\n"), file_name);
continue;
}
}
if (__builtin_expect (stat64 (target_name, &stat_buf), 0))
{
if (opt_verbose)
error (0, errno, _("Cannot stat %s"), file_name);
@@ -1174,7 +1185,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 +1318,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 +1357,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 +1371,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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
+1
View File
@@ -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
View File
@@ -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 -1
View File
@@ -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)
+4 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
+1
View File
@@ -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 */
+30 -7
View File
@@ -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);
}
+14
View File
@@ -0,0 +1,14 @@
#include <locale.h>
#include <stdio.h>
static int
do_test (void)
{
locale_t d = duplocale (LC_GLOBAL_LOCALE);
if (d != (locale_t) 0)
freelocale (d);
return 0;
}
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
+20
View File
@@ -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"
+20
View File
@@ -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.
+5
View File
@@ -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
View File
@@ -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
View File
@@ -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
+1 -2
View File
@@ -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
View File
@@ -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
+2 -3
View File
@@ -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
+13 -10
View File
@@ -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
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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 -3
View File
@@ -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
+2 -2
View File
@@ -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++;
+3 -3
View File
@@ -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
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; \
+11 -8
View File
@@ -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
View File
@@ -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);
+1 -1
View File
@@ -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;
+31 -27
View File
@@ -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,
+25
View File
@@ -1,3 +1,28 @@
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
View File
@@ -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
@@ -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)
+3 -2
View File
@@ -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. */
+1 -6
View File
@@ -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. */
+6 -4
View File
@@ -1,5 +1,5 @@
/* Cache handling for host lookup.
Copyright (C) 2004-2008, 2009 Free Software Foundation, Inc.
Copyright (C) 2004-2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -111,7 +111,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
int old_res_options = _res.options;
_res.options &= ~RES_USE_INET6;
size_t tmpbuf6len = 512;
size_t tmpbuf6len = 1024;
char *tmpbuf6 = alloca (tmpbuf6len);
size_t tmpbuf4len = 0;
char *tmpbuf4 = NULL;
@@ -133,9 +133,11 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
"gethostbyname4_r");
if (fct4 != NULL)
{
struct gaih_addrtuple *at = NULL;
struct gaih_addrtuple atmem;
struct gaih_addrtuple *at;
while (1)
{
at = &atmem;
rc6 = 0;
herrno = 0;
status[1] = DL_CALL_FCT (fct4, (key, &at, tmpbuf6, tmpbuf6len,
@@ -153,7 +155,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
goto next_nip;
/* We found the data. Count the addresses and the size. */
for (const struct gaih_addrtuple *at2 = at; at2 != NULL;
for (const struct gaih_addrtuple *at2 = at = &atmem; at2 != NULL;
at2 = at2->next)
{
++naddrs;
+5
View File
@@ -423,6 +423,11 @@ _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
if (! keep_stream)
internal_endent ();
}
else if (status == NSS_STATUS_TRYAGAIN)
{
*errnop = errno;
*herrnop = TRY_AGAIN;
}
else
{
*errnop = errno;
+17 -4
View File
@@ -82,7 +82,7 @@ tests := tstgetopt testfnm runtests runptests \
bug-regex17 bug-regex18 bug-regex19 bug-regex20 \
bug-regex21 bug-regex22 bug-regex23 bug-regex24 \
bug-regex25 bug-regex26 bug-regex27 bug-regex28 \
bug-regex29 \
bug-regex29 bug-regex30 bug-regex31 \
tst-nice tst-nanosleep tst-regex2 \
transbug tst-rxspencer tst-pcre tst-boost \
bug-ga1 tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \
@@ -109,10 +109,12 @@ generated := $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 10) \
annexc annexc.out wordexp-tst.out bug-regex2-mem \
bug-regex2.mtrace bug-regex14-mem bug-regex14.mtrace \
bug-regex21-mem bug-regex21.mtrace \
bug-regex31-mem bug-regex31.mtrace \
tst-rxspencer-mem tst-rxspencer.mtrace tst-getconf.out \
tst-pcre-mem tst-pcre.mtrace tst-boost-mem tst-boost.mtrace \
bug-ga2.mtrace bug-ga2-mem bug-glob2.mtrace bug-glob2-mem \
tst-vfork3-mem tst-vfork3.mtrace getconf.speclist
tst-vfork3-mem tst-vfork3.mtrace getconf.speclist \
tst-fnmatch-mem tst-fnmatch.mtrace
include ../Rules
@@ -195,6 +197,7 @@ bug-regex22-ENV = LOCPATH=$(common-objpfx)localedata
bug-regex23-ENV = LOCPATH=$(common-objpfx)localedata
bug-regex25-ENV = LOCPATH=$(common-objpfx)localedata
bug-regex26-ENV = LOCPATH=$(common-objpfx)localedata
bug-regex30-ENV = LOCPATH=$(common-objpfx)localedata
tst-rxspencer-ARGS = --utf8 rxspencer/tests
tst-rxspencer-ENV = LOCPATH=$(common-objpfx)localedata
tst-pcre-ARGS = PCRE.tests
@@ -221,9 +224,9 @@ endif
tests: $(objpfx)annexc.out
ifeq (no,$(cross-compiling))
tests: $(objpfx)bug-regex2-mem $(objpfx)bug-regex14-mem \
$(objpfx)bug-regex21-mem $(objpfx)tst-rxspencer-mem \
$(objpfx)bug-regex21-mem $(objpfx)bug-regex31-mem $(objpfx)tst-rxspencer-mem\
$(objpfx)tst-pcre-mem $(objpfx)tst-boost-mem $(objpfx)tst-getconf.out \
$(objpfx)bug-glob2-mem $(objpfx)tst-vfork3-mem
$(objpfx)bug-glob2-mem $(objpfx)tst-vfork3-mem $(objpfx)tst-fnmatch-mem
xtests: $(objpfx)bug-ga2-mem
endif
@@ -235,6 +238,11 @@ annexc-CFLAGS = -O
$(objpfx)annexc: annexc.c
$(native-compile)
tst-fnmatch-ENV += MALLOC_TRACE=$(objpfx)tst-fnmatch.mtrace
$(objpfx)tst-fnmatch-mem: $(objpfx)tst-fnmatch.out
$(common-objpfx)malloc/mtrace $(objpfx)tst-fnmatch.mtrace > $@
bug-regex2-ENV = MALLOC_TRACE=$(objpfx)bug-regex2.mtrace
$(objpfx)bug-regex2-mem: $(objpfx)bug-regex2.out
@@ -250,6 +258,11 @@ bug-regex21-ENV = MALLOC_TRACE=$(objpfx)bug-regex21.mtrace
$(objpfx)bug-regex21-mem: $(objpfx)bug-regex21.out
$(common-objpfx)malloc/mtrace $(objpfx)bug-regex21.mtrace > $@
bug-regex31-ENV = MALLOC_TRACE=$(objpfx)bug-regex31.mtrace
$(objpfx)bug-regex31-mem: $(objpfx)bug-regex31.out
$(common-objpfx)malloc/mtrace $(objpfx)bug-regex31.mtrace > $@
tst-vfork3-ENV = MALLOC_TRACE=$(objpfx)tst-vfork3.mtrace
$(objpfx)tst-vfork3-mem: $(objpfx)tst-vfork3.out
+1
View File
@@ -1,4 +1,5 @@
#include <regex.h>
#include <stdio.h>
static int
do_test (void)
+103
View File
@@ -0,0 +1,103 @@
/* Russian regular expression tests.
Copyright (C) 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paolo Bonzini <pbonzini@redhat.com>, 2009.
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 <sys/types.h>
#include <mcheck.h>
#include <regex.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
/* Tests supposed to match. */
struct
{
const char *pattern;
const char *string;
int flags, nmatch;
regmatch_t rm[5];
} tests[] = {
/* U+0413 \xd0\x93 CYRILLIC CAPITAL LETTER GHE
U+0420 \xd0\xa0 CYRILLIC CAPITAL LETTER ER
U+0430 \xd0\xb0 CYRILLIC SMALL LETTER A
U+0433 \xd0\xb3 CYRILLIC SMALL LETTER GHE
U+0440 \xd1\x80 CYRILLIC SMALL LETTER ER
U+044F \xd1\x8f CYRILLIC SMALL LETTER YA */
{ "[\xd0\xb0-\xd1\x8f]", "\xd0\xb3", 0, 1,
{ { 0, 2 } } },
{ "[\xd0\xb0-\xd1\x8f]", "\xd0\x93", REG_ICASE, 1,
{ { 0, 2 } } },
{ "[\xd1\x80-\xd1\x8f]", "\xd0\xa0", REG_ICASE, 1,
{ { 0, 2 } } },
};
static int
do_test (void)
{
if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL)
{
puts ("setlocale failed");
return 1;
}
int ret = 0;
for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i)
{
regex_t re;
regmatch_t rm[5];
int n = regcomp (&re, tests[i].pattern, tests[i].flags);
if (n != 0)
{
char buf[500];
regerror (n, &re, buf, sizeof (buf));
printf ("regcomp %zd failed: %s\n", i, buf);
ret = 1;
continue;
}
if (regexec (&re, tests[i].string, tests[i].nmatch, rm, 0))
{
printf ("regexec %zd failed\n", i);
ret = 1;
regfree (&re);
continue;
}
for (n = 0; n < tests[i].nmatch; ++n)
if (rm[n].rm_so != tests[i].rm[n].rm_so
|| rm[n].rm_eo != tests[i].rm[n].rm_eo)
{
if (tests[i].rm[n].rm_so == -1 && tests[i].rm[n].rm_eo == -1)
break;
printf ("regexec match failure rm[%d] %d..%d\n",
n, rm[n].rm_so, rm[n].rm_eo);
ret = 1;
break;
}
regfree (&re);
}
return ret;
}
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
+36
View File
@@ -0,0 +1,36 @@
#include <mcheck.h>
#include <regex.h>
#include <stdio.h>
#include <sys/types.h>
int
main (void)
{
mtrace ();
int res = 0;
char *buf = NULL;
size_t len = 0;
while (! feof (stdin))
{
ssize_t n = getline (&buf, &len, stdin);
if (n <= 0)
break;
if (buf[n - 1] == '\n')
buf[n - 1] = '\0';
regex_t regex;
int rc = regcomp (&regex, buf, REG_EXTENDED);
if (rc != 0)
printf ("%s: Error %d (expected)\n", buf, rc);
else
{
printf ("%s: succeeded !\n", buf);
res = 1;
}
}
free (buf);
return 0;
}
+4
View File
@@ -0,0 +1,4 @@
[[][
([0]
([0]a
([0]([0])
+44 -13
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2007
/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2007,2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -41,6 +41,12 @@
# include <stdlib.h>
#endif
#ifdef _LIBC
# include <alloca.h>
#else
# define alloca_account(size., var) alloca (size)
#endif
/* For platform which support the ISO C amendement 1 functionality we
support user defined character classes. */
#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
@@ -330,8 +336,11 @@ fnmatch (pattern, string, flags)
mbstate_t ps;
size_t n;
const char *p;
wchar_t *wpattern_malloc = NULL;
wchar_t *wpattern;
wchar_t *wstring_malloc = NULL;
wchar_t *wstring;
size_t alloca_used = 0;
/* Convert the strings into wide characters. */
memset (&ps, '\0', sizeof (ps));
@@ -343,7 +352,8 @@ fnmatch (pattern, string, flags)
#endif
if (__builtin_expect (n < 1024, 1))
{
wpattern = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
wpattern = (wchar_t *) alloca_account ((n + 1) * sizeof (wchar_t),
alloca_used);
n = mbsrtowcs (wpattern, &p, n + 1, &ps);
if (__builtin_expect (n == (size_t) -1, 0))
/* Something wrong.
@@ -365,8 +375,11 @@ fnmatch (pattern, string, flags)
XXX Do we have to set `errno' to something which mbsrtows hasn't
already done? */
return -1;
wpattern = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
wpattern_malloc = wpattern
= (wchar_t *) malloc ((n + 1) * sizeof (wchar_t));
assert (mbsinit (&ps));
if (wpattern == NULL)
return -2;
(void) mbsrtowcs (wpattern, &pattern, n + 1, &ps);
}
@@ -379,13 +392,18 @@ fnmatch (pattern, string, flags)
p = string;
if (__builtin_expect (n < 1024, 1))
{
wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
wstring = (wchar_t *) alloca_account ((n + 1) * sizeof (wchar_t),
alloca_used);
n = mbsrtowcs (wstring, &p, n + 1, &ps);
if (__builtin_expect (n == (size_t) -1, 0))
/* Something wrong.
XXX Do we have to set `errno' to something which mbsrtows hasn't
already done? */
return -1;
{
/* Something wrong.
XXX Do we have to set `errno' to something which
mbsrtows hasn't already done? */
free_return:
free (wpattern_malloc);
return -1;
}
if (p)
{
memset (&ps, '\0', sizeof (ps));
@@ -400,19 +418,32 @@ fnmatch (pattern, string, flags)
/* Something wrong.
XXX Do we have to set `errno' to something which mbsrtows hasn't
already done? */
return -1;
wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
goto free_return;
wstring_malloc = wstring
= (wchar_t *) malloc ((n + 1) * sizeof (wchar_t));
if (wstring == NULL)
{
free (wpattern_malloc);
return -2;
}
assert (mbsinit (&ps));
(void) mbsrtowcs (wstring, &string, n + 1, &ps);
}
return internal_fnwmatch (wpattern, wstring, wstring + n,
flags & FNM_PERIOD, flags, NULL);
int res = internal_fnwmatch (wpattern, wstring, wstring + n,
flags & FNM_PERIOD, flags, NULL,
alloca_used);
free (wstring_malloc);
free (wpattern_malloc);
return res;
}
# endif /* mbstate_t and mbsrtowcs or _LIBC. */
return internal_fnmatch (pattern, string, string + strlen (string),
flags & FNM_PERIOD, flags, NULL);
flags & FNM_PERIOD, flags, NULL, 0);
}
# ifdef _LIBC
+82 -48
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991-1993,1996-2001,2003-2005,2007
/* Copyright (C) 1991-1993,1996-2001,2003-2005,2007,2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -28,22 +28,24 @@ struct STRUCT
it matches, nonzero if not. */
static int FCT (const CHAR *pattern, const CHAR *string,
const CHAR *string_end, int no_leading_period, int flags,
struct STRUCT *ends)
struct STRUCT *ends, size_t alloca_used)
internal_function;
static int EXT (INT opt, const CHAR *pattern, const CHAR *string,
const CHAR *string_end, int no_leading_period, int flags)
const CHAR *string_end, int no_leading_period, int flags,
size_t alloca_used)
internal_function;
static const CHAR *END (const CHAR *patternp) internal_function;
static int
internal_function
FCT (pattern, string, string_end, no_leading_period, flags, ends)
FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
const CHAR *pattern;
const CHAR *string;
const CHAR *string_end;
int no_leading_period;
int flags;
struct STRUCT *ends;
size_t alloca_used;
{
register const CHAR *p = pattern, *n = string;
register UCHAR c;
@@ -67,10 +69,8 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends)
case L('?'):
if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(')
{
int res;
res = EXT (c, p, n, string_end, no_leading_period,
flags);
int res = EXT (c, p, n, string_end, no_leading_period,
flags, alloca_used);
if (res != -1)
return res;
}
@@ -99,10 +99,8 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends)
case L('*'):
if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(')
{
int res;
res = EXT (c, p, n, string_end, no_leading_period,
flags);
int res = EXT (c, p, n, string_end, no_leading_period,
flags, alloca_used);
if (res != -1)
return res;
}
@@ -191,7 +189,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends)
for (--p; n < endp; ++n, no_leading_period = 0)
if (FCT (p, n, string_end, no_leading_period, flags2,
&end) == 0)
&end, alloca_used) == 0)
goto found;
}
else if (c == L('/') && (flags & FNM_FILE_NAME))
@@ -200,7 +198,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends)
++n;
if (n < string_end && *n == L('/')
&& (FCT (p, n + 1, string_end, flags & FNM_PERIOD, flags,
NULL) == 0))
NULL, alloca_used) == 0))
return 0;
}
else
@@ -214,7 +212,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends)
for (--p; n < endp; ++n, no_leading_period = 0)
if (FOLD ((UCHAR) *n) == c
&& (FCT (p, n, string_end, no_leading_period, flags2,
&end) == 0))
&end, alloca_used) == 0))
{
found:
if (end.pattern == NULL)
@@ -749,7 +747,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends)
_NL_COLLATE_SYMB_EXTRAMB);
/* Locate the character in the hashing
table. */
table. */
hash = elem_hash (str, c1);
idx = 0;
@@ -971,9 +969,8 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends)
case L('!'):
if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(')
{
int res;
res = EXT (c, p, n, string_end, no_leading_period, flags);
int res = EXT (c, p, n, string_end, no_leading_period, flags,
alloca_used);
if (res != -1)
return res;
}
@@ -1052,26 +1049,32 @@ END (const CHAR *pattern)
static int
internal_function
EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
int no_leading_period, int flags)
int no_leading_period, int flags, size_t alloca_used)
{
const CHAR *startp;
int level;
struct patternlist
{
struct patternlist *next;
CHAR malloced;
CHAR str[0];
} *list = NULL;
struct patternlist **lastp = &list;
size_t pattern_len = STRLEN (pattern);
int any_malloced = 0;
const CHAR *p;
const CHAR *rs;
int retval = 0;
/* Parse the pattern. Store the individual parts in the list. */
level = 0;
for (startp = p = pattern + 1; level >= 0; ++p)
if (*p == L('\0'))
/* This is an invalid pattern. */
return -1;
{
/* This is an invalid pattern. */
retval = -1;
goto out;
}
else if (*p == L('['))
{
/* Handle brackets special. */
@@ -1088,8 +1091,11 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
/* Skip over all characters of the list. */
while (*p != L(']'))
if (*p++ == L('\0'))
/* This is no valid pattern. */
return -1;
{
/* This is no valid pattern. */
retval = -1;
goto out;
}
}
else if ((*p == L('?') || *p == L('*') || *p == L('+') || *p == L('@')
|| *p == L('!')) && p[1] == L('('))
@@ -1102,15 +1108,25 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
/* This means we found the end of the pattern. */
#define NEW_PATTERN \
struct patternlist *newp; \
\
if (opt == L('?') || opt == L('@')) \
newp = alloca (sizeof (struct patternlist) \
+ (pattern_len * sizeof (CHAR))); \
size_t slen = (opt == L('?') || opt == L('@') \
? pattern_len : (p - startp + 1)); \
slen = sizeof (struct patternlist) + (slen * sizeof (CHAR)); \
int malloced = ! __libc_use_alloca (alloca_used + slen); \
if (__builtin_expect (malloced, 0)) \
{ \
newp = malloc (slen); \
if (newp == NULL) \
{ \
retval = -2; \
goto out; \
} \
any_malloced = 1; \
} \
else \
newp = alloca (sizeof (struct patternlist) \
+ ((p - startp + 1) * sizeof (CHAR))); \
*((CHAR *) MEMPCPY (newp->str, startp, p - startp)) = L('\0'); \
newp = alloca_account (slen, alloca_used); \
newp->next = NULL; \
newp->malloced = malloced; \
*((CHAR *) MEMPCPY (newp->str, startp, p - startp)) = L('\0'); \
*lastp = newp; \
lastp = &newp->next
NEW_PATTERN;
@@ -1131,8 +1147,9 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
switch (opt)
{
case L('*'):
if (FCT (p, string, string_end, no_leading_period, flags, NULL) == 0)
return 0;
if (FCT (p, string, string_end, no_leading_period, flags, NULL,
alloca_used) == 0)
goto success;
/* FALLTHROUGH */
case L('+'):
@@ -1143,7 +1160,7 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
current pattern. */
if (FCT (list->str, string, rs, no_leading_period,
flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
NULL) == 0
NULL, alloca_used) == 0
/* This was successful. Now match the rest with the rest
of the pattern. */
&& (FCT (p, rs, string_end,
@@ -1151,7 +1168,7 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
? no_leading_period
: rs[-1] == '/' && NO_LEADING_PERIOD (flags) ? 1 : 0,
flags & FNM_FILE_NAME
? flags : flags & ~FNM_PERIOD, NULL) == 0
? flags : flags & ~FNM_PERIOD, NULL, alloca_used) == 0
/* This didn't work. Try the whole pattern. */
|| (rs != string
&& FCT (pattern - 1, rs, string_end,
@@ -1160,18 +1177,21 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
: (rs[-1] == '/' && NO_LEADING_PERIOD (flags)
? 1 : 0),
flags & FNM_FILE_NAME
? flags : flags & ~FNM_PERIOD, NULL) == 0)))
? flags : flags & ~FNM_PERIOD, NULL,
alloca_used) == 0)))
/* It worked. Signal success. */
return 0;
goto success;
}
while ((list = list->next) != NULL);
/* None of the patterns lead to a match. */
return FNM_NOMATCH;
retval = FNM_NOMATCH;
break;
case L('?'):
if (FCT (p, string, string_end, no_leading_period, flags, NULL) == 0)
return 0;
if (FCT (p, string, string_end, no_leading_period, flags, NULL,
alloca_used) == 0)
goto success;
/* FALLTHROUGH */
case L('@'):
@@ -1183,13 +1203,14 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
if (FCT (STRCAT (list->str, p), string, string_end,
no_leading_period,
flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
NULL) == 0)
NULL, alloca_used) == 0)
/* It worked. Signal success. */
return 0;
goto success;
while ((list = list->next) != NULL);
/* None of the patterns lead to a match. */
return FNM_NOMATCH;
retval = FNM_NOMATCH;
break;
case L('!'):
for (rs = string; rs <= string_end; ++rs)
@@ -1199,7 +1220,7 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
for (runp = list; runp != NULL; runp = runp->next)
if (FCT (runp->str, string, rs, no_leading_period,
flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
NULL) == 0)
NULL, alloca_used) == 0)
break;
/* If none of the patterns matched see whether the rest does. */
@@ -1209,21 +1230,34 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
? no_leading_period
: rs[-1] == '/' && NO_LEADING_PERIOD (flags) ? 1 : 0,
flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
NULL) == 0))
NULL, alloca_used) == 0))
/* This is successful. */
return 0;
goto success;
}
/* None of the patterns together with the rest of the pattern
lead to a match. */
return FNM_NOMATCH;
retval = FNM_NOMATCH;
break;
default:
assert (! "Invalid extended matching operator");
retval = -1;
break;
}
return -1;
success:
out:
if (any_malloced)
while (list != NULL)
{
struct patternlist *old = list;
list = list->next;
if (old->malloced)
free (old);
}
return retval;
}
+9
View File
@@ -66,3 +66,12 @@
#scopev4 ::ffff:172.16.0.0/108 5
#scopev4 ::ffff:192.168.0.0/112 5
#scopev4 ::ffff:0.0.0.0/96 14
#
# For sites which use site-local IPv4 addresses behind NAT there is
# the problem that even if IPv4 addresses are preferred they do not
# have the same scope and are therefore not sorted first. To change
# this use only these rules:
#
#scopev4 ::ffff:169.254.0.0/112 2
#scopev4 ::ffff:127.0.0.0/104 2
#scopev4 ::ffff:0.0.0.0/96 14
+24 -16
View File
@@ -2,7 +2,8 @@
NOTE: getopt is part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to drepper@gnu.org
before changing it!
Copyright (C) 1987-1996,1998-2004,2008,2009 Free Software Foundation, Inc.
Copyright (C) 1987-1996,1998-2004,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
@@ -394,8 +395,6 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
int long_only, struct _getopt_data *d, int posixly_correct)
{
int print_errors = d->opterr;
if (optstring[0] == ':')
print_errors = 0;
if (argc < 1)
return -1;
@@ -410,6 +409,10 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
posixly_correct);
d->__initialized = 1;
}
else if (optstring[0] == '-' || optstring[0] == '+')
optstring++;
if (optstring[0] == ':')
print_errors = 0;
/* Test whether ARGV[optind] points to a non-option argument.
Either it does not have option syntax, or there is an environment flag
@@ -679,8 +682,8 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
char *buf;
if (__asprintf (&buf, _("\
%s: option '%s' requires an argument\n"),
argv[0], argv[d->optind - 1]) >= 0)
%s: option '--%s' requires an argument\n"),
argv[0], pfound->name) >= 0)
{
_IO_flockfile (stderr);
@@ -697,8 +700,8 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
}
#else
fprintf (stderr,
_("%s: option '%s' requires an argument\n"),
argv[0], argv[d->optind - 1]);
_("%s: option '--%s' requires an argument\n"),
argv[0], pfound->name);
#endif
}
d->__nextchar += strlen (d->__nextchar);
@@ -788,7 +791,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
if (*d->__nextchar == '\0')
++d->optind;
if (temp == NULL || c == ':')
if (temp == NULL || c == ':' || c == ';')
{
if (print_errors)
{
@@ -910,7 +913,10 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
pfound = p;
indfound = option_index;
}
else
else if (long_only
|| pfound->has_arg != p->has_arg
|| pfound->flag != p->flag
|| pfound->val != p->val)
/* Second or later nonexact match found. */
ambig = 1;
}
@@ -922,7 +928,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
char *buf;
if (__asprintf (&buf, _("%s: option '-W %s' is ambiguous\n"),
argv[0], argv[d->optind]) >= 0)
argv[0], d->optarg) >= 0)
{
_IO_flockfile (stderr);
@@ -938,7 +944,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
}
#else
fprintf (stderr, _("%s: option '-W %s' is ambiguous\n"),
argv[0], argv[d->optind]);
argv[0], d->optarg);
#endif
}
d->__nextchar += strlen (d->__nextchar);
@@ -1001,8 +1007,8 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
char *buf;
if (__asprintf (&buf, _("\
%s: option '%s' requires an argument\n"),
argv[0], argv[d->optind - 1]) >= 0)
%s: option '-W %s' requires an argument\n"),
argv[0], pfound->name) >= 0)
{
_IO_flockfile (stderr);
@@ -1018,15 +1024,17 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
free (buf);
}
#else
fprintf (stderr,
_("%s: option '%s' requires an argument\n"),
argv[0], argv[d->optind - 1]);
fprintf (stderr, _("\
%s: option '-W %s' requires an argument\n"),
argv[0], pfound->name);
#endif
}
d->__nextchar += strlen (d->__nextchar);
return optstring[0] == ':' ? ':' : '?';
}
}
else
d->optarg = NULL;
d->__nextchar += strlen (d->__nextchar);
if (longind != NULL)
*longind = option_index;
+4 -4
View File
@@ -1,5 +1,5 @@
/* Declarations for getopt.
Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2009
Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2009,2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -158,9 +158,9 @@ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
additional functionality can be disable at runtime. This redirection
helps to also do this at runtime. */
# ifdef __REDIRECT
extern int __REDIRECT (getopt, (int ___argc, char *const *___argv,
const char *__shortopts),
__posix_getopt) __THROW;
extern int __REDIRECT_NTH (getopt, (int ___argc, char *const *___argv,
const char *__shortopts),
__posix_getopt);
# else
extern int __posix_getopt (int ___argc, char *const *___argv,
const char *__shortopts) __THROW;
+73 -58
View File
@@ -1,6 +1,5 @@
/* Extended regular expression matching and search library.
Copyright (C) 2002,2003,2004,2005,2006,2007,2009
Free Software Foundation, Inc.
Copyright (C) 2002-2007,2009,2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -377,7 +376,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
applies to multibyte character sets; for single byte character
sets, the SIMPLE_BRACKET again suffices. */
if (dfa->mb_cur_max > 1
&& (cset->nchar_classes || cset->non_match
&& (cset->nchar_classes || cset->non_match || cset->nranges
# ifdef _LIBC
|| cset->nequiv_classes
# endif /* _LIBC */
@@ -616,7 +615,7 @@ free_dfa_content (re_dfa_t *dfa)
re_dfastate_t *state = entry->array[j];
free_state (state);
}
re_free (entry->array);
re_free (entry->array);
}
re_free (dfa->state_table);
#ifdef RE_ENABLE_I18N
@@ -1066,8 +1065,8 @@ optimize_utf8 (re_dfa_t *dfa)
}
break;
case OP_PERIOD:
has_period = 1;
break;
has_period = 1;
break;
case OP_BACK_REF:
case OP_ALT:
case END_OF_RE:
@@ -1080,7 +1079,7 @@ optimize_utf8 (re_dfa_t *dfa)
case SIMPLE_BRACKET:
/* Just double check. The non-ASCII range starts at 0x80. */
assert (0x80 % BITSET_WORD_BITS == 0);
for (i = 0x80 / BITSET_WORD_BITS; i < BITSET_WORDS; ++i)
for (i = 0x80 / BITSET_WORD_BITS; i < BITSET_WORDS; ++i)
if (dfa->nodes[node].opr.sbcset[i])
return;
break;
@@ -1161,7 +1160,7 @@ analyze (regex_t *preg)
{
dfa->inveclosures = re_malloc (re_node_set, dfa->nodes_len);
if (BE (dfa->inveclosures == NULL, 0))
return REG_ESPACE;
return REG_ESPACE;
ret = calc_inveclosure (dfa);
}
@@ -1183,16 +1182,16 @@ postorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)),
if that's the only child). */
while (node->left || node->right)
if (node->left)
node = node->left;
else
node = node->right;
node = node->left;
else
node = node->right;
do
{
reg_errcode_t err = fn (extra, node);
if (BE (err != REG_NOERROR, 0))
return err;
if (node->parent == NULL)
if (node->parent == NULL)
return REG_NOERROR;
prev = node;
node = node->parent;
@@ -1226,7 +1225,7 @@ preorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)),
prev = node;
node = node->parent;
if (!node)
return REG_NOERROR;
return REG_NOERROR;
}
node = node->right;
}
@@ -1249,13 +1248,13 @@ optimize_subexps (void *extra, bin_tree_t *node)
}
else if (node->token.type == SUBEXP
&& node->left && node->left->token.type == SUBEXP)
&& node->left && node->left->token.type == SUBEXP)
{
int other_idx = node->left->token.opr.idx;
node->left = node->left->left;
if (node->left)
node->left->parent = node;
node->left->parent = node;
dfa->subexp_map[other_idx] = dfa->subexp_map[node->token.opr.idx];
if (other_idx < BITSET_WORD_BITS)
@@ -1340,9 +1339,9 @@ calc_first (void *extra, bin_tree_t *node)
node->first = node;
node->node_idx = re_dfa_add_node (dfa, node->token);
if (BE (node->node_idx == -1, 0))
return REG_ESPACE;
return REG_ESPACE;
if (node->token.type == ANCHOR)
dfa->nodes[node->node_idx].constraint = node->token.opr.ctx_type;
dfa->nodes[node->node_idx].constraint = node->token.opr.ctx_type;
}
return REG_NOERROR;
}
@@ -1364,7 +1363,7 @@ calc_next (void *extra, bin_tree_t *node)
if (node->left)
node->left->next = node->next;
if (node->right)
node->right->next = node->next;
node->right->next = node->next;
break;
}
return REG_NOERROR;
@@ -1643,9 +1642,10 @@ static reg_errcode_t
calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, int node, int root)
{
reg_errcode_t err;
int i, incomplete;
int i;
re_node_set eclosure;
incomplete = 0;
int ret;
int incomplete = 0;
err = re_node_set_alloc (&eclosure, dfa->edests[node].nelem + 1);
if (BE (err != REG_NOERROR, 0))
return err;
@@ -1700,8 +1700,10 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, int node, int root)
}
}
/* Epsilon closures include itself. */
re_node_set_insert (&eclosure, node);
/* An epsilon closure includes itself. */
ret = re_node_set_insert (&eclosure, node);
if (BE (ret < 0, 0))
return REG_ESPACE;
if (incomplete && !root)
dfa->eclosures[node].nelem = 0;
else
@@ -2152,16 +2154,21 @@ parse_branch (re_string_t *regexp, regex_t *preg, re_token_t *token,
exp = parse_expression (regexp, preg, token, syntax, nest, err);
if (BE (*err != REG_NOERROR && exp == NULL, 0))
{
if (tree != NULL)
postorder (tree, free_tree, NULL);
return NULL;
}
if (tree != NULL && exp != NULL)
{
tree = create_tree (dfa, tree, exp, CONCAT);
if (tree == NULL)
bin_tree_t *newtree = create_tree (dfa, tree, exp, CONCAT);
if (newtree == NULL)
{
postorder (exp, free_tree, NULL);
postorder (tree, free_tree, NULL);
*err = REG_ESPACE;
return NULL;
}
tree = newtree;
}
else if (tree == NULL)
tree = exp;
@@ -2285,7 +2292,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
&& dfa->word_ops_used == 0)
init_word_char (dfa);
if (token->opr.ctx_type == WORD_DELIM
|| token->opr.ctx_type == NOT_WORD_DELIM)
|| token->opr.ctx_type == NOT_WORD_DELIM)
{
bin_tree_t *tree_first, *tree_last;
if (token->opr.ctx_type == WORD_DELIM)
@@ -2293,13 +2300,13 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
token->opr.ctx_type = WORD_FIRST;
tree_first = create_token_tree (dfa, NULL, NULL, token);
token->opr.ctx_type = WORD_LAST;
}
else
{
}
else
{
token->opr.ctx_type = INSIDE_WORD;
tree_first = create_token_tree (dfa, NULL, NULL, token);
token->opr.ctx_type = INSIDE_NOTWORD;
}
}
tree_last = create_token_tree (dfa, NULL, NULL, token);
tree = create_tree (dfa, tree_first, tree_last, OP_ALT);
if (BE (tree_first == NULL || tree_last == NULL || tree == NULL, 0))
@@ -2410,7 +2417,11 @@ parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
{
tree = parse_reg_exp (regexp, preg, token, syntax, nest, err);
if (BE (*err == REG_NOERROR && token->type != OP_CLOSE_SUBEXP, 0))
*err = REG_EPAREN;
{
if (tree != NULL)
postorder (tree, free_tree, NULL);
*err = REG_EPAREN;
}
if (BE (*err != REG_NOERROR, 0))
return NULL;
}
@@ -2541,11 +2552,11 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
elem = duplicate_tree (elem, dfa);
tree = create_tree (dfa, tree, elem, CONCAT);
if (BE (elem == NULL || tree == NULL, 0))
goto parse_dup_op_espace;
goto parse_dup_op_espace;
tree = create_tree (dfa, tree, NULL, OP_ALT);
if (BE (tree == NULL, 0))
goto parse_dup_op_espace;
goto parse_dup_op_espace;
}
if (old_tree)
@@ -2626,9 +2637,9 @@ build_range_exp (bitset_t sbcset, bracket_elem_t *start_elem,
no MBCSET if dfa->mb_cur_max == 1. */
if (mbcset)
{
/* Check the space of the arrays. */
if (BE (*range_alloc == mbcset->nranges, 0))
{
/* Check the space of the arrays. */
if (BE (*range_alloc == mbcset->nranges, 0))
{
/* There is not enough space, need realloc. */
wchar_t *new_array_start, *new_array_end;
int new_nranges;
@@ -2638,9 +2649,9 @@ build_range_exp (bitset_t sbcset, bracket_elem_t *start_elem,
/* Use realloc since mbcset->range_starts and mbcset->range_ends
are NULL if *range_alloc == 0. */
new_array_start = re_realloc (mbcset->range_starts, wchar_t,
new_nranges);
new_nranges);
new_array_end = re_realloc (mbcset->range_ends, wchar_t,
new_nranges);
new_nranges);
if (BE (new_array_start == NULL || new_array_end == NULL, 0))
return REG_ESPACE;
@@ -2648,10 +2659,10 @@ build_range_exp (bitset_t sbcset, bracket_elem_t *start_elem,
mbcset->range_starts = new_array_start;
mbcset->range_ends = new_array_end;
*range_alloc = new_nranges;
}
}
mbcset->range_starts[mbcset->nranges] = start_wc;
mbcset->range_ends[mbcset->nranges++] = end_wc;
mbcset->range_starts[mbcset->nranges] = start_wc;
mbcset->range_ends[mbcset->nranges++] = end_wc;
}
/* Build the table for single byte characters. */
@@ -2870,8 +2881,8 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
build below suffices. */
if (nrules > 0 || dfa->mb_cur_max > 1)
{
/* Check the space of the arrays. */
if (BE (*range_alloc == mbcset->nranges, 0))
/* Check the space of the arrays. */
if (BE (*range_alloc == mbcset->nranges, 0))
{
/* There is not enough space, need realloc. */
uint32_t *new_array_start;
@@ -2883,18 +2894,18 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
new_array_start = re_realloc (mbcset->range_starts, uint32_t,
new_nranges);
new_array_end = re_realloc (mbcset->range_ends, uint32_t,
new_nranges);
new_nranges);
if (BE (new_array_start == NULL || new_array_end == NULL, 0))
return REG_ESPACE;
return REG_ESPACE;
mbcset->range_starts = new_array_start;
mbcset->range_ends = new_array_end;
*range_alloc = new_nranges;
}
mbcset->range_starts[mbcset->nranges] = start_collseq;
mbcset->range_ends[mbcset->nranges++] = end_collseq;
mbcset->range_starts[mbcset->nranges] = start_collseq;
mbcset->range_ends[mbcset->nranges++] = end_collseq;
}
/* Build the table for single byte characters. */
@@ -3020,6 +3031,10 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
if (BE (sbcset == NULL, 0))
#endif /* RE_ENABLE_I18N */
{
re_free (sbcset);
#ifdef RE_ENABLE_I18N
re_free (mbcset);
#endif
*err = REG_ESPACE;
return NULL;
}
@@ -3227,17 +3242,17 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
of having both SIMPLE_BRACKET and COMPLEX_BRACKET. */
if (sbc_idx < BITSET_WORDS)
{
/* Build a tree for simple bracket. */
br_token.type = SIMPLE_BRACKET;
br_token.opr.sbcset = sbcset;
work_tree = create_token_tree (dfa, NULL, NULL, &br_token);
if (BE (work_tree == NULL, 0))
goto parse_bracket_exp_espace;
/* Build a tree for simple bracket. */
br_token.type = SIMPLE_BRACKET;
br_token.opr.sbcset = sbcset;
work_tree = create_token_tree (dfa, NULL, NULL, &br_token);
if (BE (work_tree == NULL, 0))
goto parse_bracket_exp_espace;
/* Then join them by ALT node. */
work_tree = create_tree (dfa, work_tree, mbc_tree, OP_ALT);
if (BE (work_tree == NULL, 0))
goto parse_bracket_exp_espace;
/* Then join them by ALT node. */
work_tree = create_tree (dfa, work_tree, mbc_tree, OP_ALT);
if (BE (work_tree == NULL, 0))
goto parse_bracket_exp_espace;
}
else
{
@@ -3256,7 +3271,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
br_token.opr.sbcset = sbcset;
work_tree = create_token_tree (dfa, NULL, NULL, &br_token);
if (BE (work_tree == NULL, 0))
goto parse_bracket_exp_espace;
goto parse_bracket_exp_espace;
}
return work_tree;
@@ -3809,7 +3824,7 @@ duplicate_tree (const bin_tree_t *root, re_dfa_t *dfa)
node = node->parent;
dup_node = dup_node->parent;
if (!node)
return dup_root;
return dup_root;
}
node = node->right;
p_new = &dup_node->right;
+13 -3
View File
@@ -133,7 +133,14 @@ re_string_realloc_buffers (re_string_t *pstr, int new_buf_len)
#ifdef RE_ENABLE_I18N
if (pstr->mb_cur_max > 1)
{
wint_t *new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len);
wint_t *new_wcs;
/* Avoid overflow in realloc. */
const size_t max_object_size = MAX (sizeof (wint_t), sizeof (int));
if (BE (SIZE_MAX / max_object_size < new_buf_len, 0))
return REG_ESPACE;
new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len);
if (BE (new_wcs == NULL, 0))
return REG_ESPACE;
pstr->wcs = new_wcs;
@@ -1404,8 +1411,11 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
re_node_set *new_edests, *new_eclosures;
re_token_t *new_nodes;
/* Avoid overflows. */
if (BE (new_nodes_alloc < dfa->nodes_alloc, 0))
/* Avoid overflows in realloc. */
const size_t max_object_size = MAX (sizeof (re_token_t),
MAX (sizeof (re_node_set),
sizeof (int)));
if (BE (SIZE_MAX / max_object_size < new_nodes_alloc, 0))
return -1;
new_nodes = re_realloc (dfa->nodes, re_token_t, new_nodes_alloc);
+1 -1
View File
@@ -3998,7 +3998,7 @@ find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
/* Skip the collation sequence value. */
idx += sizeof (uint32_t);
/* Skip the wide char sequence of the collating element. */
idx = idx + sizeof (uint32_t) * (extra[idx] + 1);
idx = idx + sizeof (uint32_t) * (*(int32_t *) (extra + idx) + 1);
/* If we found the entry, return the sequence value. */
if (found)
return *(uint32_t *) (extra + idx);
+4 -1
View File
@@ -1,5 +1,5 @@
/* Tests for fnmatch function.
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 2000, 2001, 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
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <mcheck.h>
static char *next_input (char **line, int first, int last);
@@ -46,6 +47,8 @@ main (void)
size_t escpatternlen = 0;
int nr = 0;
mtrace ();
/* Read lines from stdin with the following format:
locale input-string match-string flags result

Some files were not shown because too many files have changed in this diff Show More