Compare commits

...
Author SHA1 Message Date
Ulrich Drepper df79688ef6 Restore _res correctly
getaddrinfo works around the resolver functionality to avoid automatic
IPv6 lookups.  The restoring didn't allow for the resolver to set
additional bits in _res.

(cherry picked from commit 7ae22829af)
2011-09-03 20:31:09 +02:00
Ulrich Drepper 07c65bd7b3 Fix unnecessary overallocation due to incomplete character
When incomplete characters are found at the end of a string the
code ran amok and allocated lots of memory.  Stricter limits
are now in place.

(cherry picked from commit 8887a920a4)
2011-09-03 20:27:05 +02:00
Petr Baudis 36edecaa99 Revert "Fix file descriptor position after fclose"
This reverts commit 82c938203a.
2011-09-03 19:53:53 +02:00
Petr Baudis cf65c66723 Revert "Initialize variable in _IO_new_file_close_it"
This reverts commit 875703d095.

Conflicts:

	ChangeLog
2011-09-03 19:53:42 +02:00
Roland McGrath 81313e32ef Revert "Fix memory leak in dlopen with RTLD_NOLOAD."
This reverts commit 522cb50e61.

Conflicts:

	ChangeLog
2011-08-31 15:48:43 -07:00
Roland McGrath 448f6a4dfb Revert "Install bits/timex.h header."
This reverts commit c81fb726d8.

Conflicts:

	ChangeLog
2011-08-31 13:13:24 -07:00
H.J. Lu 78856c5c73 Fix typo in x86-64 powl
(cherry picked from commit 8db736347c)
2011-05-27 15:08:23 +02:00
Ulrich Drepper 50cb4b00a2 Fix test for error_one_per_line mode in error
(cherry picked from commit 15cc7dd182)
2011-05-27 01:39:26 +02:00
Ulrich Drepper 54717475a5 Remove shortcut for call of chown
The UID might differ, too.  Just call chown unconditionally.

(cherry picked from commit f3799213a3)
2011-05-27 01:38:30 +02:00
Ulrich Drepper 7d76befe53 Fix initialization of optimization values for AIO
(cherry picked from commit 2fc54d6f9f)
2011-05-27 01:33:47 +02:00
Ulrich Drepper 875703d095 Initialize variable in _IO_new_file_close_it
The last change left a variable in some situations uninitialized.

(cherry picked from commit ca408c157c)
2011-05-27 01:32:18 +02:00
Ulrich Drepper 88a97c6e4c Fix handling of incomplete character storage in state
If iconv is called more than once in a row for adding bytes to the sequence
while still remain under the minimum size of a character and if STORE_REST
is defined, we didn't consume any input.  Fix that.

(cherry picked from commit 1af4e29837)
2011-05-27 01:29:07 +02:00
Ulrich Drepper 82c938203a Fix file descriptor position after fclose
fclose should leave the file descriptor position after the last read
or written byte.

(cherry picked from commit fcabc0f8b1)
2011-05-27 01:28:47 +02:00
Piotr Bury b77931ad9f Fix resizing able for unique symbols when adding symbol for copy relocation
(cherry picked from commit 320a5dc07b)
2011-05-27 01:27:55 +02:00
Ulrich Drepper 9bb6bfdf65 Fix sched_setscheduler call in spawn implementation
(cherry picked from commit f574184a0e)
2011-05-27 01:25:07 +02:00
Ulrich Drepper 18852b24dc Report write error in addmnt even for cached streams.
(cherry picked from commit e1fb097f44)
2011-05-27 01:24:24 +02:00
Ulrich Drepper 564bc26b79 Translate kernel error into what pthread_create should return
(cherry picked from commit 5bdcc10322)
2011-05-27 01:24:05 +02:00
Ulrich Drepper d95270c5b5 Fix up testing for valid $ORIGIN use
(cherry picked from commit 22836f52e3)
2011-05-27 01:23:22 +02:00
Ulrich Drepper 2363f73c9f Backport BIND code to query name as TLD.
(cherry picked from commit f87dfb1f11)
2011-05-27 01:21:23 +02:00
Ulrich Drepper 2d028cbedb Allow $ORIGIN to reference trusted directoreis in SUID binaries.
(cherry picked from commit 47c3cd7a74)
2011-05-27 01:20:13 +02:00
Andreas Schwab 426cfd7371 ldconfig: don't crash on empty path in config file
(cherry picked from commit 00ee369c1c)
2011-05-27 00:49:23 +02:00
Bruno Haible 7b1d92c643 Fix getnameinfo flags parameter type.
(cherry picked from commit e4ecafe004)
2011-05-27 00:39:36 +02:00
Eric Blake 1b31d30e82 Use al possible bytes from fopen mode string.
(cherry picked from commit b722481ac2)
2011-05-27 00:38:46 +02:00
Ulrich Drepper 8277fdc1cd Fix FPU context handling in getcontext on x86-64.
fnstenv on x86-64 seems to clear the state.  Work around.

(cherry picked from commit 75ea32abcd)
2011-05-27 00:34:37 +02:00
Ulrich Drepper fea332e164 Fix memory leak in TLS of loaded objects.
(cherry picked from commit e6c6149412)
2011-05-27 00:34:07 +02:00
Andreas Schwab 4e43f00fc3 Don't leave empty element in rpath when skipping an element
(cherry picked from commit 34fe483e12)
2011-05-27 00:29:24 +02:00
Andreas Schwab 7d789b1b4d Maintain stack alignment in ____longjmp_chk on x86_64
(cherry picked from commit e451d22b22)
2011-05-27 00:29:09 +02:00
Andreas Schwab c81fb726d8 Install bits/timex.h header.
(cherry picked from commit 6e63d5e1ae)
2011-05-27 00:21:11 +02:00
Ulrich Drepper fa9f66a6f0 Check size of pattern in wide character representation in fnmatch.
(cherry picked from commit 8126d90480)
2011-05-27 00:19:52 +02:00
Ryan S. Arnold efdc6bb89a PowerPC: Fix POWER6 s_isnanf.S: END(__isnan) to END(__isnanf)
(cherry picked from commit ccfe366e6f)
2011-05-27 00:19:12 +02:00
Jakub Jelinek 6a29825d63 Remove __restrict quals from wmemcmp prototype.
(cherry picked from commit c6e13027ab)
2011-05-27 00:18:49 +02:00
Ulrich Drepper 411a9d6b1d Fix copy relocations handling of unique objects.
(cherry picked from commit 028478fa40)
2011-05-27 00:18:18 +02:00
Ulrich Drepper 957a75e60b Fix loading first object along a path when tracing.
(cherry picked from commit 6a5ee1029b)
2011-05-27 00:12:23 +02:00
Andreas Schwab a02af4f1ae Don't read past end of buffer in fmemopen
(cherry picked from commit 9d25c392ba)
2011-05-27 00:10:58 +02:00
Andreas Schwab 522cb50e61 Fix memory leak in dlopen with RTLD_NOLOAD.
(cherry picked from commit 4bff6e0175)
2011-05-27 00:09:26 +02:00
Andreas Schwab ad78094bcb Don't crash when dependencies are missing
(cherry picked from commit f2092faf2b)
2011-05-27 00:04:08 +02:00
Samuel Thibault 21eddf8cff Fix __if_freereq crash: Unlike the generic version which uses free, Hurd needs munmap.
(cherry picked from commit 6c8a2e88d1)
2011-05-27 00:03:39 +02:00
Petr Baudis a4fd88c0fc Fix allocation when handling positional parameters in printf.
(cherry picked from commit 84a4211850)
2011-05-27 00:02:15 +02:00
Ryan S. Arnold c55cc45ed7 Fix INTERNAL_[V]SYSCALL_NCS macros to not cast return val to int.
(cherry picked from commit d55fd7a557)
2011-05-26 23:58:27 +02:00
Ryan S. Arnold 758c66a234 Disable VSX usage in rtld.c to prevent TOC ref before relocs are resolved.
(cherry picked from commit 2206397e1c)
2011-05-26 23:57:08 +02:00
Jakub Jelinek 44092c71f6 Fix two printf handler issues.
(cherry picked from commit c1d0e639a9)
2011-05-26 23:55:54 +02:00
Ulrich Drepper b72646ad0c Fix passing symbol value to pltexit callbacks when ld.so auditing.
(cherry picked from commit 8517b15ee8)
2011-02-04 00:35:03 +01:00
Andreas Schwab b472343aa6 Fix range error handling in sgetspent.
(cherry picked from commit 10a656fe33)
2011-02-04 00:02:35 +01:00
Ulrich Drepper 997c2a72c1 Fix decoding of canonical name in getaddrinfo.
(cherry picked from commit 86e9235918)
2011-02-03 23:16:59 +01:00
Ulrich Drepper 77314ef9bd Define AT_NO_AUTOMOUNT.
(cherry picked from commit 620a05296f)
2011-02-03 23:15:53 +01:00
Ulrich Drepper 6c1ac1d121 Define MADV_NOHUGEPAGE.
(cherry picked from commit 18ba70a559)
2011-02-03 23:14:23 +01:00
Ulrich Drepper a525e03185 Define MADV_HUGEPAGE.
(cherry picked from commit 32465c3ea0)
2011-02-03 23:13:16 +01:00
Ulrich Drepper 7928c812d3 Add definitions for new socket protocols.
(cherry picked from commit a77e8cbc39)
2011-02-03 21:21:57 +01:00
Ulrich Drepper 24b5b849fd Signal temporary host lookup errors in nscd as such to the requester.
(cherry picked from commit bc425b339b)
2011-02-03 21:20:55 +01:00
Ulrich Drepper 28ef97b099 Fix PLT use due to __libc_alloca_cutoff.
(cherry picked from commit a85b5cb4d4)
2011-02-03 21:13:40 +01:00
Ulrich Drepper 83e15ff7c2 Fix handling of missing syscall in Linux mkdirat.
(cherry picked from commit 1086d70d91)
2011-02-03 20:59:00 +01:00
Ulrich Drepper f369c365c2 Handle long lines in host lookups in the right place.
(cherry picked from commit 451f001b50)
2011-02-03 20:54:43 +01:00
Ulrich Drepper 7344c4a5cb Fix assertion when handling DSTs during auditing.
(cherry picked from commit 0876917582)
2011-02-03 20:48:14 +01:00
Andreas Schwab 47968f8ba8 Don't underestimate length of DST substitution
(cherry picked from commit 4c35fb65c9)
2011-02-03 20:47:43 +01:00
Ulrich Drepper bbfacbc5ea Fix alignment in x86 destructor calls.
(cherry picked from commit 5e49c52efd)
2011-02-03 20:05:26 +01:00
Ulrich Drepper 2d0273a47b Fix grouping when rounding increases number of integer digits.
(cherry picked from commit f57e41a5b8)
2011-02-03 20:03:38 +01:00
David S. Miller 0b62ea76db sparc64: Use i386 implementation for fxstat.
This was simply missed when Jakub converted all of the
other sparc64 xstat cases.

(cherry picked from commit 16c2895fea)
2011-02-03 17:26:32 +01:00
Jim Meyering 73c7d57959 Fix infloop on persistent failing calloc in regex.
(cherry picked from commit 2543fef229)
2011-02-03 17:25:46 +01:00
Ulrich Drepper 72215c6000 Use fastbin macro everywhere.
(cherry picked from commit 9798346413)
2011-02-03 17:05:39 +01:00
Ulrich Drepper d0a9695460 Fix ChangeLogs.
(cherry picked from commit 14b697f75a)
2011-02-03 16:56:33 +01:00
Ulrich Drepper 17a0fde057 More accurate computatin of reclen in readdir_r.
Alignment issue can increase the reclen limit.
Make sure Linux 64-bit readdir_r also accounts for 64-bit alignment
in getdents.

(cherry picked from commit db753e2cfb)
2011-02-03 16:55:57 +01:00
Andreas Schwab 9a1af187c1 Fix use of restrict in wchar.h
(cherry picked from commit 4f1972374a)
2011-02-03 16:54:47 +01:00
Ulrich Drepper 216e05cac9 Fix typo in comment.
(cherry picked from commit eaea92f137)
2011-02-03 16:39:19 +01:00
Ulrich Drepper b6995df513 Fix race in qsort_r initialization.
(cherry picked from commit fb88ac72c2)
2011-02-03 16:38:57 +01:00
Jakub Jelinek 2796cd94a8 Fix -D_FORTIFY_SOURCE memmove and bcop
(cherry picked from commit 42acbb92c8)
2011-02-03 16:30:19 +01:00
Ulrich Drepper 837d8a0fab Relax libm tests for x86-32.
(cherry picked from commit 1e24cf6e6e)
2011-02-03 16:30:15 +01:00
Andreas Schwab 961327556d Don't ignore zero TTL in DNS answers
(cherry picked from commit a769081960)
2011-02-03 16:30:07 +01:00
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
236 changed files with 4038 additions and 1199 deletions
+1
View File
@@ -1 +1,2 @@
timezone/* -whitespace
INSTALL -whitespace
+1100
View File
File diff suppressed because it is too large Load Diff
+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,
+1 -1
View File
@@ -87,7 +87,7 @@ function int getaddrinfo (const char*, const char*, const struct addrinfo*, stru
function {struct hostent*} gethostbyaddr (const void*, socklen_t, int)
function {struct hostent*} gethostbyname (const char*)
function {struct hostent*} gethostent (void)
function int getnameinfo (const struct sockaddr*, socklen_t, char*, socklen_t, char*, socklen_t, unsigned)
function int getnameinfo (const struct sockaddr*, socklen_t, char*, socklen_t, char*, socklen_t, int)
function {struct netent*} getnetbyaddr (uint32_t, int)
function {struct netent*} getnetbyname (const char*)
function {struct netent*} getnetent (void)
+43 -41
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;
+5 -5
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,
@@ -491,6 +491,10 @@ _dl_map_object_deps (struct link_map *map,
if (errno == 0 && errno_saved != 0)
__set_errno (errno_saved);
if (errno_reason)
_dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
NULL, errstring);
struct link_map **old_l_initfini = NULL;
if (map->l_initfini != NULL && map->l_type == lt_loaded)
{
@@ -666,8 +670,4 @@ Filters not supported with LD_TRACE_PRELINKING"));
}
if (old_l_initfini != NULL)
_dl_scope_free (old_l_initfini);
if (errno_reason)
_dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
NULL, errstring);
}
+22 -12
View File
@@ -1,6 +1,5 @@
/* Handling of dynamic sring tokens.
Copyright (C) 1999,2001,2002,2003,2004,2006,2007
Free Software Foundation, Inc.
Copyright (C) 1999,2001-2004,2006,2007,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +17,8 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include "trusted-dirs.h"
/* Determine the number of DST elements in the name. Only if IS_PATH is
nonzero paths are recognized (i.e., multiple, ':' separated filenames). */
#define DL_DST_COUNT(name, is_path) \
@@ -31,6 +32,11 @@
__cnt; })
#ifdef SHARED
# define IS_RTLD(l) (l) == &GL(dl_rtld_map)
#else
# define IS_RTLD(l) 0
#endif
/* Guess from the number of DSTs the length of the result string. */
#define DL_DST_REQUIRED(l, name, len, cnt) \
({ \
@@ -39,28 +45,32 @@
\
if (__cnt > 0) \
{ \
size_t origin_len; \
size_t dst_len; \
/* Now we make a guess how many extra characters on top of the \
length of S we need to represent the result. We know that \
we have CNT replacements. Each at most can use \
MAX (strlen (ORIGIN), strlen (_dl_platform)) \
minus 7 (which is the length of "$ORIGIN"). \
MAX (MAX (strlen (ORIGIN), strlen (_dl_platform)), \
strlen (DL_DST_LIB)) \
minus 4 (which is the length of "$LIB"). \
\
First get the origin string if it is not available yet. \
This can only happen for the map of the executable. */ \
This can only happen for the map of the executable or, when \
auditing, in ld.so. */ \
DL_DST_REQ_STATIC (l) \
if ((l)->l_origin == NULL) \
{ \
assert ((l)->l_name[0] == '\0'); \
assert ((l)->l_name[0] == '\0' || IS_RTLD (l)); \
(l)->l_origin = _dl_get_origin (); \
origin_len = ((l)->l_origin && (l)->l_origin != (char *) -1 \
dst_len = ((l)->l_origin && (l)->l_origin != (char *) -1 \
? strlen ((l)->l_origin) : 0); \
} \
else \
origin_len = (l)->l_origin == (char *) -1 \
dst_len = (l)->l_origin == (char *) -1 \
? 0 : strlen ((l)->l_origin); \
\
__len += __cnt * (MAX (origin_len, GLRO(dl_platformlen)) - 7); \
dst_len = MAX (MAX (dst_len, GLRO(dl_platformlen)), \
strlen (DL_DST_LIB)); \
if (dst_len > 4) \
__len += __cnt * (dst_len - 4); \
} \
\
__len; })
@@ -72,7 +82,7 @@
if ((l) == NULL) \
{ \
const char *origin = _dl_get_origin (); \
origin_len = (origin && origin != (char *) -1 ? strlen (origin) : 0); \
dst_len = (origin && origin != (char *) -1 ? strlen (origin) : 0); \
} \
else
#endif
+152 -61
View File
@@ -1,5 +1,5 @@
/* Map in a shared object's segments from the file.
Copyright (C) 1995-2005, 2006, 2007, 2009 Free Software Foundation, Inc.
Copyright (C) 1995-2007, 2009, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -168,6 +168,87 @@ local_strdup (const char *s)
}
static bool
is_trusted_path (const char *path, size_t len)
{
const char *trun = system_dirs;
for (size_t idx = 0; idx < nsystem_dirs_len; ++idx)
{
if (len == system_dirs_len[idx] && memcmp (trun, path, len) == 0)
/* Found it. */
return true;
trun += system_dirs_len[idx] + 1;
}
return false;
}
static bool
is_trusted_path_normalize (const char *path, size_t len)
{
if (len == 0)
return false;
if (*path == ':')
{
++path;
--len;
}
char *npath = (char *) alloca (len + 2);
char *wnp = npath;
while (*path != '\0')
{
if (path[0] == '/')
{
if (path[1] == '.')
{
if (path[2] == '.' && (path[3] == '/' || path[3] == '\0'))
{
while (wnp > npath && *--wnp != '/')
;
path += 3;
continue;
}
else if (path[2] == '/' || path[2] == '\0')
{
path += 2;
continue;
}
}
if (wnp > npath && wnp[-1] == '/')
{
++path;
continue;
}
}
*wnp++ = *path++;
}
if (wnp == npath || wnp[-1] != '/')
*wnp++ = '/';
const char *trun = system_dirs;
for (size_t idx = 0; idx < nsystem_dirs_len; ++idx)
{
if (wnp - npath >= system_dirs_len[idx]
&& memcmp (trun, npath, system_dirs_len[idx]) == 0)
/* Found it. */
return true;
trun += system_dirs_len[idx] + 1;
}
return false;
}
static size_t
is_dst (const char *start, const char *name, const char *str,
int is_path, int secure)
@@ -200,7 +281,8 @@ is_dst (const char *start, const char *name, const char *str,
return 0;
if (__builtin_expect (secure, 0)
&& ((name[len] != '\0' && (!is_path || name[len] != ':'))
&& ((name[len] != '\0' && name[len] != '/'
&& (!is_path || name[len] != ':'))
|| (name != start + 1 && (!is_path || name[-2] != ':'))))
return 0;
@@ -240,13 +322,14 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
int is_path)
{
const char *const start = name;
char *last_elem, *wp;
/* Now fill the result path. While copying over the string we keep
track of the start of the last path element. When we come accross
a DST we copy over the value or (if the value is not available)
leave the entire path element out. */
last_elem = wp = result;
char *wp = result;
char *last_elem = result;
bool check_for_trusted = false;
do
{
@@ -265,6 +348,9 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
else
#endif
repl = l->l_origin;
check_for_trusted = (INTUSE(__libc_enable_secure)
&& l->l_type == lt_executable);
}
else if ((len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0)
repl = GLRO(dl_platform);
@@ -284,6 +370,10 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
name += len;
while (*name != '\0' && (!is_path || *name != ':'))
++name;
/* Also skip following colon if this is the first rpath
element, but keep an empty element at the end. */
if (wp == result && is_path && *name == ':' && name[1] != '\0')
++name;
}
else
/* No DST we recognize. */
@@ -293,11 +383,28 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
{
*wp++ = *name++;
if (is_path && *name == ':')
last_elem = wp;
{
/* In SUID/SGID programs, after $ORIGIN expansion the
normalized path must be rooted in one of the trusted
directories. */
if (__builtin_expect (check_for_trusted, false)
&& !is_trusted_path_normalize (last_elem, wp - last_elem))
wp = last_elem;
else
last_elem = wp;
check_for_trusted = false;
}
}
}
while (*name != '\0');
/* In SUID/SGID programs, after $ORIGIN expansion the normalized
path must be rooted in one of the trusted directories. */
if (__builtin_expect (check_for_trusted, false)
&& !is_trusted_path_normalize (last_elem, wp - last_elem))
wp = last_elem;
*wp = '\0';
return result;
@@ -310,7 +417,7 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
belonging to the map is loaded. In this case the path element
containing $ORIGIN is left out. */
static char *
expand_dynamic_string_token (struct link_map *l, const char *s)
expand_dynamic_string_token (struct link_map *l, const char *s, int is_path)
{
/* We make two runs over the string. First we determine how large the
resulting string is and then we copy it over. Since this is now
@@ -321,7 +428,7 @@ expand_dynamic_string_token (struct link_map *l, const char *s)
char *result;
/* Determine the number of DST elements. */
cnt = DL_DST_COUNT (s, 1);
cnt = DL_DST_COUNT (s, is_path);
/* If we do not have to replace anything simply copy the string. */
if (__builtin_expect (cnt, 0) == 0)
@@ -335,7 +442,7 @@ expand_dynamic_string_token (struct link_map *l, const char *s)
if (result == NULL)
return NULL;
return _dl_dst_substitute (l, s, result, 1);
return _dl_dst_substitute (l, s, result, is_path);
}
@@ -407,33 +514,8 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep,
cp[len++] = '/';
/* Make sure we don't use untrusted directories if we run SUID. */
if (__builtin_expect (check_trusted, 0))
{
const char *trun = system_dirs;
size_t idx;
int unsecure = 1;
/* All trusted directories must be complete names. */
if (cp[0] == '/')
{
for (idx = 0; idx < nsystem_dirs_len; ++idx)
{
if (len == system_dirs_len[idx]
&& memcmp (trun, cp, len) == 0)
{
/* Found it. */
unsecure = 0;
break;
}
trun += system_dirs_len[idx] + 1;
}
}
if (unsecure)
/* Simply drop this directory. */
continue;
}
if (__builtin_expect (check_trusted, 0) && !is_trusted_path (cp, len))
continue;
/* See if this directory is already known. */
for (dirp = GL(dl_all_dirs); dirp != NULL; dirp = dirp->next)
@@ -551,13 +633,21 @@ decompose_rpath (struct r_search_path_struct *sps,
/* Make a writable copy. At the same time expand possible dynamic
string tokens. */
copy = expand_dynamic_string_token (l, rpath);
copy = expand_dynamic_string_token (l, rpath, 1);
if (copy == NULL)
{
errstring = N_("cannot create RUNPATH/RPATH copy");
goto signal_error;
}
/* Ignore empty rpaths. */
if (*copy == 0)
{
free (copy);
sps->dirs = (struct r_search_path_elem **) -1;
return false;
}
/* Count the number of necessary elements in the result array. */
nelems = 0;
for (cp = copy; *cp != '\0'; ++cp)
@@ -801,19 +891,7 @@ lose (int code, int fd, const char *name, char *realname, struct link_map *l,
/* The file might already be closed. */
if (fd != -1)
(void) __close (fd);
if (l != NULL)
{
/* Remove the stillborn object from the list and free it. */
assert (l->l_next == NULL);
if (l->l_prev == NULL)
/* No other module loaded. This happens only in the static library,
or in rtld under --verify. */
GL(dl_ns)[l->l_ns]._ns_loaded = NULL;
else
l->l_prev->l_next = NULL;
--GL(dl_ns)[l->l_ns]._ns_nloaded;
free (l);
}
free (l);
free (realname);
if (r != NULL)
@@ -898,6 +976,9 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
never be unloaded. */
__close (fd);
/* Add the map for the mirrored object to the object list. */
_dl_add_to_namespace_list (l, nsid);
return l;
}
#endif
@@ -1492,6 +1573,9 @@ cannot enable executable stack as shared object requires");
add_name_to_object (l, ((const char *) D_PTR (l, l_info[DT_STRTAB])
+ l->l_info[DT_SONAME]->d_un.d_val));
/* Now that the object is fully initialized add it to the object list. */
_dl_add_to_namespace_list (l, nsid);
#ifdef SHARED
/* Auditing checkpoint: we have a new object. */
if (__builtin_expect (GLRO(dl_naudit) > 0, 0)
@@ -1802,7 +1886,7 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
if MAY_FREE_DIRS is true. */
static int
open_path (const char *name, size_t namelen, int preloaded,
open_path (const char *name, size_t namelen, int secure,
struct r_search_path_struct *sps, char **realname,
struct filebuf *fbp, struct link_map *loader, int whatcode,
bool *found_other_class)
@@ -1884,7 +1968,7 @@ open_path (const char *name, size_t namelen, int preloaded,
/* Remember whether we found any existing directory. */
here_any |= this_dir->status[cnt] != nonexisting;
if (fd != -1 && __builtin_expect (preloaded, 0)
if (fd != -1 && __builtin_expect (secure, 0)
&& INTUSE(__libc_enable_secure))
{
/* This is an extra security effort to make sure nobody can
@@ -1953,7 +2037,7 @@ open_path (const char *name, size_t namelen, int preloaded,
struct link_map *
internal_function
_dl_map_object (struct link_map *loader, const char *name, int preloaded,
_dl_map_object (struct link_map *loader, const char *name,
int type, int trace_mode, int mode, Lmid_t nsid)
{
int fd;
@@ -2057,7 +2141,8 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
for (l = loader; l; l = l->l_loader)
if (cache_rpath (l, &l->l_rpath_dirs, DT_RPATH, "RPATH"))
{
fd = open_path (name, namelen, preloaded, &l->l_rpath_dirs,
fd = open_path (name, namelen, mode & __RTLD_SECURE,
&l->l_rpath_dirs,
&realname, &fb, loader, LA_SER_RUNPATH,
&found_other_class);
if (fd != -1)
@@ -2072,14 +2157,15 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
&& main_map != NULL && main_map->l_type != lt_loaded
&& cache_rpath (main_map, &main_map->l_rpath_dirs, DT_RPATH,
"RPATH"))
fd = open_path (name, namelen, preloaded, &main_map->l_rpath_dirs,
fd = open_path (name, namelen, mode & __RTLD_SECURE,
&main_map->l_rpath_dirs,
&realname, &fb, loader ?: main_map, LA_SER_RUNPATH,
&found_other_class);
}
/* Try the LD_LIBRARY_PATH environment variable. */
if (fd == -1 && env_path_list.dirs != (void *) -1)
fd = open_path (name, namelen, preloaded, &env_path_list,
fd = open_path (name, namelen, mode & __RTLD_SECURE, &env_path_list,
&realname, &fb,
loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded,
LA_SER_LIBPATH, &found_other_class);
@@ -2088,12 +2174,12 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
if (fd == -1 && loader != NULL
&& cache_rpath (loader, &loader->l_runpath_dirs,
DT_RUNPATH, "RUNPATH"))
fd = open_path (name, namelen, preloaded,
fd = open_path (name, namelen, mode & __RTLD_SECURE,
&loader->l_runpath_dirs, &realname, &fb, loader,
LA_SER_RUNPATH, &found_other_class);
if (fd == -1
&& (__builtin_expect (! preloaded, 1)
&& (__builtin_expect (! (mode & __RTLD_SECURE), 1)
|| ! INTUSE(__libc_enable_secure)))
{
/* Check the list of libraries in the file /etc/ld.so.cache,
@@ -2104,7 +2190,9 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
{
#ifdef SHARED
// XXX Correct to unconditionally default to namespace 0?
l = loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded;
l = (loader
?: GL(dl_ns)[LM_ID_BASE]._ns_loaded
?: &GL(dl_rtld_map));
#else
l = loader;
#endif
@@ -2159,7 +2247,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
&& ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
|| __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1))
&& rtld_search_dirs.dirs != (void *) -1)
fd = open_path (name, namelen, preloaded, &rtld_search_dirs,
fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs,
&realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
/* Add another newline when we are tracing the library loading. */
@@ -2170,7 +2258,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
{
/* The path may contain dynamic string tokens. */
realname = (loader
? expand_dynamic_string_token (loader, name)
? expand_dynamic_string_token (loader, name, 0)
: local_strdup (name));
if (realname == NULL)
fd = -1;
@@ -2204,7 +2292,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
have. */
static const Elf_Symndx dummy_bucket = STN_UNDEF;
/* Enter the new object in the list of loaded objects. */
/* Allocate a new object map. */
if ((name_copy = local_strdup (name)) == NULL
|| (l = _dl_new_object (name_copy, name, type, loader,
mode, nsid)) == NULL)
@@ -2222,6 +2310,9 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
l->l_nbuckets = 1;
l->l_relocated = 1;
/* Enter the object in the object list. */
_dl_add_to_namespace_list (l, nsid);
return l;
}
else if (found_other_class)
+38 -33
View File
@@ -1,5 +1,5 @@
/* Look up a symbol in the loaded objects.
Copyright (C) 1995-2005, 2006, 2007, 2009 Free Software Foundation, Inc.
Copyright (C) 1995-2007, 2009, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -312,39 +312,21 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
definition we have to use it. */
void enter (struct unique_sym *table, size_t size,
unsigned int hash, const char *name,
const ElfW(Sym) *sym, struct link_map *map)
const ElfW(Sym) *sym, const struct link_map *map)
{
size_t idx = hash % size;
size_t hash2 = 1 + hash % (size - 2);
while (1)
while (table[idx].name != NULL)
{
if (table[idx].name == NULL)
{
table[idx].hashval = hash;
table[idx].name = name;
if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
{
table[idx].sym = ref;
table[idx].map = undef_map;
}
else
{
table[idx].sym = sym;
table[idx].map = map;
if (map->l_type == lt_loaded)
/* Make sure we don't unload this object by
setting the appropriate flag. */
map->l_flags_1 |= DF_1_NODELETE;
}
return;
}
idx += hash2;
if (idx >= size)
idx -= size;
}
table[idx].hashval = hash;
table[idx].name = name;
table[idx].sym = sym;
table[idx].map = map;
}
struct unique_sym_table *tab
@@ -363,8 +345,19 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
if (entries[idx].hashval == new_hash
&& strcmp (entries[idx].name, undef_name) == 0)
{
result->s = entries[idx].sym;
result->m = (struct link_map *) entries[idx].map;
if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
{
/* We possibly have to initialize the central
copy from the copy addressed through the
relocation. */
result->s = sym;
result->m = (struct link_map *) map;
}
else
{
result->s = entries[idx].sym;
result->m = (struct link_map *) entries[idx].map;
}
__rtld_lock_unlock_recursive (tab->lock);
return 1;
}
@@ -425,8 +418,19 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
tab->free = free;
}
enter (entries, size, new_hash, strtab + sym->st_name, sym,
(struct link_map *) map);
if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
enter (entries, size, new_hash, strtab + sym->st_name, ref,
undef_map);
else
{
enter (entries, size, new_hash, strtab + sym->st_name, sym,
map);
if (map->l_type == lt_loaded)
/* Make sure we don't unload this object by
setting the appropriate flag. */
((struct link_map *) map)->l_flags_1 |= DF_1_NODELETE;
}
++tab->n_elements;
__rtld_lock_unlock_recursive (tab->lock);
@@ -777,7 +781,7 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
if (__builtin_expect (protected != 0, 0))
{
/* It is very tricky. We need to figure out what value to
return for the protected symbol. */
return for the protected symbol. */
if (type_class == ELF_RTYPE_CLASS_PLT)
{
if (current_value.s != NULL && current_value.m != undef_map)
@@ -822,7 +826,8 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
version, type_class, flags, skip_map);
/* The object is used. */
current_value.m->l_used = 1;
if (__builtin_expect (current_value.m->l_used == 0, 0))
current_value.m->l_used = 1;
if (__builtin_expect (GLRO(dl_debug_mask)
& (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0))
@@ -844,7 +849,7 @@ _dl_setup_hash (struct link_map *map)
Elf_Symndx nchain;
if (__builtin_expect (map->l_info[DT_ADDRTAGIDX (DT_GNU_HASH) + DT_NUM
+ DT_THISPROCNUM + DT_VERSIONTAGNUM
+ DT_THISPROCNUM + DT_VERSIONTAGNUM
+ DT_EXTRANUM + DT_VALNUM] != NULL, 1))
{
Elf32_Word *hash32
+31 -21
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;
}
+8 -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, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -144,7 +144,8 @@ _dl_fixup (
/* And now perhaps the relocation addend. */
value = elf_machine_plt_value (l, reloc, value);
if (__builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0))
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0))
value = ((DL_FIXUP_VALUE_TYPE (*) (void)) DL_FIXUP_VALUE_ADDR (value)) ();
/* Finally, fix up the plt itself. */
@@ -231,8 +232,9 @@ _dl_profile_fixup (
? LOOKUP_VALUE_ADDRESS (result)
+ defsym->st_value : 0);
if (__builtin_expect (ELFW(ST_TYPE) (defsym->st_info)
== STT_GNU_IFUNC, 0))
if (defsym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (defsym->st_info)
== STT_GNU_IFUNC, 0))
value = ((DL_FIXUP_VALUE_TYPE (*) (void))
DL_FIXUP_VALUE_ADDR (value)) ();
}
@@ -369,7 +371,7 @@ _dl_profile_fixup (
struct audit_ifaces *afct = GLRO(dl_audit);
for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt)
{
if (afct->ARCH_LA_PLTENTER != NULL
if (afct->ARCH_LA_PLTENTER != NULL
&& (reloc_result->enterexit
& (LA_SYMB_NOPLTENTER << (2 * (cnt + 1)))) == 0)
{
@@ -444,6 +446,7 @@ _dl_call_pltexit (struct link_map *l, ElfW(Word) reloc_arg,
/* Set up the sym parameter. */
ElfW(Sym) sym = *defsym;
sym.st_value = DL_FIXUP_VALUE_ADDR (reloc_result->addr);
/* Get the symbol name. */
const char *strtab = (const void *) D_PTR (reloc_result->bound,
+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)
{
+1 -4
View File
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. Generic version.
Copyright (C) 2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc.
Copyright (C) 2002-2006,2008,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,9 +33,6 @@
to allow dynamic loading of modules defining IE-model TLS data. */
#define TLS_STATIC_SURPLUS 64 + DL_NNS * 100
/* Value used for dtv entries for which the allocation is delayed. */
#define TLS_DTV_UNALLOCATED ((void *) -1l)
/* Out-of-memory handler. */
#ifdef SHARED
+8 -4
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;
+35 -16
View File
@@ -384,14 +384,17 @@ add_dir (const char *line)
}
/* Canonify path: for now only remove leading and trailing
whitespace and the trailing slashes slashes. */
i = strlen (entry->path) - 1;
whitespace and the trailing slashes. */
i = strlen (entry->path);
while (isspace (entry->path[i]) && i > 0)
entry->path[i--] = '\0';
while (i > 0 && isspace (entry->path[i - 1]))
entry->path[--i] = '\0';
while (entry->path[i] == '/' && i > 0)
entry->path[i--] = '\0';
while (i > 0 && entry->path[i - 1] == '/')
entry->path[--i] = '\0';
if (i == 0)
return;
char *path = entry->path;
if (opt_chroot)
@@ -773,7 +776,18 @@ search_dir (const struct dir_entry *entry)
{
/* In case of symlink, we check if the symlink refers to
a directory. */
if (__builtin_expect (stat64 (real_file_name, &stat_buf), 0))
char *target_name = real_file_name;
if (opt_chroot)
{
target_name = chroot_canon (opt_chroot, file_name);
if (target_name == NULL)
{
if (strstr (file_name, ".so") == NULL)
error (0, 0, _("Input file %s not found.\n"), file_name);
continue;
}
}
if (__builtin_expect (stat64 (target_name, &stat_buf), 0))
{
if (opt_verbose)
error (0, errno, _("Cannot stat %s"), file_name);
@@ -1174,7 +1188,9 @@ parse_conf_include (const char *config_file, unsigned int lineno,
if (do_chroot && opt_chroot)
{
char *canon = chroot_canon (opt_chroot, pattern);
result = glob64 (canon ?: pattern, 0, NULL, &gl);
if (canon == NULL)
return;
result = glob64 (canon, 0, NULL, &gl);
free (canon);
}
else
@@ -1305,11 +1321,9 @@ main (int argc, char **argv)
p ? (*p = '\0', cache_file) : "/");
if (canon == NULL)
{
error (EXIT_FAILURE, errno,
_("Can't open cache file directory %s\n"),
p ? cache_file : "/");
}
error (EXIT_FAILURE, errno,
_("Can't open cache file directory %s\n"),
p ? cache_file : "/");
if (p)
++p;
@@ -1346,8 +1360,12 @@ main (int argc, char **argv)
add_system_dir (LIBDIR);
}
if (! opt_ignore_aux_cache)
load_aux_cache (_PATH_LDCONFIG_AUX_CACHE);
const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
if (opt_chroot)
aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
if (! opt_ignore_aux_cache && aux_cache_file)
load_aux_cache (aux_cache_file);
else
init_aux_cache ();
@@ -1356,7 +1374,8 @@ main (int argc, char **argv)
if (opt_build_cache)
{
save_cache (cache_file);
save_aux_cache (_PATH_LDCONFIG_AUX_CACHE);
if (aux_cache_file)
save_aux_cache (aux_cache_file);
}
return 0;
+11 -2
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
+4 -1
View File
@@ -1,5 +1,5 @@
/* Conversion loop frame work.
Copyright (C) 1998-2002, 2003, 2005, 2008 Free Software Foundation, Inc.
Copyright (C) 1998-2003, 2005, 2008, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -399,6 +399,9 @@ SINGLE(LOOPFCT) (struct __gconv_step *step,
{
*inptrp = inend;
#ifdef STORE_REST
while (inptr < inend)
bytebuf[inlen++] = *inptr++;
inptr = bytebuf;
inptrp = &inptr;
inend = &bytebuf[inlen];
+1
View File
@@ -14,6 +14,7 @@ extern void *__alloca (size_t __size);
extern int __libc_use_alloca (size_t size) __attribute__ ((const));
extern int __libc_alloca_cutoff (size_t size) __attribute__ ((const));
libc_hidden_proto (__libc_alloca_cutoff)
#define __MAX_ALLOCA_CUTOFF 65536
+1 -1
View File
@@ -33,7 +33,7 @@
the multi-thread case. The interfaces have the prefix
"catomic_".
- support functions like barriers. They also have the preifx
- support functions like barriers. They also have the prefix
"atomic_".
Architectures must provide a few lowlevel macros (the compare
+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 -2
View File
@@ -159,7 +159,7 @@ nrl_domainname (void)
int
getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
socklen_t hostlen, char *serv, socklen_t servlen,
unsigned int flags)
int flags)
{
int serrno = errno;
int tmpbuflen = 1024;
@@ -385,7 +385,7 @@ getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
break;
default:
return EAI_FAMILY;
return EAI_FAMILY;
}
if (serv && (servlen > 0))
+3 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006,2007, 2009
/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006,2007,2009,2010,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -64,6 +64,8 @@ __BEGIN_DECLS
# define AT_REMOVEDIR 0x200 /* Remove directory instead of
unlinking file. */
# define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
# define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount
traversal. */
# define AT_EACCESS 0x200 /* Test access permitted for
effective IDs, not real IDs. */
#endif
+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)
+15 -15
View File
@@ -290,7 +290,7 @@ _IO_new_file_fopen (fp, filename, mode, is32not64)
#ifdef _LIBC
last_recognized = mode;
#endif
for (i = 1; i < 6; ++i)
for (i = 1; i < 7; ++i)
{
switch (*++mode)
{
@@ -997,18 +997,18 @@ _IO_new_file_seekoff (fp, offset, dir, mode)
/* Adjust for read-ahead (bytes is buffer). */
offset -= fp->_IO_read_end - fp->_IO_read_ptr;
if (fp->_offset == _IO_pos_BAD)
{
if (mode != 0)
goto dumb;
else
{
result = _IO_SYSSEEK (fp, 0, dir);
if (result == EOF)
return result;
{
if (mode != 0)
goto dumb;
else
{
result = _IO_SYSSEEK (fp, 0, dir);
if (result == EOF)
return result;
fp->_offset = result;
}
}
fp->_offset = result;
}
}
/* Make offset absolute, assuming current pointer is file_ptr(). */
offset += fp->_offset;
if (offset < 0)
@@ -1270,7 +1270,7 @@ _IO_new_file_write (f, data, n)
{
f->_flags |= _IO_ERR_SEEN;
break;
}
}
to_do -= count;
data = (void *) ((char *) data + count);
}
@@ -1358,12 +1358,12 @@ _IO_new_file_xsputn (f, data, n)
do_write = to_do - (block_size >= 128 ? to_do % block_size : 0);
if (do_write)
{
{
count = new_do_write (f, s, do_write);
to_do -= count;
if (count < do_write)
return n - to_do;
}
}
/* Now write out the remainder. Normally, this will fit in the
buffer, but it's somewhat messier for line-buffered files,
+2 -2
View File
@@ -1,5 +1,5 @@
/* Fmemopen implementation.
Copyright (C) 2000, 2002, 2005, 2006, 2008, 2009
Copyright (C) 2000, 2002, 2005, 2006, 2008, 2009, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Hanno Mueller, kontakt@hanno.de, 2000.
@@ -243,7 +243,7 @@ fmemopen (void *buf, size_t len, const char *mode)
if (mode[0] == 'w')
c->buffer[0] = '\0';
c->maxpos = strlen (c->buffer);
c->maxpos = strnlen (c->buffer, len);
if (mode[0] == 'a')
c->pos = c->maxpos;
+4 -1
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
+4 -5
View File
@@ -64,7 +64,7 @@ print_version (FILE *stream, struct argp_state *state)
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
"), "1999");
"), "2011");
}
static char *
@@ -123,7 +123,7 @@ do_pt_chown (void)
/* Set the owner to the real user ID, and the group to that special
group ID. */
if (st.st_gid != gid && chown (pty, getuid (), gid) < 0)
if (chown (pty, getuid (), gid) < 0)
return FAIL_EACCES;
/* Set the permission mode to readable and writable by the owner,
@@ -154,8 +154,7 @@ main (int argc, char *argv[])
# define ncap_list (sizeof (cap_list) / sizeof (cap_list[0]))
cap_t caps = cap_init ();
if (caps == NULL)
error (FAIL_ENOMEM, errno,
_("Failed to initialize drop of capabilities"));
return FAIL_ENOMEM;
/* There is no reason why these should not work. */
cap_set_flag (caps, CAP_PERMITTED, ncap_list, cap_list, CAP_SET);
@@ -166,7 +165,7 @@ main (int argc, char *argv[])
cap_free (caps);
if (__builtin_expect (res != 0, 0))
error (FAIL_EXEC, errno, _("cap_set_proc failed"));
return FAIL_EXEC;
}
#endif
+14 -11
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
@@ -2831,7 +2832,7 @@ static void do_check_malloc_state(mstate av)
max_fast_bin = fastbin_index(get_max_fast ());
for (i = 0; i < NFASTBINS; ++i) {
p = av->fastbins[i];
p = fastbin (av, i);
/* The following test can only be performed for the main arena.
While mallopt calls malloc_consolidate to get rid of all fast
@@ -3933,9 +3934,10 @@ public_vALLOc(size_t bytes)
if(!p) {
/* Maybe the failure is due to running out of mmapped areas. */
if(ar_ptr != &main_arena) {
(void)mutex_lock(&main_arena.mutex);
p = _int_memalign(&main_arena, pagesz, bytes);
(void)mutex_unlock(&main_arena.mutex);
ar_ptr = &main_arena;
(void)mutex_lock(&ar_ptr->mutex);
p = _int_memalign(ar_ptr, pagesz, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
} else {
#if USE_ARENAS
/* ... or sbrk() has failed and there is still a chance to mmap() */
@@ -3978,9 +3980,10 @@ public_pVALLOc(size_t bytes)
if(!p) {
/* Maybe the failure is due to running out of mmapped areas. */
if(ar_ptr != &main_arena) {
(void)mutex_lock(&main_arena.mutex);
p = _int_memalign(&main_arena, pagesz, rounded_bytes);
(void)mutex_unlock(&main_arena.mutex);
ar_ptr = &main_arena;
(void)mutex_lock(&ar_ptr->mutex);
p = _int_memalign(ar_ptr, pagesz, rounded_bytes);
(void)mutex_unlock(&ar_ptr->mutex);
} else {
#if USE_ARENAS
/* ... or sbrk() has failed and there is still a chance to mmap() */
@@ -4847,7 +4850,7 @@ _int_free(mstate av, mchunkptr p)
}
if (__builtin_expect (perturb_byte, 0))
free_perturb (chunk2mem(p), size - SIZE_SZ);
free_perturb (chunk2mem(p), size - 2 * SIZE_SZ);
set_fastchunks(av);
fb = &fastbin (av, fastbin_index(size));
@@ -4935,7 +4938,7 @@ _int_free(mstate av, mchunkptr p)
}
if (__builtin_expect (perturb_byte, 0))
free_perturb (chunk2mem(p), size - SIZE_SZ);
free_perturb (chunk2mem(p), size - 2 * SIZE_SZ);
/* consolidate backward */
if (!prev_inuse(p)) {
+21 -1
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 -1
View File
@@ -90,7 +90,8 @@ distribute += $(filter-out $(generated),$(long-m-yes:=.c) $(long-c-yes:=.c))
# Rules for the test suite.
tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \
test-misc test-fpucw tst-definitions test-tgmath test-tgmath-ret \
bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int test-tgmath2
bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int \
test-tgmath2 test-powl
# We do the `long double' tests only if this data type is available and
# distinct from `double'.
test-longdouble-yes = test-ldouble test-ildoubl
@@ -131,6 +132,7 @@ CFLAGS-test-ldouble.c = -fno-inline -ffloat-store -fno-builtin
CFLAGS-test-tgmath.c = -fno-builtin
CFLAGS-test-tgmath2.c = -fno-builtin
CFLAGS-test-tgmath-ret.c = -fno-builtin
CFLAGS-test-powl.c = -fno-builtin
CPPFLAGS-test-ifloat.c = -U__LIBC_INTERNAL_MATH_INLINES -D__FAST_MATH__ \
-DTEST_FAST_MATH -fno-builtin
CPPFLAGS-test-idouble.c = -U__LIBC_INTERNAL_MATH_INLINES -D__FAST_MATH__ \
+51
View File
@@ -0,0 +1,51 @@
/* Test for powl
Copyright (C) 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <stdio.h>
#include <math.h>
#include <float.h>
#include <ieee754.h>
int
main (void)
{
int result = 0;
#ifndef NO_LONG_DOUBLE
# if LDBL_MANT_DIG == 64
{
long double x = 1e-20;
union ieee854_long_double u;
u.ieee.mantissa0 = 1;
u.ieee.mantissa1 = 1;
u.ieee.exponent = 0;
u.ieee.negative = 0;
(void) powl (0.2, u.d);
x = powl (x, 1.5);
if (fabsl (x - 1e-30) > 1e-10)
{
printf ("powl (1e-20, 1.5): wrong result: %Lg\n", x);
result = 1;
}
}
# endif
#endif
return result;
}
+3 -3
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
+4 -2
View File
@@ -1,5 +1,5 @@
/* Error handler for noninteractive utilities
Copyright (C) 1990-1998, 2000-2005, 2006 Free Software Foundation, Inc.
Copyright (C) 1990-1998, 2000-2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -272,7 +272,9 @@ error_at_line (int status, int errnum, const char *file_name,
if (old_line_number == line_number
&& (file_name == old_file_name
|| strcmp (old_file_name, file_name) == 0))
|| (old_file_name != NULL
&& file_name != NULL
&& strcmp (old_file_name, file_name) == 0)))
/* Simply return and print nothing. */
return;
+2 -2
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++;
+5 -5
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, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -194,7 +194,7 @@ weak_alias (__getmntent_r, getmntent_r)
const char *rp = name; \
\
while (*rp != '\0') \
if (*rp == ' ' || *rp == '\t' || *rp == '\\') \
if (*rp == ' ' || *rp == '\t' || *rp == '\n' || *rp == '\\') \
break; \
else \
++rp; \
@@ -202,7 +202,7 @@ weak_alias (__getmntent_r, getmntent_r)
if (*rp != '\0') \
{ \
/* In the worst case the length of the string can increase to \
founr times the current length. */ \
four times the current length. */ \
char *wp; \
\
rp = name; \
@@ -263,8 +263,8 @@ __addmntent (FILE *stream, const struct mntent *mnt)
mntcopy.mnt_type,
mntcopy.mnt_opts,
mntcopy.mnt_freq,
mntcopy.mnt_passno)
< 0 ? 1 : 0);
mntcopy.mnt_passno) < 0
|| fflush (stream) != 0);
}
weak_alias (__addmntent, addmntent)
+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,
+43
View File
@@ -1,3 +1,46 @@
2011-05-11 Ulrich Drepper <drepper@gmail.com>
[BZ #386]
* allocatestack.c (allocate_stack): Convert ENOMEM error to EAGAIN.
2011-04-10 Ulrich Drepper <drepper@gmail.com>
[BZ #12650]
* allocatestack.c (get_cached_stack): Deallocate DTV entries before
clearing memory.
Patch partly by Robert Rex <robert.rex@exasol.com>.
2011-01-13 Ulrich Drepper <drepper@gmail.com>
[BZ #10484]
* Versions [libc] (GLIBC_PRIVATE): Export __libc_alloca_cutoff.
* alloca_cutoff.c: Add libc_hidden_def.
2010-08-12 H.J. Lu <hongjiu.lu@intel.com>
* nptl/sysdeps/unix/sysv/linux/i386/Makefile: New file.
2010-07-01 Ulrich Drepper <drepper@redhat.com>
* Makefile (tst-_res1): Add tst-_res1mod1 to dependency list.
2010-10-13 H.J. Lu <hongjiu.lu@intel.com>
[BZ #12113]
* sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Changed to 32.
* sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Defined with alignment
of "struct pthread".
2010-06-01 Takashi Yoshii <takashi.yoshii.zj@renesas.com>
* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Fix incorrect
location of ifndef __ASSUME_FUTEX_CLOCK_REALTIME.
2009-11-27 Andreas Schwab <schwab@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
THREAD_SELF->cancelhandling after returning from futex call.
2009-11-03 Andreas Schwab <schwab@linux-m68k.org>
[BZ #4457]
+2 -1
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
+1
View File
@@ -27,6 +27,7 @@ libc {
pthread_cond_broadcast; pthread_cond_timedwait;
}
GLIBC_PRIVATE {
__libc_alloca_cutoff;
# Internal libc interface to libpthread
__libc_dl_error_tsd;
}
+2 -1
View File
@@ -1,5 +1,5 @@
/* Determine whether block of given size can be allocated on the stack or not.
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2002, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,3 +34,4 @@ __libc_alloca_cutoff (size_t size)
assume the maximum available stack space. */
?: __MAX_ALLOCA_CUTOFF * 4));
}
libc_hidden_def (__libc_alloca_cutoff)
+7 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002-2007, 2009 Free Software Foundation, Inc.
/* Copyright (C) 2002-2007, 2009, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -26,6 +26,7 @@
#include <sys/mman.h>
#include <sys/param.h>
#include <dl-sysdep.h>
#include <dl-tls.h>
#include <tls.h>
#include <lowlevellock.h>
#include <kernel-features.h>
@@ -238,6 +239,10 @@ get_cached_stack (size_t *sizep, void **memp)
/* Clear the DTV. */
dtv_t *dtv = GET_DTV (TLS_TPADJ (result));
for (size_t cnt = 0; cnt < dtv[-1].counter; ++cnt)
if (! dtv[1 + cnt].pointer.is_static
&& dtv[1 + cnt].pointer.val != TLS_DTV_UNALLOCATED)
free (dtv[1 + cnt].pointer.val);
memset (dtv, '\0', (dtv[-1].counter + 1) * sizeof (dtv_t));
/* Re-initialize the TLS. */
@@ -623,7 +628,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
{
int err;
mprot_error:
err = errno;
err = errno == ENOMEM ? EAGAIN : errno;
lll_lock (stack_cache_lock, LLL_PRIVATE);
@@ -0,0 +1,3 @@
ifeq ($(subdir),nptl)
CFLAGS-pt-initfini.s += -fno-asynchronous-unwind-tables
endif
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009
/* Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -282,6 +282,7 @@ __lll_timedlock_wait:
rts
mov.l @r15+, r12
# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
.align 2
# ifdef PIC
.Lgot:
@@ -293,7 +294,6 @@ __lll_timedlock_wait:
.long __have_futex_clock_realtime
# endif
# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
.Lreltmo:
/* Check for a valid timeout value. */
mov.l @(4,r6), r1
@@ -96,8 +96,8 @@ ENTRY(__pthread_disable_asynccancel)
cmpxchgl %r11d, %fs:CANCELHANDLING
jnz 2b
3: movl %r11d, %eax
andl $(TCB_CANCELING_BITMASK|TCB_CANCELED_BITMASK), %eax
movl %r11d, %eax
3: andl $(TCB_CANCELING_BITMASK|TCB_CANCELED_BITMASK), %eax
cmpl $TCB_CANCELING_BITMASK, %eax
je 4f
1: ret
@@ -111,5 +111,6 @@ ENTRY(__pthread_disable_asynccancel)
addq $CANCELHANDLING, %rdi
LOAD_PRIVATE_FUTEX_WAIT (%esi)
syscall
movl %fs:CANCELHANDLING, %eax
jmp 3b
END(__pthread_disable_asynccancel)
+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. */

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