Compare commits

...
Author SHA1 Message Date
Ulrich Drepper deb84c43b1 * version.h (VERSION): Bump to 2.10.1.
* nss/getXXbyYY_r.c: If NO_COMPAT_NEEDED is defined don't define any
	compatibility functions.
	* nss/getXXent_r.c: Likewise.
	* gshadow/getsgent_r.c: Define NO_COMPAT_NEEDED.
	* gshadow/getsgnam_r.c: Likewise.
	* gshadow/Version: Remove duplicate entries.

	* sysdeps/x86_64/cacheinfo.c (intel_02_cache_info): Add missing entries
	for recent processor.
	* sysdeps/unix/sysv/linux/i386/sysconf.c (intel_02_cache_info):
	Likewise.
2009-05-10 18:38:52 +00:00
Ulrich Drepper eb29449a9a * Makeconfig: Undo last change. Add asflags-cpu to ASFLAGS in the
same place we add ASFLAGS-config.
2009-05-09 21:58:12 +00:00
Ulrich Drepper deb318c255 * version.h (VERSION): Bump for 2.10 release.
* include/features.h (__GLIBC_MINOR__): Bump to 10.
2009-05-09 17:40:57 +00:00
Ulrich Drepper cf4f16cc88 [BZ #10128]
2009-05-05  Aurelien Jarno  <aurelien@aurel32.net>
	[BZ #10128]
	* resolv/res_query.c (__libc_res_nquery): If one query returns NOTIMP
	or FORMERR and the other NOERROR, don't raise an error.
2009-05-09 16:12:41 +00:00
Ulrich Drepper 23b6b46646 [BZ #10118]
2009-05-06  Ryan S. Arnold  <rsa@us.ibm.com>
	[BZ #10118]
	* Makeconfig (+asflags): New variable based upon ASFLAG or
	asflags-cpu.
	(ASFLAGS): Add override to set ASFLAGS to +asflags.
	* config.make.in (asflags-cpu): Add variable based upon
	@libc_cv_cc_submachine@ to propagate -mcpu=CPU from --with-cpu=CPU to
	the assembler.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/setcontext.S:
	Remove unneeded file now that the assembler emits _ARCH_PWR6 and
	recognizes power6 instruction set due to passing -mcpu=power6 from
	--with-cpu=power6 when compiling .S files.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/swapcontext.S:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/setcontext.S:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/swapcontext.S:
	Likewise.
2009-05-09 15:59:55 +00:00
Ulrich Drepper 15417de3e0 * string/stratcliff.c (do_test): Test for zero length
STRNLEN, MEMCHR, STRNCPY, STPNCPY, MEMCPY, MEMPCPY and memccpy
	at the end of the page.
2009-05-09 14:45:07 +00:00
Ulrich Drepper 4300afc169 * sysdeps/unix/sysv/linux/kernel-features.h: Define __ASSUME_AT_RANDOM. 2009-05-09 06:54:31 +00:00
Ulrich Drepper 2221e33e5d * sysdeps/x86_64/memchr.S: Handle invalid buffer pointers when
count is zero.
2009-05-09 06:40:15 +00:00
Ulrich Drepper b5f7c4cae0 * po/da.po: Update from translation team.
2009-05-05  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/sys/personality.h: Add ADDR_COMPAT_LAYOUT
	and READ_IMPLIES_EXEC.

2009-05-04  Ulrich Drepper  <drepper@redhat.com>

	* po/da.po: Update from translation team.
2009-05-08 20:51:51 +00:00
Ulrich Drepper 1765abb309 * io/sys/stat.h (fstatat64): Guard prototype with __USE_LARGEFILE64,
guard __extern_inline wrapper with __USE_ATFILE instead of __USE_GNU.
2009-05-07 17:42:24 +00:00
Ulrich Drepper 115a532734 * localedata/locales/bn_BD: Remove comment about missing collation
rules.
	* localedata/locales/iso14651_t1_common: Add Bengali collation rules.
	Patch by Pravin Satpute <psatpute@redhat.com>.
2009-05-04 21:20:20 +00:00
Ulrich Drepper 0277dc595f Update from translation team. 2009-05-04 21:13:21 +00:00
Jakub Jelinek 40de0fe350 Add missing CHangeLog entry.
2009-01-07  Ulrich Drepper  <drepper@redhat.com>

	* (in_flight_stack): New variable.
	(stack_list_del): New function.  Use instead of list_del.
	(stack_list_add): New function.  Use instead of list_add when adding to
	stack_cache and stack_used lists.
	(__reclaim_stacks): Complete operations on stack_cache and stack_used lists
	when the fork call interrupted another thread.
2009-04-29 18:04:10 +00:00
Jakub Jelinek 667712b81d * sysdeps/unix/sysv/linux/ifaddrs.c: Revert unintended 2008-08-12 comment change.
2009-04-29  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/ifaddrs.c: Revert unintended 2008-08-12
	comment change.
2009-04-29 16:42:32 +00:00
Ulrich Drepper d5c157a978 * cancellation.c (__pthread_disable_asynccancel): Use THREAD_ATOMIC_AND
is available.
	* libc-cancellation.c (__libc_disable_asynccancel): Likewise.
	* sysdeps/x86_64/tls.h: Define THREAD_ATOMIC_AND.
	* sysdeps/i386/tls.h: Likewise.
	(tcbhead_t): Add __private_tm member.
2009-04-27 21:55:49 +00:00
Ulrich Drepper 6284c9f61e * locale/programs/locarchive.c (create_archive): Add MAP_PRIVATE
to MAP_ANON in PROT_NONE mmap64 call.
	(open_archive): Likewise.
	(file_data_available_p): Use mmap64 instead of mremap.
	(enlarge_archive): Likewise.  Update head if ah->addr changed.
	Attempt to reserve address space after mmap64 region.
2009-04-27 14:07:57 +00:00
Ulrich Drepper f0e3c47fd6 * sysdeps/ieee754/dbl-64/s_expm1.c: Set errno for overflow.
* sysdeps/ieee754/flt-32/s_expm1f.c: Likewise.
	* sysdeps/x86_64/fpu/s_expm1l.S: Likewise.
2009-04-27 05:31:37 +00:00
Ulrich Drepper 49768bb93e * sysdeps/ieee754/k_standard.c (__kernel_standard): Pole errors in
atanh should set ERANGE.
2009-04-27 04:01:16 +00:00
Ulrich Drepper 218555e9f7 * inet/inet6_option.c (option_alloc): Add temporary variable to 2009-04-27 03:34:27 +00:00
Ulrich Drepper e49dc847d2 [BZ #10087]
* elf/dl-runtime.c (_dl_fixup): Use DL_FIXUP_VALUE_ADDR to access
	result of lookup to make call to implement STT_GNU_IFUNC.
	(_dl_profile_fixup): Likewise.
	Patch by H.J. Lu <hjl.tools@gmail.com>.
2009-04-27 03:01:36 +00:00
Ulrich Drepper 1ac03a1e44 * nscd/connections.c (send_ro_fd): Define temporary variable to avoid
warning.

	* elf/sprof.c: Likewise.
2009-04-26 22:31:19 +00:00
Ulrich Drepper 6cc8844f1d * sysdeps/unix/sysv/linux/dl-osinfo.h (dl_fatal): Remove inline
from definition.

	* sysdeps/x86_64/dl-machine.h (elf_machine_rela): Don't define
	label if it is not used.

	* elf/dl-profile.c (_dl_start_profile): Define real-type variant
	of gmon_hist_hdr and gmon_hdr structures and use them.

	* elf/dl-load.c (open_verify): Add temporary variable to avoid
	warning.

	* nscd/nscd_helper.c (get_mapping): Avoid casts to avoid warnings.

	* sunrpc/clnt_raw.c (clntraw_private_s): Use union in definition
	to avoid cast.

	* inet/rexec.c (rexec_af): Make sa2 a union to avoid warnings.
	* inet/rcmd.c (rcmd_af): Make from a union of the various needed types
	to avoid warnings.
	(iruserok_af): Use ss_family instead of casts.

	* gmon/gmon.c (write_hist): Define real-type variant of
	gmon_hist_hdr structure and use it.
	(write_gmon): Likewise for gmon_hdr.

	* sysdeps/unix/sysv/linux/readv.c: Avoid declaration of replacement
	function if we are not going to define it.
	* sysdeps/unix/sysv/linux/writev.c: Likewise.

	* inet/inet6_option.c (optin_alloc): Add temporary variable to
	avoid warning.

	* libio/strfile.h (struct _IO_streambuf): Use correct type and
	name of VTable element.
	* libio/iovsprintf.c: Avoid casts to avoid warnings.
	* libio/iovsscanf.c: Likewise.
	* libio/vasprintf.c: Likewise.
	* libio/vsnprintf.c: Likewise.
	* stdio-common/isoc99_vsscanf.c: Likewise.
	* stdlib/strfmon_l.c: Likewise.
	* debug/vasprintf_chk.c: Likewise.
	* debug/vsnprintf_chk.c: Likewise.
	* debug/vsprintf_chk.c: Likewise.
2009-04-26 20:12:37 +00:00
Ulrich Drepper 5efe86507d * sem_open.c (sem_open): Rewrite initialization of initsem to
avoid warnings.
2009-04-26 18:37:05 +00:00
Ulrich Drepper f521be31b9 * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
Avoid warning by using may_alias attribute on ptrhack.
2009-04-26 18:06:47 +00:00
Ulrich Drepper 4ec77f72fe * nss/nsswitch.c (__nss_lookup_function): En/Decrypt cached
function pointers.
2009-04-26 16:45:03 +00:00
Ulrich Drepper 82a1a4dae1 * sysdeps/ieee754/dbl-64/s_tan.c (tan): Fix -Wsequence-point warnings. 2009-04-26 15:03:11 +00:00
Ulrich Drepper 27be9b9217 * posix/bits/posix1_lim.h: Cleanup namespace a bit. 2009-04-26 06:18:19 +00:00
Ulrich Drepper 337c270829 * sysdeps/i386/fpu/s_tan.S: Set errno for ±Inf.
* sysdeps/i386/fpu/s_tanf.S: Likewise.
	* sysdeps/i386/fpu/s_tanl.S: Likewise.
	* sysdeps/ieee754/dbl-64/s_tan.c: Likewise.
	* sysdeps/ieee754/flt-32/s_tanf.c: Likewise.
	* sysdeps/x86_64/fpu/s_tanl.S: Likewise.
	* math/libm-test.inc: Add tests for errno after tan calls with
	±Inf.
2009-04-26 05:42:49 +00:00
Ulrich Drepper 002a604fd6 * sysdeps/ieee754/k_standard.c (__kernel_standard): Use correct
errno value vor pow(+-0,neg).
	* math/libm-test.inc (pow_test): Add tests for errno value for
	pole errors.
2009-04-26 04:46:54 +00:00
Ulrich Drepper 7095366d1e * math/w_fmod.c: Also handle x=±Inf as error.
* math/w_fmodf.c: Likewise.
	* math/w_fmodl.c: Likewise.
	* math/libm-test.inc (fmod_test): Add tests for errno after calls for
	x=±Inf or y=0.
2009-04-26 03:43:02 +00:00
Ulrich Drepper 0c59a1963e * sysdeps/i386/fpu/s_cos.S: Set errno for ±Inf.
* sysdeps/i386/fpu/s_cosf.S: Likewise.
	* sysdeps/i386/fpu/s_cosl.S: Likewise.
	* sysdeps/i386/fpu/s_sin.S: Likewise.
	* sysdeps/i386/fpu/s_sinf.S: Likewise.
	* sysdeps/i386/fpu/s_sinl.S: Likewise.
	* sysdeps/ieee754/dbl-64/s_sin.c: Likewise.
	* sysdeps/ieee754/flt-32/s_cosf.c: Likewise.
	* sysdeps/ieee754/flt-32/s_sinf.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_cosl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_sinl.c: Likewise.
	* sysdeps/x86_64/fpu/s_cosl.S: Likewise.
	* sysdeps/x86_64/fpu/s_sinl.S: Likewise.
	* math/libm-test.inc: Add tests for errno after sin/cos calls with
	±Inf.
2009-04-26 01:04:54 +00:00
Ulrich Drepper 4bbf8999f4 * stdlib/strtod_l.c (round_and_return): We have to set errno to
ERANGE for underflows.
	* stdlib/tst-strtod.c (tests): Two tests should set errno to ERANGE.
2009-04-25 17:56:10 +00:00
Ulrich Drepper af9f1c486e * stdio-common/stdio_lim.h.in (L_cuserid): Not part of POSIX since
the 2001 revision.
2009-04-25 16:59:29 +00:00
Ulrich Drepper 81068e35e8 for lgamma should set errno to ERANGE, not EDOM. 2009-04-25 16:16:28 +00:00
Ulrich Drepper 1332704275 * libio/tst-widetext.input: Remove surrogates. 2009-04-25 08:39:43 +00:00
Ulrich Drepper c163ee23e0 * include/features.h: _POSIX_C_SOURCE >= 200112L implies C99. 2009-04-25 08:30:00 +00:00
Ulrich Drepper e971e76d8d * sysdeps/ieee754/k_standard.c (__kernel_standard): Pole errors
for lgamma should se errno to ERANGE, not EDOM.
	* math/libm-test.inc (lgamma_test): Check errno for pole errors.
2009-04-25 08:12:24 +00:00
Ulrich Drepper db6edfb341 * sysdeps/generic/stdint.h (WINT_MAX): Define as 2147483647 since
this is the maximum UCS4 value.
2009-04-25 07:12:27 +00:00
Ulrich Drepper 3873630cd8 * locales/cs.CZ: Change week[2] to 19971130, change first_weekday and
first_workday to 2.
	* locales/da_DK: Likewise.
	* locales/de_DE: Likewise.
	* locales/fr_FR: Likewise.
	* locales/fur_IT: Likewise.
	* locales/fy_DE: Likewise.
	* locales/ht_HT: Likewise.
	* locales/hu_HU: Likewise.
	* locales/li_BE: Likewise.
	* locales/li_NL: Likewise.
	* locales/mk_MK: Likewise.
	* locales/nb_NO: Likewise.
	* locales/nds_DE: Likewise.
	* locales/nds_NL: Likewise.
	* locales/nn_NO: Likewise.
	* locales/pl_PL: Likewise.
	* locales/sc_IT: Likewise.
	* locales/sk_SK: Likewise.
	* locales/uk_UA: Likewise.

	* locales/csb_PL: Change week[2] to 19971130.
	* locales/en_GB: Likewise.
	* locales/et_EE: Likewise.

	* locales/sr_ME: Set week to 7;19971130;4.
	* locales/sr_RS: Likewise.
	* locales/sr_RS@latin: Likewise.
2009-04-25 04:44:16 +00:00
Ulrich Drepper 9c32c895e0 [BZ #10093]
* iconv/gconv_simple.c (BODY for UTF-8 to INTERNAL): Don't accept
	UTF-16 surrogates.
2009-04-24 19:00:54 +00:00
Ulrich Drepper c9edc8891d * locale/programs/locarchive.c (enlarge_archive): Conserve address
space when temporarily mapping the whole content of the old file.
2009-04-24 18:47:19 +00:00
Ulrich Drepper c2d5bd5b00 [BZ #10100]
2009-04-24  Ulrich Drepper  <drepper@redhat.com>
	[BZ #10100]
	* misc/hsearch_r.c (hsearch_r): Add back ensurance that hval is
	not zero.
2009-04-24 18:20:10 +00:00
Ulrich Drepper f397be127c * iconvdata/sjis.c (BODY): Don't advance inptr before
STANDARD_FROM_LOOP_ERR_HANDLER (2) for 2 byte invalid input.
	Use STANDARD_FROM_LOOP_ERR_HANDLER with 2 instead of 1 for
	two byte chars.
2009-04-24 16:37:05 +00:00
Ulrich Drepper 705341a92f * locale/locarchive.h (struct locarhandle): Rename len field to
mmaped and add new reserved field.
	* locale/programs/locarchive.c (RESERVE_MMAP_SIZE): Define.
	(create_archive): Reserve address space and then map file into it.
	(open_archive): Likewise.
	(file_data_available_p): New function.
	(compare_from_file): New function.
	(close_archive): Adjust to member name changes.
	(add_locale): Before comparing locale data, check it is mapped.
	Otherwise fall back to reading from the file.
2009-04-24 16:25:51 +00:00
Ulrich Drepper 57d2da1c67 * stdio-common/psiginfo.c: Include <errno.h>. 2009-04-24 14:05:25 +00:00
Ulrich Drepper fe12c7984b [BZ #9920]
* stdlib/random_r.c (__srandom_r): Change type of word to int32_t
	to get consistency between 32 and 64 bit architectures.
2009-04-24 03:58:48 +00:00
Ulrich Drepper 3d855f75d2 [BZ #10052]
2009-04-23  Ulrich Drepper  <drepper@redhat.com>
	[BZ #10052]
	* sysdeps/unix/make-syscalls.sh: Add rule to create target
	directory for dummy syscall rules.
	Patch by Chris Steinbroner <hesh@pobox.com>.
2009-04-24 03:33:03 +00:00
Ulrich Drepper 95bf537fc7 [BZ #10092]
2009-04-23  Aurelien Jarno  <aurelien@aurel32.net>
	[BZ #10092]
	* sysdeps/unix/sysv/linux/sys/mount.h: Define MNT_DETACH and
	MNT_EXPIRE.
2009-04-24 03:18:52 +00:00
Ulrich Drepper 7f8a28efb5 * sysdeps/unix/sysv/linux/preadv.c: The kernel API changed. Adjust.
* sysdeps/unix/sysv/linux/pwritev.c: Likewise.

2009-04-23  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/posix/pwritev.c (PWRITEV): Fix up comment.  Copy
	data from vector to temporary buffer and call PWRITEV after it
	instead of vice versa.
	* sysdeps/posix/preadv.c: Fix up comment.
	* misc/preadv.c: Likewise.
	* misc/preadv64.c: Likewise.
	* misc/pwritev.c: Likewise.
	* misc/pwritev64.c: Likewise.
	* misc/sys/uio.h (preadv, pwritev, preadv64, pwritev64): Likewise.

2009-04-23  Ulrich Drepper  <drepper@redhat.com>
2009-04-23 22:52:24 +00:00
Ulrich Drepper c7e74e5968 * shadow/sgetspent_r.c (__sgetspent_r): Recognize too small buffers. 2009-04-23 19:15:11 +00:00
Ulrich Drepper 3b055b4786 * shadow/Makefile (tests): Add tst-shadow.
* shadow/tst-shadow.c: New file.

	(public_sET_STATe): Pretty printing.
2009-04-23 18:58:19 +00:00
Ulrich Drepper 829fea4617 [BZ #9955]
2009-04-23  Ulrich Drepper  <drepper@redhat.com>
	[BZ #9955]
	* gshadow/Makefile: New file.
	* gshadow/Versions: New file.
	* gshadow/fgetsgent.c: New file.
	* gshadow/fgetsgent_r.c: New file.
	* gshadow/getsgent.c: New file.
	* gshadow/getsgent_r.c: New file.
	* gshadow/getsgnam.c: New file.
	* gshadow/getsgnam_r.c: New file.
	* gshadow/gshadow.h: New file.
	* gshadow/putsgent.c: New file.
	* gshadow/sgetsgent.c: New file.
	* gshadow/sgetsgent_r.c: New file.
	* gshadow/tst-gshadow.c: New file.
	* include/gshadow.h: New file.
	* Makeconfig (all-subdirs): Add gshadow.
	* Makefile (installed-headers): Add gshadow/gshadow.h.
	* nss/Makefile (databases): Add sgrp.
	* nss/Versions: Add gshadow functions as private exports.
	* nss/nsswitch.conf: Add gshadow entry.
	* nss/sgrp-lookup.c: New file.
	* nss/nss_files/files-parse.c: Add STRING_LIST macro.  Rewrite
	parse_list to handle STRING_LIST and TRAILING_LIST_PARSER.
	* nss/nss_files/files-sgrp.c: New file.
	* sysdeps/generic/paths.h: Add _PATH_GSHADOW.
	* sysdeps/unix/sysv/linux/paths.h: Likewise.
2009-04-23 18:29:30 +00:00
Ulrich Drepper 5497de87c9 [BZ #9963]
2009-04-22  Ulrich Drepper  <drepper@redhat.com>
	[BZ #9963]
	* locales/en_PH: Fix LC_PAPER.
	* locales/es_CL: Likewise.
	* locales/es_CO: Likewise.
	* locales/es_MX: Likewise.
	* locales/es_US: Likewise.
	* locales/es_VE: Likewise.
	* locales/fil_PH: Likewise.
	* locales/ik_CA: Likewise.
	* locales/iu_CA: Likewise.
	* locales/tl_PH: Likewise.
2009-04-23 04:30:42 +00:00
Ulrich Drepper d301a6e167 * pthread_attr_setschedparam.c (__pthread_attr_setschedparam):
Check policy and priority for validity.
	Patch mostly by Zhang Xiliang <zhangxiliang@cn.fujitsu.com>.
2009-04-23 02:29:18 +00:00
Ulrich Drepper debafa10bc * stdio-common/printf.h: Add missing const to register_printf_modifier.
* stdio-common/reg-modifier.c: Likewise.

2009-04-22  Andrew Stubbs  <ams@codesourcery.com>

	* sysdeps/sh/sh4/setjmp.S (__sigsetjmp): Adjust JB_SIZE when there
	is no FPU.
2009-04-23 01:14:33 +00:00
Ulrich Drepper d43f10e715 [BZ #10086] 2009-04-21 00:48:36 +00:00
Ulrich Drepper 1c376f5bbe * sysdeps/unix/sysv/linux/sys/timex.h: Add definitions from kernel
headers up to 2.6.30.
2009-04-21 00:42:50 +00:00
Ulrich Drepper 0e04c0b562 * po/ca.po: Update from translation team. 2009-04-20 22:17:28 +00:00
Ulrich Drepper a245eafd2b [BZ #10069]
2009-04-19  Ulrich Drepper  <drepper@redhat.com>
	[BZ #10069]
	* elf/dl-open.c (dl_open_worker): We cannot guarantee that we can load
	an object that uses static TLS if the TLS modid is higher than the
	reserve we always allocate.  At least for multi-threaded code.
2009-04-19 21:45:02 +00:00
Ulrich Drepper 153aa31b93 * stdlib/strfmon_l.c (__vstrfmon_l): Don't wrap when computing width.
Numerically stable check for valid width.
2009-04-18 19:53:59 +00:00
Ulrich Drepper 59a7162b17 * locale/programs/locarchive.c (open_archive): Map the entire file
and not just the administrative data.
	(add_locale): When we find a hash sum match compare the content
	to be sure.
2009-04-18 12:12:33 +00:00
Ulrich Drepper 0588a9cb62 * malloc/malloc.c (malloc_info): Output address space information. 2009-04-18 08:44:10 +00:00
Ulrich Drepper da2d2fb68d * malloc/malloc.c (malloc_info): Also output system memory information. 2009-04-18 05:14:52 +00:00
Ulrich Drepper 11cad88ce9 * sysdeps/unix/sysv/linux/kernel-features.h: All supported
architectures have preadv/pwritev in 2.6.30.
2009-04-18 02:37:43 +00:00
Ulrich Drepper 571ac26f69 * sysdeps/posix/preadv.c: Reading of zero bytes is no error.
* sysdeps/posix/readv.c: Likewise.
	Reported by Markus Armbruster <armbru@redhat.com>.
2009-04-17 21:26:34 +00:00
Ulrich Drepper 17a5b24e01 * malloc/hooks.c (top_check): Force hook value into register. 2009-04-17 17:55:23 +00:00
Ulrich Drepper acdf23097f (top_check): Force hook value into register. 2009-04-17 17:55:06 +00:00
Roland McGrath 57ec644207 * elf/rtld.c (dl_main): Really call _dl_sysdep_start_cleanup after all
calls to _dl_relocate_object.
2009-04-17 00:00:25 +00:00
Roland McGrath bf8523c867 2009-04-16 Samuel Thibault <samuel.thibault@ens-lyon.org>
* elf/rtld.c (dl_main): Really call _dl_sysdep_start_cleanup after all
	calls to _dl_relocate_object.
2009-04-17 00:00:08 +00:00
Ulrich Drepper df77455c4b [BZ #9957]
2009-04-16  Ulrich Drepper  <drepper@redhat.com>
	[BZ #9957]
	* malloc/malloc.c (force_reg): Define.
	(sYSMALLOc): Load hook variable into variable
	before test and force into register.
	(sYSTRIm): Likewise.
	(public_mALLOc): Force hook value into register.
	(public_fREe): Likewise.
	(public_rEALLOc): Likewise.
	(public_mEMALIGn): Likewise.
	(public_vALLOc): Likewise.
	(public_pVALLOc): Likewise.
	(public_cALLOc): Likewise.
	(__posix_memalign): Likewise.
	* malloc/arena.c (ptmalloc_init): Load hook variable into variable
	before test and force into register.
	* malloc/hooks.c (top_check): Likewise.
	(public_s_ET_STATe): Pretty printing.

	* resolv/res_send.c (send_dg): Don't just ignore the result we got
	in case we only receive one reply in single-request mode.
2009-04-16 21:22:16 +00:00
Ulrich Drepper 74b3cf224e (send_dg): Don't just ignore the result we got in case we only receive one reply in single-request mode. 2009-04-16 20:29:33 +00:00
Jakub Jelinek 733ca93a45 * elf/dl-open.c (_dl_open): Bump GL(dl_nns) to 1 if no libraries
are dlopened in statically linked program even for __LM_ID_CALLER.
2009-04-16  Jakub Jelinek  <jakub@redhat.com>

	* elf/dl-open.c (_dl_open): Bump GL(dl_nns) to 1 if no libraries
	are dlopened in statically linked program even for __LM_ID_CALLER.
2009-04-16 15:22:05 +00:00
Ulrich Drepper d0e81f10e5 * resolv/res_send.c (send_dg): Don't switch into single-request
mode if we already are in it.
2009-04-16 14:29:34 +00:00
Ulrich Drepper e775ec11c4 * sysdeps/unix/sysv/linux/wordsize-64/fallocate.c: Likewise. 2009-04-15 17:10:28 +00:00
Ulrich Drepper 6a3d03ff58 * sysdeps/unix/sysv/linux/getsysstats.c (next_line): Make sure there
are always at least 4 bytes in the returned line.

2009-04-15  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Check
	__libc_use_alloca (8192), if the stack is too small use 512 bytes
	instead of 8K.  Stop searching in /proc/stat after hitting first
	line not starting with cpu.
	(next_line): Truncate too long
	lines at buffer size * 3/4 instead of pretending there were line
	breaks inside of large lines.
2009-04-15 15:57:47 +00:00
Ulrich Drepper ae650a41ef * sysdeps/x86_64/mp_clz_tab.c: New file. 2009-04-15 04:30:41 +00:00
Ulrich Drepper 353f210707 2009-03-17 Ryan S. Arnold <rsa@us.ibm.com>
Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/fallocate.c: Handle old kernel headers.
	* sysdeps/unix/sysv/linux/fallocate64.c: Likewise.
2009-04-15 00:39:57 +00:00
Ulrich Drepper fc0c57057e * sysdeps/sh/libc-tls.c: New file.
* sysdeps/sh/bits/setjmp.h (__jmp_buf): Give name to structure type.
2009-04-15 00:17:33 +00:00
Ulrich Drepper 27396822d7 __tls_get_addr for SH. 2009-04-15 00:16:11 +00:00
Roland McGrath 237a886716 * elf/elf.h: Add various missing ARM constants, to match binutils. 2009-04-15 00:16:02 +00:00
Roland McGrath ce4ae9230c 2009-04-14 Roland McGrath <roland@redhat.com>
* elf/elf.h: Add various missing ARM constants, to match binutils.
2009-04-15 00:15:54 +00:00
Ulrich Drepper 893a5fd440 Optimizations from GMP.
* sysdeps/x86_64/add_n.S: New file.
	* sysdeps/x86_64/addmul_1.S: New file.
	* sysdeps/x86_64/lshift.S: New file.
	* sysdeps/x86_64/mul_1.S: New file.
	* sysdeps/x86_64/rshift.S: New file.
	* sysdeps/x86_64/sub_n.S: New file.
	* sysdeps/x86_64/submul_1.S: New file.
2009-04-14 22:26:05 +00:00
Ulrich Drepper 7fd23f1f3b mpn_add_n for x86-64. 2009-04-14 22:24:59 +00:00
Jakub Jelinek e42e88abb6 * sysdeps/powerpc/powerpc32/elf/start.S: Ensure .data is non-empty.
* sysdeps/powerpc/powerpc64/elf/start.S: Likewise. 
* sysdeps/sparc/sparc32/elf/start.S: Likewise. 
* sysdeps/sparc/sparc64/elf/start.S: Likewise.
2009-04-14  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/powerpc/powerpc32/elf/start.S: Ensure .data is non-empty.
	* sysdeps/powerpc/powerpc64/elf/start.S: Likewise.
	* sysdeps/sparc/sparc32/elf/start.S: Likewise.
	* sysdeps/sparc/sparc64/elf/start.S: Likewise.
2009-04-14 20:57:18 +00:00
Ulrich Drepper b8a3bd8256 * sysdeps/unix/sysv/linux/kernel-features.h: SH also has
preadv/pwritev.
2009-04-14 18:31:03 +00:00
Ulrich Drepper 84aa52d7e9 * sysdeps/x86-64/strrchr.S: New file. 2009-04-14 05:58:16 +00:00
Ulrich Drepper 9d26efa90c * stdio-common/printf.h (struct printf_info): Add user element.
New types printf_arginfo_size_function, printf_va_arg_function.
	Declare register_printf_specifier, register_printf_modifier,
	register_printf_type.
	* stdio-common/printf-parse.h (struct printf_spec): Add size element.
	(union printf_arg): Add pa_user element.
	Adjust __printf_arginfo_table type.
	Add __printf_va_arg_table, __printf_modifier_table,
	__handle_registered_modifier_mb, and __handle_registered_modifier_wc
	declarations.
	* stdio-common/printf-parsemb.c: Recognize registered modifiers.
	If registered arginfo call failed try normal specifier.
	* stdio-common/printf-prs.c: Pass additional parameter to arginfo
	function.
	* stdio-common/Makefile (routines): Add reg-modifier and reg-type.
	* stdio-common/Versions: Export register_printf_modifier,
	register_printf_type, and register_printf_specifier for GLIBC_2.10.
	* stdio-common/reg-modifier.c: New file.
	* stdio-common/reg-type.c: New file.
	* stdio-common/reg-printf.c (__register_printf_specifier): New
	function.  Mostly the old __register_printf_function function but
	uses locking and type of third parameter changed.
	(__register_printf_function): Implement using
	__register_printf_specifier.
	* stdio-common/vfprintf.c (vfprintf): Collect argument sizes in
	calls to arginfo functions.  Allocate enough memory for user-defined
	types.  Call new va_arg functions to get user-defined types.
	Try installed handlers even for existing format specifiers first.
2009-04-11 05:34:20 +00:00
Ulrich Drepper f140a0d53d * sysdeps/x86_64/rawmemchr.S: New file. 2009-04-10 07:57:20 +00:00
Ulrich Drepper 1d498daa95 Simplified code and possible copy problem fixed. 2009-04-10 03:56:06 +00:00
Ulrich Drepper e9b4d069c1 * stdio-common/vfprintf.c (vfprintf): Slightly more compact code. 2009-04-10 02:51:29 +00:00
Ulrich Drepper 24030b0f78 function if it is not defined. Add some necessary casts. 2009-04-09 22:06:07 +00:00
Ulrich Drepper f9fe75e945 * sysdeps/unix/sysv/linux/preadv.c: Avoid prototype for static
function if it is not defined.
	* sysdeps/unix/sysv/linux/pwritev.c: Likewise.
2009-04-09 21:45:21 +00:00
Ulrich Drepper 28b2771a4b * sysdeps/unix/sysv/linux/kernel-features.h: SPARC and IA64 also
have preadv/pwritev in 2.6.30.
2009-04-09 18:52:57 +00:00
Ulrich Drepper bb06654506 * malloc/malloc.c (malloc_info): New function.
* malloc/malloc.h: Declare it.
	* malloc/Versions: Export malloc_info for GLIBC_2.10.

	* resolv/nss_dns/dns-host.c (getanswer_r): Use strcasecmp
2009-04-09 05:45:42 +00:00
Ulrich Drepper 0f9c8b4841 * sysdeps/unix/sysv/linux/preadv64.c (PREAD): Use __libc_pread64
to avoid PLT slot.
2009-04-08 19:24:34 +00:00
Ulrich Drepper 4c8b8cc332 * malloc/malloc.c (_int_realloc): Add parameter with old block
size.  Remove duplicated test.  Don't handle mmap'ed blocks here.
	Adjust all callers.
	* malloc/hooks.c (realloc_check): Adjust _int_realloc call.
2009-04-08 18:00:34 +00:00
Ulrich Drepper cd57745bd8 * sysdeps/x86_64/strchrnul.S: New file.
depending libcrypt on -lfreebl3.
2009-04-07 23:22:10 +00:00
Ulrich Drepper 3db6c9a8ed * crypt/Makefile (LDLIBS-crypt.so): Use this variable instead of
depending libcrypt in -lfreebl3.
2009-04-07 18:34:16 +00:00
Ulrich Drepper 1a2ec17ba6 * sysdeps/unix/sysv/linux/kernel-features.h: Power also has
preadv/pwritev in 2.6.30.
2009-04-07 17:38:50 +00:00
Ulrich Drepper c6807d38a1 * resolv/res_hconf.c (_res_hconf_trim_domain): Use strcasecmp
instead of __strcasecmp.
	* resolv/nss_dns/dns-host.c (getanswer_r): Likewise.
2009-04-07 16:13:15 +00:00
Ulrich Drepper 481f9ecae0 * wcsmbs/wcsatcliff.c (MEMCHR): Define. 2009-04-07 14:56:48 +00:00
Ulrich Drepper ddba0f1700 * string/stratcliff.c (do_test): Add memchr tests..
* sysdeps/x86_64/memchr.S: Fix handling of end of buffer after
	first read quad word.
2009-04-07 14:53:04 +00:00
Ulrich Drepper 4bcb2658ff * string/strverscmp.c (__strverscmp): Fix last cleanups.
* string/tst-svc.input: Add new test case.
	* string/tst-svc.expect: Adjust.
	* string/Makefile: Don't ignore tst-svc error.
2009-04-07 06:51:59 +00:00
Ulrich Drepper 322e23db24 * sysdeps/x86_64/memchr.S: New file. 2009-04-07 06:36:33 +00:00
Ulrich Drepper ae06191038 * resolv/resolv.h (RES_SNGLKUP): Define.
* resolv/res_init.c (res_setoptions): Recognize single-request option.
	* resolv/res_send.c (send_dg): If we sent two requests at once and
	only get one reply before timeout switch to mode where we send the
	second request only after the first answer has been received.
2009-04-07 02:00:27 +00:00
Ulrich Drepper 735be40014 * locales/ks_IN: New file.
Patch by Mohammad Nayeem <mohammad.nayeem@gmail.com> and
	Pravin Satpute <psatpute@redhat.com>.
2009-04-06 17:54:58 +00:00
Ulrich Drepper 1df6f9d808 * sysdeps/x86_64/strchr.S: Likewise. 2009-04-06 03:29:26 +00:00
Ulrich Drepper a152f366dc * sysdeps/x86_64/strlen.S: Optimize by using SSE2 instructions. 2009-04-05 18:49:28 +00:00
Ulrich Drepper c0bac8b05a * configure.in: We need to test for the compiler earlier. 2009-04-03 23:51:57 +00:00
Ulrich Drepper e109c6124f * misc/Makefile (routines): Add preadv, preadv64, pwritev, pwritev64.
* misc/Versions: Export preadv, preadv64, pwritev, pwritev64 for
	GLIBC_2.10.
	* misc/sys/uio.h: Declare preadv, preadv64, pwritev, pwritev64.
	* sysdeps/unix/sysv/linux/kernel-features.h: Add entries for preadv
	and pwritev.
	* misc/preadv.c: New file.
	* misc/preadv64.c: New file.
	* misc/pwritev.c: New file.
	* misc/pwritev64.c: New file.
	* sysdeps/posx/preadv.c: New file.
	* sysdeps/posx/preadv64.c: New file.
	* sysdeps/posx/pwritev.c: New file.
	* sysdeps/posx/pwritev64.c: New file.
	* sysdeps/unix/sysv/linux/preadv.c: New file.
	* sysdeps/unix/sysv/linux/preadv64.c: New file.
	* sysdeps/unix/sysv/linux/pwritev.c: New file.
	* sysdeps/unix/sysv/linux/pwritev64.c: New file.
	* sysdeps/unix/sysv/linux/wordsize-64/preadv64.c: New file.
	* sysdeps/unix/sysv/linux/wordsize-64/pwritev64.c: New file.
2009-04-03 19:57:16 +00:00
Ulrich Drepper 7166c77ad0 * sysdeps/unix/sysv/linux/readv.c (__libc_readv): Fix calling of
compatibility code.
	* sysdeps/unix/sysv/linux/writev.c (__libc_writev): Likewise.

2009-04-01  Ulrich Drepper  <drepper@redhat.com>
2009-04-03 18:50:34 +00:00
Ulrich Drepper 2dbe6afe7c * sysdeps/unix/sysv/linux/kernel-features.h: Define
__ASSUME_COMPLETE_READV_WRITEV.
	* sysdeps/unix/sysv/linux/readv.c: No need for userlevel fallback
	with modern kernels.
	* sysdeps/unix/sysv/linux/writev.c: Likewise.

	* sysdeps/posix/readv.c: Since read is a cancellation point we have
	to free a possible malloced buffer in case of cancellation.
	* sysdeps/posix/writev.c: Likewise for write.

c2009-04-01  Ulrich Drepper  <drepper@redhat.com>
2009-04-03 17:23:13 +00:00
Ulrich Drepper a065c0076a Add missing protocol numbers.
* sysdeps/unix/sysv/linux/bits/socket.h: Add missing protocol numbers.
2009-04-03 03:48:08 +00:00
Ulrich Drepper ff886b82a2 * configure.in: Recognize --enable-nss-crypt.
* config.make.in: Add nss-crypt entry.
	* crypt/Makefile: If nss-crypt==yes, don't build md5.c, sha256.c,
	sha512.c.  Don't run md5test, sha256test, sha512test.  Pass -DUSE_NSS
	and include path for NSS directory to compiler for md5-crypt,
	sha256-crypt, sha512-crypt.  Link libcrypt.so with -lfreebl3.
	* crypt/md5-crypt.c: If USE_NSS is defined, don't use local hash
	function implementation, use NSS.  Introduce wrappers around the
	hash function calls.  Little code size optimization.
	* crypt/sha256-crypt.c: Likewise.
	* crypt/sha512-crypt.c: Likewise.
	* scripts/check-local-headers.sh: Ignore nss3 directory.

	* configure.in: Rename pic_default to libc_cv_pic_default.
	* config.make.in: Likewise.
2009-04-02 17:00:46 +00:00
Ulrich Drepper 900d7961d4 Add nss-crypt entry. Rename pic_default to libc_cv_pic_default. 2009-04-02 16:59:01 +00:00
Roland McGrath 5ee3019c00 Missed copyright year update 2009-04-02 01:20:33 +00:00
Roland McGrath 1800de36a4 * elf/elf.h (R_SPARC_GLOB_JMP): New macro.
(R_SPARC_GOTDATA_HIX22, R_SPARC_GOTDATA_LOX10): New macros.
	(R_SPARC_GOTDATA_OP_HIX22, R_SPARC_GOTDATA_OP_LOX10): Likewise.
	(R_SPARC_GOTDATA_OP, R_SPARC_H34): Likewise.
	(R_SPARC_SIZE32, R_SPARC_SIZE64): Likewise.
	(R_SPARC_GNU_VTINHERIT, R_SPARC_GNU_VTENTRY, R_SPARC_REV32): Likewise.
	(R_SPARC_NUM): Update.
	From Dave Miller <davem@davemloft.net>.
2009-04-02 01:19:47 +00:00
Roland McGrath b38cf00fb4 2009-04-01 Roland McGrath <roland@redhat.com>
* elf/elf.h (R_SPARC_GLOB_JMP): New macro.
	(R_SPARC_GOTDATA_HIX22, R_SPARC_GOTDATA_LOX10): New macros.
	(R_SPARC_GOTDATA_OP_HIX22, R_SPARC_GOTDATA_OP_LOX10): Likewise.
	(R_SPARC_GOTDATA_OP, R_SPARC_H34): Likewise.
	(R_SPARC_SIZE32, R_SPARC_SIZE64): Likewise.
	(R_SPARC_GNU_VTINHERIT, R_SPARC_GNU_VTENTRY, R_SPARC_REV32): Likewise.
	(R_SPARC_NUM): Update.
	From Dave Miller <davem@davemloft.net>.
2009-04-02 01:19:33 +00:00
Ulrich Drepper 3ce976cd88 * sysdeps/unix/sysv/linux/sys/eventfd.h (EFD_SEMAPHORE): Define. 2009-04-01 19:25:51 +00:00
Ulrich Drepper 22c8319345 * elf/dl-open.c: Keep track of used name spaces and only iterate over
those which are used.
	* elf/dl-addr.c: Likewise.
	* elf/dl-caller.c: Likewise.
	* elf/dl-fini.c: Likewise.
	* elf/dl-iteratephdr.c: Likewise.
	* elf/dl-libc.c: Likewise.
	* elf/dl-load.c: Likewise.
	* elf/dl-support.c: Likewise.
	* elf/dl-sym.c: Likewise.
	* elf/rtld.c: Likewise.
	* sysdeps/generic/ldsodefs.h: Likewise.
2009-04-01 00:26:36 +00:00
Ulrich Drepper 20739e5454 * elf/dl-load.c: Remove support for systems without MAP_ANON.
* elf/dl-minimal.c: Likewise.
	* elf/dl-misc.c: Likewise.
	* elf/rtld.c: Likewise.
	* sysdeps/generic/ldsodefs.h: Likewise.
2009-03-31 22:03:24 +00:00
Ulrich Drepper cb14424eb9 * elf/do-lookup.h (do_lookup_x): Minor optimization and cleanup.
Avoid reuse of complex expression.
2009-03-30 21:14:32 +00:00
Ulrich Drepper db486995b6 * po/fr.po: Update from translation team. 2009-03-30 12:39:02 +00:00
Ulrich Drepper e9977bc8e4 Update from translation team. 2009-03-30 12:38:40 +00:00
Jakub Jelinek 1b188a651e [BZ #9985]
* charmaps/UTF-8: Fix encoding of <U1080>..<U109F>, <U12AF>. 
Based on patch by Keith Stribley <devel@thanlwinsoft.org>.
2009-03-23  Jakub Jelinek  <jakub@redhat.com>

	[BZ #9985]
	* charmaps/UTF-8: Fix encoding of <U1080>..<U109F>, <U12AF>.
	Based on patch by Keith Stribley <devel@thanlwinsoft.org>.
2009-03-23 11:49:01 +00:00
Roland McGrath e4bac65728 * td_symbol_list.c (DB_LOOKUP_NAME, DB_LOOKUP_NAME_TH_UNIQUE):
Use STRINGIFY macro in place of #argument.
2009-03-19 19:51:50 +00:00
Roland McGrath 665b0c300c 2009-03-19 Roland McGrath <roland@redhat.com>
* td_symbol_list.c (DB_LOOKUP_NAME, DB_LOOKUP_NAME_TH_UNIQUE):
	Use STRINGIFY macro in place of #argument.
2009-03-19 19:51:42 +00:00
Ulrich Drepper 3fb8a93ae9 Yet more changes to match sort function type change. 2009-03-17 00:35:38 +00:00
Ulrich Drepper ae8d7b4477 * include/dirent.h: Yet more changes to match sort function type
change.
	* sysdeps/unix/sysv/linux/i386/alphasort64.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/olddirent.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/versionsort64.c: Likewise.
2009-03-17 00:35:19 +00:00
Ulrich Drepper 8efb2f1ca0 * dirent/scandir64.c (scandir64): Adjust declaration to type change. 2009-03-16 22:37:22 +00:00
Ulrich Drepper d9822dbe66 * nscd/connections.c (restart): Try to preserve the process name
by reading the /proc/self/exe symlink and using the return name.
	Patch by Jeff Bastian <jbastian@redhat.com>.
2009-03-16 22:33:01 +00:00
Ulrich Drepper 2ca285b098 [BZ #9733]
* elf/dl-load.c (_dl_map_object_from_fd): Only call audit hooks
	if we are not loading a new audit library.
	* elf/dl-reloc (_dl_relocate_object): Third parameter is now a bitmask.
	Only use profiling trampoline for auditing if we are not relocating
	an audit library.
	* elf/dl-open.c (dl_open_worker): Adjust _dl_relocate_object call.
	* elf/rtld.c: Likewise.
	* sysdeps/generic/ldsodefs.h: Adjust _dl_relocate_object prototype.
2009-03-16 02:16:30 +00:00
Ulrich Drepper 7e34260365 * elf/rtld.c (dl_main): Extend help message for --audit option. 2009-03-16 00:12:20 +00:00
Ulrich Drepper eee6b14327 [BZ #9759]
* dirent/dirent.h: Adjust prototypes of scandir, scandir64, alphasort,
	alphasort64, versionsort, and versionsort64 to POSIX 2008.
	* dirent/alphasort.c: Adjust implementation to type change.
	* dirent/alphasort64.c: Likewise.
	* dirent/scandir.c: Likewise.
	* dirent/versionsort.c: Likewise.
	* dirent/versionsort64.c: Likewise.
	* sysdeps/wordsize-64/alphasort.c: Add hack to hide alphasort64
	declaration.
	* sysdeps/wordsize-64/versionsort.c: Add hack to hide versionsort64
	declaration.
2009-03-15 21:33:19 +00:00
Ulrich Drepper cd2d01faa5 [BZ #9880]
* inet/inet6_rth.c (inet6_rth_reverse): Compute number of segments
	correctly.  Set segleft member in output as required.
	Patch partly by Yang Hongyang <yanghy@cn.fujitsu.com>.
	* inet/tst-inet6_rth.c (do_test): Add tests for inet6_rth_reverse.
2009-03-15 20:35:02 +00:00
Ulrich Drepper 906dd40db3 [BZ #9881]
* inet/inet6_rth.c (inet6_rth_add): Add some error checking.
	Patch mostly by Yang Hongyang <yanghy@cn.fujitsu.com>.
	* inet/Makefile (tests): Add tst-inet6_rth.
	* inet/tst-inet6_rth.c: New file.

	alignment of La_x86_64_regs.  Store xmm parameters.
2009-03-15 19:16:16 +00:00
Ulrich Drepper 71a5bd3e17 [BZ #5807]
2009-03-15  Ulrich Drepper  <drepper@redhat.com>
	[BZ #5807]
	* string/strlen.c (strlen): Fix omission in the expression to test
	for NUL bytes.
2009-03-15 09:03:38 +00:00
Ulrich Drepper fad070abc4 * crypt/sha256test.c (main): Perform 100,000 'a' test in a second way. 2009-03-15 01:45:47 +00:00
Ulrich Drepper a42ad61bae * elf/dl-runtime.c (reloc_offset): Define.
(reloc_index): Define.
	(_dl_fixup): Rename reloc_offset parameter to reloc_arg.
	(_dl_fixup_profile): Likewise.  Use reloc_index instead of
	computing index from reloc_offset.
	(_dl_call_pltexit): Likewise.
	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve): Just pass
	the relocation index to _dl_fixup.
	(_dl_runtime_profile): Likewise for _dl_fixup_profile and
	_dl_call_pltexit.
	* sysdeps/x86_64/dl-runtime.c: New file.
2009-03-15 00:26:14 +00:00
Ulrich Drepper 1f7c90a722 [BZ #9893]
* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix
	alignement of La_x86_64_regs.  Store xmm parameters.
	Patch mostly by Jiri Olsa <olsajiri@gmail.com>.
2009-03-14 23:57:33 +00:00
Ulrich Drepper 4546646233 [BZ #9913]
* string/strverscmp.c (__strverscmp): Fix case of different digits
	in fractional part of string.
	Patch by Jingyu Liu <jyliu@fortinet.com>.
	* string/Makefile (tests): Add tst-svc2.
	* string/tst-svc2.c: New file.

	* string/strverscmp.c (__strverscmp): Optimize size of tables.
2009-03-14 20:15:21 +00:00
Ulrich Drepper 878b72c5ee [BZ #9948]
2009-03-14  Ulrich Drepper  <drepper@redhat.com>
	* locale/iso-639.def: Add Min Nan.

	[BZ #9948]
2009-03-14 18:39:26 +00:00
Ulrich Drepper f53713a8e7 * elf/dl-sysdep.c (_dl_show_auxv): Add support for AT_BASE_PLATFORM.
* elf/dl-sysdep.c (auxvars): Compress data structure.
2009-03-14 18:33:58 +00:00
Ulrich Drepper f81ce2888d * sysdeps/i386/dl-machine.h (elf_machine_rel): Implement
STT_GNU_IFUNC handling.
	(elf_machine_rela): Likewise.
2009-03-14 15:54:49 +00:00
Ulrich Drepper 425ce2edb9 * config.h.in (USE_MULTIARCH): Define.
* configure.in: Handle --enable-multi-arch.
	* elf/dl-runtime.c (_dl_fixup): Handle STT_GNU_IFUNC.
	(_dl_fixup_profile): Likewise.
	* elf/do-lookup.c (dl_lookup_x): Likewise.
	* sysdeps/x86_64/dl-machine.h: Handle STT_GNU_IFUNC.
	* elf/elf.h (STT_GNU_IFUNC): Define.
	* include/libc-symbols.h (libc_ifunc): Define.
	* sysdeps/x86_64/cacheinfo.c: If USE_MULTIARCH is defined, use the
	framework in init-arch.h to get CPUID values.
	* sysdeps/x86_64/multiarch/Makefile: New file.
	* sysdeps/x86_64/multiarch/init-arch.c: New file.
	* sysdeps/x86_64/multiarch/init-arch.h: New file.
	* sysdeps/x86_64/multiarch/sched_cpucount.c: New file.

	* config.make.in (experimental-malloc): Define.
	* configure.in: Handle --enable-experimental-malloc.
	* malloc/Makefile: Handle experimental-malloc flag.
	* malloc/malloc.c: Implement PER_THREAD and ATOMIC_FASTBINS features.
	* malloc/arena.c: Likewise.
	* malloc/hooks.c: Likewise.
	* malloc/malloc.h: Define M_ARENA_TEST and M_ARENA_MAX.
2009-03-13 23:53:18 +00:00
Ulrich Drepper e7f110cdbd * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Add branch
prediction.  A few size optimizations.
2009-03-12 06:31:25 +00:00
Ulrich Drepper 30991b8bd9 * init.c (nptl_freeres): Compile only for SHARED. 2009-03-10 22:03:24 +00:00
Ulrich Drepper bd82a24718 * time/tzset.c: Optimize a bit for size. 2009-03-10 17:00:17 +00:00
Ulrich Drepper a99e59d771 * include/stdio.h (fmemopen): Add libc_hidden_proto.
* libio/fmemopen.c (fmemopen): Add libc_hidden_def.

	* elf/sprof.c: Avoid warning about multi-line comment.
2009-03-10 15:26:57 +00:00
Ulrich Drepper 686f8c9daf * time/tzset.c (__tzset_parse_tz): Use correct string when parsing
DST name.
	* time/tst-posixtz.c: Add tests for quoted timezone names.
2009-03-10 15:23:46 +00:00
Ulrich Drepper 7db0cc4245 * posix/unistd.h (_POSIX_VERSION, _POSIX2_VERSION, _POSIX2_C_BIND,
_POSIX2_C_DEV, _POSIX2_SW_DEV, _POSIX2_LOCALEDEF): Define to
	200809L instead of 200112L.
	(_XOPEN_VERSION): For __USE_XOPEN2K8 define to 700.
	* posix/tst-sysconf.c (STDVER): Define to 200809L instead of 200112L.

2009-03-10  Jakub Jelinek  <jakub@redhat.com>
2009-03-10 13:45:44 +00:00
Ulrich Drepper eec4b45482 * stdlib/quick_exit.c (quick_exit): Pass &__quick_exit_funcs
instead of __quick_exit_funcs to __run_exit_handlers.
	* stdlib/at_quick_exit.c (at_quick_exit): Add attribute_hidden.
	* stdlib/exit.h (__run_exit_handlers): Add noreturn attribute.
	(__cxa_at_quick_exit): Remove attribute_hidden.
	* stdlib/exit.c (exit): Pass &__exit_funcs instead of __exit_funcs
	to __run_exit_handlers.
	* stdlib/cxa_at_quick_exit.c (__cxa_at_quick_exit): Remove
	attribute_hidden.
2009-03-10 13:40:37 +00:00
Ulrich Drepper d7276cee74 * po/id.po: Update from translation team. 2009-03-10 13:29:50 +00:00
Ulrich Drepper 1454da2195 * sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S: Use
.machine push; .machine "power6" and .machine pop around mtfsf
	insns outside of _ARCH_PWR6 define.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S:
	Likewise.
	* sysdeps/powerpc/fpu/tst-setcontext-fpscr.c (_SET_DI_FPSCR): Likewise.
	* sysdeps/powerpc/fpu/fenv_libc.h (fesetenv_register,
	relax_fenv_state): Likewise.
2009-03-10 04:47:30 +00:00
Ulrich Drepper bddec78c7b Use .machine push; .machine "power6" and .machine pop around mtfsf insns outside of _ARCH_PWR6 define. 2009-03-10 04:46:08 +00:00
318 changed files with 18451 additions and 11099 deletions
+863
View File
@@ -1,3 +1,866 @@
2009-05-10 Ulrich Drepper <drepper@redhat.com>
* version.h (VERSION): Bump to 2.10.1.
* nss/getXXbyYY_r.c: If NO_COMPAT_NEEDED is defined don't define any
compatibility functions.
* nss/getXXent_r.c: Likewise.
* gshadow/getsgent_r.c: Define NO_COMPAT_NEEDED.
* gshadow/getsgnam_r.c: Likewise.
* gshadow/Version: Remove duplicate entries.
* sysdeps/x86_64/cacheinfo.c (intel_02_cache_info): Add missing entries
for recent processor.
* sysdeps/unix/sysv/linux/i386/sysconf.c (intel_02_cache_info):
Likewise.
2009-05-09 Ulrich Drepper <drepper@redhat.com>
* version.h (VERSION): Bump for 2.10 release.
* include/features.h (__GLIBC_MINOR__): Bump to 10.
* Makeconfig: Undo last change. Add asflags-cpu to ASFLAGS in the
same place we add ASFLAGS-config.
2009-05-05 Aurelien Jarno <aurelien@aurel32.net>
[BZ #10128]
* resolv/res_query.c (__libc_res_nquery): If one query returns NOTIMP
or FORMERR and the other NOERROR, don't raise an error.
2009-05-06 Ryan S. Arnold <rsa@us.ibm.com>
[BZ #10118]
* Makeconfig (+asflags): New variable based upon ASFLAG or
asflags-cpu.
(ASFLAGS): Add override to set ASFLAGS to +asflags.
* config.make.in (asflags-cpu): Add variable based upon
@libc_cv_cc_submachine@ to propagate -mcpu=CPU from --with-cpu=CPU to
the assembler.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/setcontext.S:
Remove unneeded file now that the assembler emits _ARCH_PWR6 and
recognizes power6 instruction set due to passing -mcpu=power6 from
--with-cpu=power6 when compiling .S files.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/swapcontext.S:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/setcontext.S:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/swapcontext.S:
Likewise.
2009-05-09 Jakub Jelinek <jakub@redhat.com>
* string/stratcliff.c (do_test): Test for zero length
STRNLEN, MEMCHR, STRNCPY, STPNCPY, MEMCPY, MEMPCPY and memccpy
at the end of the page.
2009-05-08 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/kernel-features.h: Define __ASSUME_AT_RANDOM.
* sysdeps/x86_64/memchr.S: Handle invalid buffer pointers when
count is zero.
* po/da.po: Update from translation team.
2009-05-05 Jakub Jelinek <jakub@redhat.com>
* io/sys/stat.h (fstatat64): Guard prototype with __USE_LARGEFILE64,
guard __extern_inline wrapper with __USE_ATFILE instead of __USE_GNU.
2009-05-05 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/sys/personality.h: Add ADDR_COMPAT_LAYOUT
and READ_IMPLIES_EXEC.
2009-05-04 Ulrich Drepper <drepper@redhat.com>
* po/da.po: Update from translation team.
2009-04-29 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/ifaddrs.c: Revert unintended 2008-08-12
comment change.
2009-04-27 Jakub Jelinek <jakub@redhat.com>
* locale/programs/locarchive.c (create_archive): Add MAP_PRIVATE
to MAP_ANON in PROT_NONE mmap64 call.
(open_archive): Likewise.
(file_data_available_p): Use mmap64 instead of mremap.
(enlarge_archive): Likewise. Update head if ah->addr changed.
Attempt to reserve address space after mmap64 region.
2009-04-26 Ulrich Drepper <drepper@redhat.com>
* sysdeps/ieee754/dbl-64/s_expm1.c: Set errno for overflow.
* sysdeps/ieee754/flt-32/s_expm1f.c: Likewise.
* sysdeps/x86_64/fpu/s_expm1l.S: Likewise.
* sysdeps/ieee754/k_standard.c (__kernel_standard): Pole errors in
atanh should set ERANGE.
[BZ #10087]
* elf/dl-runtime.c (_dl_fixup): Use DL_FIXUP_VALUE_ADDR to access
result of lookup to make call to implement STT_GNU_IFUNC.
(_dl_profile_fixup): Likewise.
Patch by H.J. Lu <hjl.tools@gmail.com>.
* nscd/connections.c (send_ro_fd): Define temporary variable to avoid
warning.
* sysdeps/unix/sysv/linux/dl-osinfo.h (dl_fatal): Remove inline
from definition.
* sysdeps/x86_64/dl-machine.h (elf_machine_rela): Don't define
label if it is not used.
* elf/dl-profile.c (_dl_start_profile): Define real-type variant
of gmon_hist_hdr and gmon_hdr structures and use them.
* elf/sprof.c: Likewise.
* elf/dl-load.c (open_verify): Add temporary variable to avoid
warning.
* nscd/nscd_helper.c (get_mapping): Avoid casts to avoid warnings.
* sunrpc/clnt_raw.c (clntraw_private_s): Use union in definition
to avoid cast.
* inet/rexec.c (rexec_af): Make sa2 a union to avoid warnings.
* inet/rcmd.c (rcmd_af): Make from a union of the various needed types
to avoid warnings.
(iruserok_af): Use ss_family instead of casts.
* gmon/gmon.c (write_hist): Define real-type variant of
gmon_hist_hdr structure and use it.
(write_gmon): Likewise for gmon_hdr.
* sysdeps/unix/sysv/linux/readv.c: Avoid declaration of replacement
function if we are not going to define it.
* sysdeps/unix/sysv/linux/writev.c: Likewise.
* inet/inet6_option.c (option_alloc): Add temporary variable to
avoid warning.
* libio/strfile.h (struct _IO_streambuf): Use correct type and
name of VTable element.
* libio/iovsprintf.c: Avoid casts to avoid warnings.
* libio/iovsscanf.c: Likewise.
* libio/vasprintf.c: Likewise.
* libio/vsnprintf.c: Likewise.
* stdio-common/isoc99_vsscanf.c: Likewise.
* stdlib/strfmon_l.c: Likewise.
* debug/vasprintf_chk.c: Likewise.
* debug/vsnprintf_chk.c: Likewise.
* debug/vsprintf_chk.c: Likewise.
* nss/nsswitch.c (__nss_lookup_function): En/Decrypt cached
function pointers.
2009-04-26 Jakub Jelinek <jakub@redhat.com>
* sysdeps/ieee754/dbl-64/s_tan.c (tan): Fix -Wsequence-point warnings.
2009-04-25 Ulrich Drepper <drepper@redhat.com>
* posix/bits/posix1_lim.h: Cleanup namespace a bit.
* sysdeps/i386/fpu/s_tan.S: Set errno for ±Inf.
* sysdeps/i386/fpu/s_tanf.S: Likewise.
* sysdeps/i386/fpu/s_tanl.S: Likewise.
* sysdeps/ieee754/dbl-64/s_tan.c: Likewise.
* sysdeps/ieee754/flt-32/s_tanf.c: Likewise.
* sysdeps/x86_64/fpu/s_tanl.S: Likewise.
* math/libm-test.inc: Add tests for errno after tan calls with
±Inf.
* sysdeps/ieee754/k_standard.c (__kernel_standard): Use correct
errno value vor pow(+-0,neg).
* math/libm-test.inc (pow_test): Add tests for errno value for
pole errors.
* math/w_fmod.c: Also handle x=±Inf as error.
* math/w_fmodf.c: Likewise.
* math/w_fmodl.c: Likewise.
* math/libm-test.inc (fmod_test): Add tests for errno after calls for
x=±Inf or y=0.
* sysdeps/i386/fpu/s_cos.S: Set errno for ±Inf.
* sysdeps/i386/fpu/s_cosf.S: Likewise.
* sysdeps/i386/fpu/s_cosl.S: Likewise.
* sysdeps/i386/fpu/s_sin.S: Likewise.
* sysdeps/i386/fpu/s_sinf.S: Likewise.
* sysdeps/i386/fpu/s_sinl.S: Likewise.
* sysdeps/ieee754/dbl-64/s_sin.c: Likewise.
* sysdeps/ieee754/flt-32/s_cosf.c: Likewise.
* sysdeps/ieee754/flt-32/s_sinf.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_cosl.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_sinl.c: Likewise.
* sysdeps/x86_64/fpu/s_cosl.S: Likewise.
* sysdeps/x86_64/fpu/s_sinl.S: Likewise.
* math/libm-test.inc: Add tests for errno after sin/cos calls with
±Inf.
* stdlib/strtod_l.c (round_and_return): We have to set errno to
ERANGE for underflows.
* stdlib/tst-strtod.c (tests): Two tests should set errno to ERANGE.
* stdio-common/stdio_lim.h.in (L_cuserid): Not part of POSIX since
the 2001 revision.
* libio/tst-widetext.input: Remove surrogates.
* include/features.h: _POSIX_C_SOURCE >= 200112L implies C99.
* sysdeps/ieee754/k_standard.c (__kernel_standard): Pole errors
for lgamma should set errno to ERANGE, not EDOM.
* math/libm-test.inc (lgamma_test): Check errno for pole errors.
2009-04-24 Ulrich Drepper <drepper@redhat.com>
[BZ #10093]
* iconv/gconv_simple.c (BODY for UTF-8 to INTERNAL): Don't accept
UTF-16 surrogates.
* locale/programs/locarchive.c (enlarge_archive): Conserve address
space when temporarily mapping the whole content of the old file.
[BZ #10100]
* misc/hsearch_r.c (hsearch_r): Add back ensurance that hval is
not zero.
2009-04-24 Jakub Jelinek <jakub@redhat.com>
* iconvdata/sjis.c (BODY): Don't advance inptr before
STANDARD_FROM_LOOP_ERR_HANDLER (2) for 2 byte invalid input.
Use STANDARD_FROM_LOOP_ERR_HANDLER with 2 instead of 1 for
two byte chars.
2009-04-24 Ulrich Drepper <drepper@redhat.com>
* locale/locarchive.h (struct locarhandle): Rename len field to
mmaped and add new reserved field.
* locale/programs/locarchive.c (RESERVE_MMAP_SIZE): Define.
(create_archive): Reserve address space and then map file into it.
(open_archive): Likewise.
(file_data_available_p): New function.
(compare_from_file): New function.
(close_archive): Adjust to member name changes.
(add_locale): Before comparing locale data, check it is mapped.
Otherwise fall back to reading from the file.
2009-04-23 H.J. Lu <hongjiu.lu@intel.com>
* stdio-common/psiginfo.c: Include <errno.h>.
2009-04-23 Ulrich Drepper <drepper@redhat.com>
[BZ #9920]
* stdlib/random_r.c (__srandom_r): Change type of word to int32_t
to get consistency between 32 and 64 bit architectures.
[BZ #10052]
* sysdeps/unix/make-syscalls.sh: Add rule to create target
directory for dummy syscall rules.
Patch by Chris Steinbroner <hesh@pobox.com>.
2009-04-23 Aurelien Jarno <aurelien@aurel32.net>
[BZ #10092]
* sysdeps/unix/sysv/linux/sys/mount.h: Define MNT_DETACH and
MNT_EXPIRE.
2009-04-23 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/preadv.c: The kernel API changed. Adjust.
* sysdeps/unix/sysv/linux/pwritev.c: Likewise.
2009-04-23 Jakub Jelinek <jakub@redhat.com>
* sysdeps/posix/pwritev.c (PWRITEV): Fix up comment. Copy
data from vector to temporary buffer and call PWRITEV after it
instead of vice versa.
* sysdeps/posix/preadv.c: Fix up comment.
* misc/preadv.c: Likewise.
* misc/preadv64.c: Likewise.
* misc/pwritev.c: Likewise.
* misc/pwritev64.c: Likewise.
* misc/sys/uio.h (preadv, pwritev, preadv64, pwritev64): Likewise.
2009-04-23 Ulrich Drepper <drepper@redhat.com>
* shadow/sgetspent_r.c (__sgetspent_r): Recognize too small buffers.
* shadow/Makefile (tests): Add tst-shadow.
* shadow/tst-shadow.c: New file.
[BZ #9955]
* gshadow/Makefile: New file.
* gshadow/Versions: New file.
* gshadow/fgetsgent.c: New file.
* gshadow/fgetsgent_r.c: New file.
* gshadow/getsgent.c: New file.
* gshadow/getsgent_r.c: New file.
* gshadow/getsgnam.c: New file.
* gshadow/getsgnam_r.c: New file.
* gshadow/gshadow.h: New file.
* gshadow/putsgent.c: New file.
* gshadow/sgetsgent.c: New file.
* gshadow/sgetsgent_r.c: New file.
* gshadow/tst-gshadow.c: New file.
* include/gshadow.h: New file.
* Makeconfig (all-subdirs): Add gshadow.
* Makefile (installed-headers): Add gshadow/gshadow.h.
* nss/Makefile (databases): Add sgrp.
* nss/Versions: Add gshadow functions as private exports.
* nss/nsswitch.conf: Add gshadow entry.
* nss/sgrp-lookup.c: New file.
* nss/nss_files/files-parse.c: Add STRING_LIST macro. Rewrite
parse_list to handle STRING_LIST and TRAILING_LIST_PARSER.
* nss/nss_files/files-sgrp.c: New file.
* sysdeps/generic/paths.h: Add _PATH_GSHADOW.
* sysdeps/unix/sysv/linux/paths.h: Likewise.
2009-04-22 Ulrich Drepper <drepper@redhat.com>
* stdio-common/printf.h: Add missing const to register_printf_modifier.
* stdio-common/reg-modifier.c: Likewise.
2009-04-22 Andrew Stubbs <ams@codesourcery.com>
* sysdeps/sh/sh4/setjmp.S (__sigsetjmp): Adjust JB_SIZE when there
is no FPU.
2009-04-20 Ulrich Drepper <drepper@redhat.com>
[BZ #10086]
* sysdeps/unix/sysv/linux/sys/timex.h: Add definitions from kernel
headers up to 2.6.30.
* po/ca.po: Update from translation team.
2009-04-19 Ulrich Drepper <drepper@redhat.com>
[BZ #10069]
* elf/dl-open.c (dl_open_worker): We cannot guarantee that we can load
an object that uses static TLS if the TLS modid is higher than the
reserve we always allocate. At least for multi-threaded code.
2009-04-18 Ulrich Drepper <drepper@redhat.com>
* stdlib/strfmon_l.c (__vstrfmon_l): Don't wrap when computing width.
Numerically stable check for valid width.
* locale/programs/locarchive.c (open_archive): Map the entire file
and not just the administrative data.
(add_locale): When we find a hash sum match compare the content
to be sure.
* malloc/malloc.c (malloc_info): Output address space information.
2009-04-17 Ulrich Drepper <drepper@redhat.com>
* malloc/malloc.c (malloc_info): Also output system memory information.
* sysdeps/unix/sysv/linux/kernel-features.h: All supported
architectures have preadv/pwritev in 2.6.30.
* sysdeps/posix/preadv.c: Reading of zero bytes is no error.
* sysdeps/posix/readv.c: Likewise.
Reported by Markus Armbruster <armbru@redhat.com>.
* malloc/hooks.c (top_check): Force hook value into register.
2009-04-16 Samuel Thibault <samuel.thibault@ens-lyon.org>
* elf/rtld.c (dl_main): Really call _dl_sysdep_start_cleanup after all
calls to _dl_relocate_object.
2009-04-16 Ulrich Drepper <drepper@redhat.com>
[BZ #9957]
* malloc/malloc.c (force_reg): Define.
(sYSMALLOc): Load hook variable into variable
before test and force into register.
(sYSTRIm): Likewise.
(public_mALLOc): Force hook value into register.
(public_fREe): Likewise.
(public_rEALLOc): Likewise.
(public_mEMALIGn): Likewise.
(public_vALLOc): Likewise.
(public_pVALLOc): Likewise.
(public_cALLOc): Likewise.
(__posix_memalign): Likewise.
* malloc/arena.c (ptmalloc_init): Load hook variable into variable
before test and force into register.
* malloc/hooks.c (top_check): Likewise.
(public_sET_STATe): Pretty printing.
* resolv/res_send.c (send_dg): Don't just ignore the result we got
in case we only receive one reply in single-request mode.
2009-04-16 Jakub Jelinek <jakub@redhat.com>
* elf/dl-open.c (_dl_open): Bump GL(dl_nns) to 1 if no libraries
are dlopened in statically linked program even for __LM_ID_CALLER.
2009-04-16 Ulrich Drepper <drepper@redhat.com>
* resolv/res_send.c (send_dg): Don't switch into single-request
mode if we already are in it.
2009-04-15 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/getsysstats.c (next_line): Make sure there
are always at least 4 bytes in the returned line.
2009-04-15 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Check
__libc_use_alloca (8192), if the stack is too small use 512 bytes
instead of 8K. Stop searching in /proc/stat after hitting first
line not starting with cpu.
(next_line): Truncate too long
lines at buffer size * 3/4 instead of pretending there were line
breaks inside of large lines.
2009-04-14 Ulrich Drepper <drepper@redhat.com>
* sysdeps/x86_64/mp_clz_tab.c: New file.
2009-03-17 Ryan S. Arnold <rsa@us.ibm.com>
Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/fallocate.c: Handle old kernel headers.
* sysdeps/unix/sysv/linux/fallocate64.c: Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/fallocate.c: Likewise.
2009-03-25 Andrew Stubbs <ams@codesourcery.com>
* sysdeps/sh/libc-tls.c: New file.
* sysdeps/sh/bits/setjmp.h (__jmp_buf): Give name to structure type.
2009-04-14 Roland McGrath <roland@redhat.com>
* elf/elf.h: Add various missing ARM constants, to match binutils.
2009-04-14 Ulrich Drepper <drepper@redhat.com>
Optimizations from GMP.
* sysdeps/x86_64/add_n.S: New file.
* sysdeps/x86_64/addmul_1.S: New file.
* sysdeps/x86_64/lshift.S: New file.
* sysdeps/x86_64/mul_1.S: New file.
* sysdeps/x86_64/rshift.S: New file.
* sysdeps/x86_64/sub_n.S: New file.
* sysdeps/x86_64/submul_1.S: New file.
2009-04-14 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc32/elf/start.S: Ensure .data is non-empty.
* sysdeps/powerpc/powerpc64/elf/start.S: Likewise.
* sysdeps/sparc/sparc32/elf/start.S: Likewise.
* sysdeps/sparc/sparc64/elf/start.S: Likewise.
2009-04-14 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/kernel-features.h: SH also has
preadv/pwritev.
2009-04-13 Ulrich Drepper <drepper@redhat.com>
* sysdeps/x86-64/strrchr.S: New file.
2009-04-10 Ulrich Drepper <drepper@redhat.com>
* stdio-common/printf.h (struct printf_info): Add user element.
New types printf_arginfo_size_function, printf_va_arg_function.
Declare register_printf_specifier, register_printf_modifier,
register_printf_type.
* stdio-common/printf-parse.h (struct printf_spec): Add size element.
(union printf_arg): Add pa_user element.
Adjust __printf_arginfo_table type.
Add __printf_va_arg_table, __printf_modifier_table,
__handle_registered_modifier_mb, and __handle_registered_modifier_wc
declarations.
* stdio-common/printf-parsemb.c: Recognize registered modifiers.
If registered arginfo call failed try normal specifier.
* stdio-common/printf-prs.c: Pass additional parameter to arginfo
function.
* stdio-common/Makefile (routines): Add reg-modifier and reg-type.
* stdio-common/Versions: Export register_printf_modifier,
register_printf_type, and register_printf_specifier for GLIBC_2.10.
* stdio-common/reg-modifier.c: New file.
* stdio-common/reg-type.c: New file.
* stdio-common/reg-printf.c (__register_printf_specifier): New
function. Mostly the old __register_printf_function function but
uses locking and type of third parameter changed.
(__register_printf_function): Implement using
__register_printf_specifier.
* stdio-common/vfprintf.c (vfprintf): Collect argument sizes in
calls to arginfo functions. Allocate enough memory for user-defined
types. Call new va_arg functions to get user-defined types.
Try installed handlers even for existing format specifiers first.
2009-04-09 Ulrich Drepper <drepper@redhat.com>
* sysdeps/x86_64/rawmemchr.S: New file.
* stdio-common/vfprintf.c (vfprintf): Slightly more compact code.
Simplified code and possible copy problem fixed.
* sysdeps/unix/sysv/linux/preadv.c: Avoid prototype for static
function if it is not defined. Add some necessary casts.
* sysdeps/unix/sysv/linux/pwritev.c: Likewise.
* sysdeps/unix/sysv/linux/kernel-features.h: SPARC and IA64 also
have preadv/pwritev in 2.6.30.
2009-04-08 Ulrich Drepper <drepper@redhat.com>
* malloc/malloc.c (malloc_info): New function.
* malloc/malloc.h: Declare it.
* malloc/Versions: Export malloc_info for GLIBC_2.10.
* sysdeps/unix/sysv/linux/preadv64.c (PREAD): Use __libc_pread64
to avoid PLT slot.
* malloc/malloc.c (_int_realloc): Add parameter with old block
size. Remove duplicated test. Don't handle mmap'ed blocks here.
Adjust all callers.
* malloc/hooks.c (realloc_check): Adjust _int_realloc call.
2009-04-07 Ulrich Drepper <drepper@redhat.com>
* sysdeps/x86_64/strchrnul.S: New file.
* crypt/Makefile (LDLIBS-crypt.so): Use this variable instead of
depending libcrypt on -lfreebl3.
* sysdeps/unix/sysv/linux/kernel-features.h: Power also has
preadv/pwritev in 2.6.30.
* resolv/nss_dns/dns-host.c (getanswer_r): Use strcasecmp
instead of __strcasecmp.
* string/stratcliff.c (do_test): Add memchr tests..
* wcsmbs/wcsatcliff.c (MEMCHR): Define.
* sysdeps/x86_64/memchr.S: Fix handling of end of buffer after
first read quad word.
2009-04-06 Ulrich Drepper <drepper@redhat.com>
* string/strverscmp.c (__strverscmp): Fix last cleanups.
* string/tst-svc.input: Add new test case.
* string/tst-svc.expect: Adjust.
* string/Makefile: Don't ignore tst-svc error.
* sysdeps/x86_64/memchr.S: New file.
* resolv/resolv.h (RES_SNGLKUP): Define.
* resolv/res_init.c (res_setoptions): Recognize single-request option.
* resolv/res_send.c (send_dg): If we sent two requests at once and
only get one reply before timeout switch to mode where we send the
second request only after the first answer has been received.
2009-04-05 Ulrich Drepper <drepper@redhat.com>
* sysdeps/x86_64/strlen.S: Optimize by using SSE2 instructions.
* sysdeps/x86_64/strchr.S: Likewise.
2009-04-03 Ulrich Drepper <drepper@redhat.com>
* configure.in: We need to test for the compiler earlier.
* misc/Makefile (routines): Add preadv, preadv64, pwritev, pwritev64.
* misc/Versions: Export preadv, preadv64, pwritev, pwritev64 for
GLIBC_2.10.
* misc/sys/uio.h: Declare preadv, preadv64, pwritev, pwritev64.
* sysdeps/unix/sysv/linux/kernel-features.h: Add entries for preadv
and pwritev.
* misc/preadv.c: New file.
* misc/preadv64.c: New file.
* misc/pwritev.c: New file.
* misc/pwritev64.c: New file.
* sysdeps/posx/preadv.c: New file.
* sysdeps/posx/preadv64.c: New file.
* sysdeps/posx/pwritev.c: New file.
* sysdeps/posx/pwritev64.c: New file.
* sysdeps/unix/sysv/linux/preadv.c: New file.
* sysdeps/unix/sysv/linux/preadv64.c: New file.
* sysdeps/unix/sysv/linux/pwritev.c: New file.
* sysdeps/unix/sysv/linux/pwritev64.c: New file.
* sysdeps/unix/sysv/linux/wordsize-64/preadv64.c: New file.
* sysdeps/unix/sysv/linux/wordsize-64/pwritev64.c: New file.
* sysdeps/unix/sysv/linux/readv.c (__libc_readv): Fix calling of
compatibility code.
* sysdeps/unix/sysv/linux/writev.c (__libc_writev): Likewise.
* sysdeps/unix/sysv/linux/kernel-features.h: Define
__ASSUME_COMPLETE_READV_WRITEV.
* sysdeps/unix/sysv/linux/readv.c: No need for userlevel fallback
with modern kernels.
* sysdeps/unix/sysv/linux/writev.c: Likewise.
* sysdeps/posix/readv.c: Since read is a cancellation point we have
to free a possible malloced buffer in case of cancellation.
* sysdeps/posix/writev.c: Likewise for write.
2009-04-02 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/bits/socket.h: Add missing protocol numbers.
* configure.in: Recognize --enable-nss-crypt.
* config.make.in: Add nss-crypt entry.
* crypt/Makefile: If nss-crypt==yes, don't build md5.c, sha256.c,
sha512.c. Don't run md5test, sha256test, sha512test. Pass -DUSE_NSS
and include path for NSS directory to compiler for md5-crypt,
sha256-crypt, sha512-crypt. Link libcrypt.so with -lfreebl3.
* crypt/md5-crypt.c: If USE_NSS is defined, don't use local hash
function implementation, use NSS. Introduce wrappers around the
hash function calls. Little code size optimization.
* crypt/sha256-crypt.c: Likewise.
* crypt/sha512-crypt.c: Likewise.
* scripts/check-local-headers.sh: Ignore nss3 directory.
* configure.in: Rename pic_default to libc_cv_pic_default.
* config.make.in: Likewise.
2009-04-01 Roland McGrath <roland@redhat.com>
* elf/elf.h (R_SPARC_GLOB_JMP): New macro.
(R_SPARC_GOTDATA_HIX22, R_SPARC_GOTDATA_LOX10): New macros.
(R_SPARC_GOTDATA_OP_HIX22, R_SPARC_GOTDATA_OP_LOX10): Likewise.
(R_SPARC_GOTDATA_OP, R_SPARC_H34): Likewise.
(R_SPARC_SIZE32, R_SPARC_SIZE64): Likewise.
(R_SPARC_GNU_VTINHERIT, R_SPARC_GNU_VTENTRY, R_SPARC_REV32): Likewise.
(R_SPARC_NUM): Update.
From Dave Miller <davem@davemloft.net>.
2009-04-01 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/sys/eventfd.h (EFD_SEMAPHORE): Define.
2009-03-31 Ulrich Drepper <drepper@redhat.com>
* elf/dl-open.c: Keep track of used name spaces and only iterate over
those which are used.
* elf/dl-addr.c: Likewise.
* elf/dl-caller.c: Likewise.
* elf/dl-fini.c: Likewise.
* elf/dl-iteratephdr.c: Likewise.
* elf/dl-libc.c: Likewise.
* elf/dl-load.c: Likewise.
* elf/dl-support.c: Likewise.
* elf/dl-sym.c: Likewise.
* elf/rtld.c: Likewise.
* sysdeps/generic/ldsodefs.h: Likewise.
* elf/dl-load.c: Remove support for systems without MAP_ANON.
* elf/dl-minimal.c: Likewise.
* elf/dl-misc.c: Likewise.
* elf/rtld.c: Likewise.
* sysdeps/generic/ldsodefs.h: Likewise.
2009-03-30 Ulrich Drepper <drepper@redhat.com>
* elf/do-lookup.h (do_lookup_x): Minor optimization and cleanup.
Avoid reuse of complex expression.
* po/fr.po: Update from translation team.
2009-03-16 Ulrich Drepper <drepper@redhat.com>
* include/dirent.h: Yet more changes to match sort function type
change.
* sysdeps/unix/sysv/linux/i386/alphasort64.c: Likewise.
* sysdeps/unix/sysv/linux/i386/olddirent.h: Likewise.
* sysdeps/unix/sysv/linux/i386/versionsort64.c: Likewise.
2009-03-16 Thomas Schwinge <tschwinge@gnu.org>
* dirent/scandir64.c (scandir64): Adjust declaration to type change.
2009-03-16 Ulrich Drepper <drepper@redhat.com>
* nscd/connections.c (restart): Try to preserve the process name
by reading the /proc/self/exe symlink and using the return name.
Patch by Jeff Bastian <jbastian@redhat.com>.
2009-03-15 Ulrich Drepper <drepper@redhat.com>
[BZ #9733]
* elf/dl-load.c (_dl_map_object_from_fd): Only call audit hooks
if we are not loading a new audit library.
* elf/dl-reloc (_dl_relocate_object): Third parameter is now a bitmask.
Only use profiling trampoline for auditing if we are not relocating
an audit library.
* elf/dl-open.c (dl_open_worker): Adjust _dl_relocate_object call.
* elf/rtld.c: Likewise.
* sysdeps/generic/ldsodefs.h: Adjust _dl_relocate_object prototype.
* elf/rtld.c (dl_main): Extend help message for --audit option.
[BZ #9759]
* dirent/dirent.h: Adjust prototypes of scandir, scandir64, alphasort,
alphasort64, versionsort, and versionsort64 to POSIX 2008.
* dirent/alphasort.c: Adjust implementation to type change.
* dirent/alphasort64.c: Likewise.
* dirent/scandir.c: Likewise.
* dirent/versionsort.c: Likewise.
* dirent/versionsort64.c: Likewise.
* sysdeps/wordsize-64/alphasort.c: Add hack to hide alphasort64
declaration.
* sysdeps/wordsize-64/versionsort.c: Add hack to hide versionsort64
declaration.
[BZ #9880]
* inet/inet6_rth.c (inet6_rth_reverse): Compute number of segments
correctly. Set segleft member in output as required.
Patch partly by Yang Hongyang <yanghy@cn.fujitsu.com>.
* inet/tst-inet6_rth.c (do_test): Add tests for inet6_rth_reverse.
[BZ #9881]
* inet/inet6_rth.c (inet6_rth_add): Add some error checking.
Patch mostly by Yang Hongyang <yanghy@cn.fujitsu.com>.
* inet/Makefile (tests): Add tst-inet6_rth.
* inet/tst-inet6_rth.c: New file.
[BZ #5807]
* string/strlen.c (strlen): Fix omission in the expression to test
for NUL bytes.
2009-03-14 Ulrich Drepper <drepper@redhat.com>
* crypt/sha256test.c (main): Perform 100,000 'a' test in a second way.
* elf/dl-runtime.c (reloc_offset): Define.
(reloc_index): Define.
(_dl_fixup): Rename reloc_offset parameter to reloc_arg.
(_dl_fixup_profile): Likewise. Use reloc_index instead of
computing index from reloc_offset.
(_dl_call_pltexit): Likewise.
* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve): Just pass
the relocation index to _dl_fixup.
(_dl_runtime_profile): Likewise for _dl_fixup_profile and
_dl_call_pltexit.
* sysdeps/x86_64/dl-runtime.c: New file.
[BZ #9893]
* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix
alignment of La_x86_64_regs. Store xmm parameters.
Patch mostly by Jiri Olsa <olsajiri@gmail.com>.
[BZ #9913]
* string/strverscmp.c (__strverscmp): Fix case of different digits
in fractional part of string.
Patch by Jingyu Liu <jyliu@fortinet.com>.
* string/Makefile (tests): Add tst-svc2.
* string/tst-svc2.c: New file.
* string/strverscmp.c (__strverscmp): Optimize size of tables.
* locale/iso-639.def: Add Min Nan.
2009-03-11 Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
[BZ #9948]
* elf/dl-sysdep.c (_dl_show_auxv): Add support for AT_BASE_PLATFORM.
2009-03-14 Ulrich Drepper <drepper@redhat.com>
* elf/dl-sysdep.c (auxvars): Compress data structure.
* sysdeps/i386/dl-machine.h (elf_machine_rel): Implement
STT_GNU_IFUNC handling.
(elf_machine_rela): Likewise.
2009-03-13 Ulrich Drepper <drepper@redhat.com>
* config.h.in (USE_MULTIARCH): Define.
* configure.in: Handle --enable-multi-arch.
* elf/dl-runtime.c (_dl_fixup): Handle STT_GNU_IFUNC.
(_dl_fixup_profile): Likewise.
* elf/do-lookup.c (dl_lookup_x): Likewise.
* sysdeps/x86_64/dl-machine.h: Handle STT_GNU_IFUNC.
* elf/elf.h (STT_GNU_IFUNC): Define.
* include/libc-symbols.h (libc_ifunc): Define.
* sysdeps/x86_64/cacheinfo.c: If USE_MULTIARCH is defined, use the
framework in init-arch.h to get CPUID values.
* sysdeps/x86_64/multiarch/Makefile: New file.
* sysdeps/x86_64/multiarch/init-arch.c: New file.
* sysdeps/x86_64/multiarch/init-arch.h: New file.
* sysdeps/x86_64/multiarch/sched_cpucount.c: New file.
* config.make.in (experimental-malloc): Define.
* configure.in: Handle --enable-experimental-malloc.
* malloc/Makefile: Handle experimental-malloc flag.
* malloc/malloc.c: Implement PER_THREAD and ATOMIC_FASTBINS features.
* malloc/arena.c: Likewise.
* malloc/hooks.c: Likewise.
* malloc/malloc.h: Define M_ARENA_TEST and M_ARENA_MAX.
2009-03-11 Ulrich Drepper <drepper@redhat.com>
* sysdeps/x86_64/dl-machine.h (elf_machine_rela): Add branch
prediction. A few size optimizations.
2009-03-10 Ulrich Drepper <drepper@redhat.com>
* time/tzset.c: Optimize a bit for size.
2009-03-10 Jakub Jelinek <jakub@redhat.com>
* include/stdio.h (fmemopen): Add libc_hidden_proto.
* libio/fmemopen.c (fmemopen): Add libc_hidden_def.
* elf/sprof.c: Avoid warning about multi-line comment.
2009-03-10 Ulrich Drepper <drepper@redhat.com>
* time/tzset.c (__tzset_parse_tz): Use correct string when parsing
DST name.
* time/tst-posixtz.c: Add tests for quoted timezone names.
2009-03-10 Jakub Jelinek <jakub@redhat.com>
* posix/unistd.h (_POSIX_VERSION, _POSIX2_VERSION, _POSIX2_C_BIND,
_POSIX2_C_DEV, _POSIX2_SW_DEV, _POSIX2_LOCALEDEF): Define to
200809L instead of 200112L.
(_XOPEN_VERSION): For __USE_XOPEN2K8 define to 700.
* posix/tst-sysconf.c (STDVER): Define to 200809L instead of 200112L.
* stdlib/quick_exit.c (quick_exit): Pass &__quick_exit_funcs
instead of __quick_exit_funcs to __run_exit_handlers.
* stdlib/at_quick_exit.c (at_quick_exit): Add attribute_hidden.
* stdlib/exit.h (__run_exit_handlers): Add noreturn attribute.
(__cxa_at_quick_exit): Remove attribute_hidden.
* stdlib/exit.c (exit): Pass &__exit_funcs instead of __exit_funcs
to __run_exit_handlers.
* stdlib/cxa_at_quick_exit.c (__cxa_at_quick_exit): Remove
attribute_hidden.
2009-03-10 Ulrich Drepper <drepper@redhat.com>
* po/id.po: Update from translation team.
2009-02-18 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S: Use
.machine push; .machine "power6" and .machine pop around mtfsf
insns outside of _ARCH_PWR6 define.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S:
Likewise.
* sysdeps/powerpc/fpu/tst-setcontext-fpscr.c (_SET_DI_FPSCR): Likewise.
* sysdeps/powerpc/fpu/fenv_libc.h (fesetenv_register,
relax_fenv_state): Likewise.
2009-03-08 Ulrich Drepper <drepper@redhat.com>
* stdlib/Makefile (routines): Add quick_exit, at_quick_exit, and
+2 -3
View File
@@ -649,7 +649,6 @@ endif # $(+cflags) == ""
# Don't duplicate options if we inherited variables from the parent.
+cflags := $(sort $(+cflags))
# These are flags given to the C compiler to tell it to look for
# include files (including ones given in angle brackets) in the parent
# library source directory, in the include directory, and in the
@@ -770,7 +769,7 @@ else
ASFLAGS :=
endif
endif
ASFLAGS += $(ASFLAGS-config)
ASFLAGS += $(ASFLAGS-config) $(asflags-cpu)
ifndef BUILD_CC
BUILD_CC = $(CC)
@@ -918,7 +917,7 @@ endif
all-subdirs = csu assert ctype locale intl catgets math setjmp signal \
stdlib stdio-common libio malloc string wcsmbs time dirent \
grp pwd posix io termios resource misc socket sysvipc gmon \
gnulib iconv iconvdata wctype manual shadow po argp \
gnulib iconv iconvdata wctype manual shadow gshadow po argp \
crypt nss localedata timezone rt conform debug \
$(add-on-subdirs) $(dlfcn) $(binfmt-subdir)
+1 -1
View File
@@ -271,7 +271,7 @@ installed-headers = argp/argp.h assert/assert.h catgets/nl_types.h \
crypt/crypt.h ctype/ctype.h debug/execinfo.h \
dirent/dirent.h dlfcn/dlfcn.h elf/elf.h elf/link.h \
gmon/sys/gmon.h gmon/sys/gmon_out.h gmon/sys/profil.h \
grp/grp.h iconv/iconv.h iconv/gconv.h \
grp/grp.h gshadow/gshadow.h iconv/iconv.h iconv/gconv.h \
$(wildcard inet/netinet/*.h) \
$(wildcard inet/arpa/*.h inet/protocols/*.h) \
inet/aliases.h inet/ifaddrs.h inet/netinet/ip6.h \
+29 -3
View File
@@ -1,4 +1,4 @@
GNU C Library NEWS -- history of user-visible changes. 2009-3-8
GNU C Library NEWS -- history of user-visible changes. 2009-4-23
Copyright (C) 1992-2008, 2009 Free Software Foundation, Inc.
See the end for copying conditions.
@@ -7,10 +7,14 @@ using `glibc' in the "product" field.
Version 2.10
* New Linux interface: accept4
* New interfaces: preadv, preadv64, pwritev, pwritev64, malloc_info
Implemented by Ulrich Drepper.
* New Linux interfaces: accept4, fallocate, fallocate64.
Implemented by Ulrich Drepper.
* Correct declarations of string function when used in C++ code. This
could lead to compile error for invalid C++ code.
could lead to compile errors for invalid C++ code.
* XPG7/POSIX 2008 compilation environment. Many GNU-specific functions are
now in POSIX.
@@ -21,6 +25,28 @@ Version 2.10
* New ISO C++1x interfaces: quick_exit, at_quick_exit
Implemented by Ulrich Drepper.
* Support for selecting between multiple function definitions at runtime
using STT_GNU_IFUNC symbols. Implemented by Ulrich Drepper.
* The libcrypt library can now use the hash function implementations in
NSS. Implemented by Ulrich Drepper.
* The malloc implementation can be compiled to be less memory efficient
but higher performing in multi-threaded programs.
Implemented by Ulrich Drepper.
* New locales: nan_TW@latin, ks_IN
* Faster strlen, strchr, strchrnul, strrchr, memchr, and rawmemchr for x86-64.
Implemented by Ulrich Drepper.
* Extended printf hook support. It is possible to use user-defined types
and extend existing format specifiers.
Implemented by Ulrich Drepper.
* Handling for group shadow files has been added.
Implemented by Ulrich Drepper.
Version 2.9
+3
View File
@@ -189,6 +189,9 @@
/* Define if __stack_chk_guard canary should be randomized at program startup. */
#undef ENABLE_STACKGUARD_RANDOMIZE
/* Define if multi-arch DSOs should be generated. */
#undef USE_MULTIARCH
/*
*/
+7 -1
View File
@@ -32,6 +32,7 @@ config-vendor = @host_vendor@
config-os = @host_os@
config-sysdirs = @sysnames@
cflags-cpu = @libc_cv_cc_submachine@
asflags-cpu = @libc_cv_cc_submachine@
defines = @DEFINES@
sysincludes = @SYSINCLUDES@
@@ -70,6 +71,7 @@ versioning = @VERSIONING@
oldest-abi = @oldest_abi@
no-whole-archive = @no_whole_archive@
exceptions = @exceptions@
multi-arch = @multi_arch@
mach-interface-list = @mach_interface_list@
@@ -78,10 +80,14 @@ have-ksh = @libc_cv_have_ksh@
sizeof-long-double = @sizeof_long_double@
experimental-malloc = @experimental_malloc@
nss-crypt = @libc_cv_nss_crypt@
# Configuration options.
build-static = @static@
build-shared = @shared@
build-pic-default= @pic_default@
build-pic-default= @libc_cv_pic_default@
build-profile = @profile@
build-omitfp = @omitfp@
build-bounded = @bounded@
Vendored
+3324 -3014
View File
File diff suppressed because it is too large Load Diff
+90 -13
View File
@@ -6,6 +6,15 @@ AC_CONFIG_SRCDIR([include/features.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([scripts])
AC_PROG_CC
if test $host != $build; then
AC_CHECK_PROGS(BUILD_CC, gcc cc)
fi
AC_SUBST(cross_compiling)
AC_PROG_CPP
# We need the C++ compiler only for testing.
AC_PROG_CXX
if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
AC_MSG_ERROR([you must configure in a separate build directory])
fi
@@ -254,6 +263,59 @@ AC_ARG_ENABLE([all-warnings],
[])
AC_SUBST(all_warnings)
AC_ARG_ENABLE([multi-arch],
AC_HELP_STRING([--enable-multi-arch],
[enable single DSO with optimizations for multiple architectures]),
[multi_arch=$enableval],
[multi_arch=no])
if test x"$multi_arch" = xyes; then
AC_DEFINE(USE_MULTIARCH)
multi_arch_d=/multiarch
fi
AC_SUBST(multi_arch)
AC_ARG_ENABLE([experimental-malloc],
AC_HELP_STRING([--enable-experimental-malloc],
[enable experimental malloc features]),
[experimental_malloc=$enableval],
[])
AC_SUBST(experimental_malloc)
AC_ARG_ENABLE([nss-crypt],
AC_HELP_STRING([--enable-nss-crypt],
[enable libcrypt to use nss]),
[nss_crypt=$enableval],
[nss_crypt=no])
if test x$nss_crypt = xyes; then
nss_includes=-I$(nss-config --includedir 2>/dev/null)
if test $? -ne 0; then
AC_MSG_ERROR([cannot find include directory with nss-config])
fi
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $nss_includes"
AC_COMPILE_IFELSE([typedef int PRBool;
#include <hasht.h>
#include <nsslowhash.h>
void f (void) { NSSLOW_Init (); }],
libc_cv_nss_crypt=yes,
AC_MSG_ERROR([
cannot find NSS headers with lowlevel hash function interfaces]))
old_LIBS="$LIBS"
LIBS="$LIBS -lfreebl3"
AC_LINK_IFELSE([AC_LANG_PROGRAM([typedef int PRBool;
#include <hasht.h>
#include <nsslowhash.h>],
[NSSLOW_Init();])],
libc_cv_nss_crypt=yes,
AC_MSG_ERROR([
cannot link program using lowlevel NSS hash functions]))
CFLAGS="$old_CFLAGS"
LIBS="$old_LIBS"
else
libc_cv_nss_crypt=no
fi
AC_SUBST(libc_cv_nss_crypt)
AC_CANONICAL_HOST
# The way shlib-versions is used to generate soversions.mk uses a
@@ -608,7 +670,7 @@ for b in $base ''; do
test "$v" = / && continue
for o in /$ostry ''; do
test "$o" = / && continue
for m in $mach ''; do
for m in $multi_arch_d $mach ''; do
for d in $add_ons_pfx ''; do
for a in $add_ons_sfx ''; do
if test -n "$m0$m0sub$b$v$o$m$msub"; then
@@ -829,14 +891,6 @@ if test "$INSTALL" = "${srcdir}/scripts/install-sh -c"; then
fi
AC_PROG_LN_S
AC_PROG_CC
if test $host != $build; then
AC_CHECK_PROGS(BUILD_CC, gcc cc)
fi
AC_SUBST(cross_compiling)
AC_PROG_CPP
# We need the C++ compiler only for testing.
AC_PROG_CXX
LIBC_PROG_BINUTILS
AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
@@ -1157,6 +1211,29 @@ if test "x$libc_cv_asm_type_prefix" != xno; then
AC_DEFINE_UNQUOTED(ASM_TYPE_DIRECTIVE_PREFIX, ${libc_cv_asm_type_prefix})
fi
# For the multi-arch option we need support in the assembler.
if test "$multi_arch" = yes; then
if test "x$libc_cv_asm_type_prefix" != xno; then
AC_CACHE_CHECK([for assembler gnu_indirect_function symbol type support],
libc_cv_asm_gnu_indirect_function, [dnl
cat > conftest.s <<EOF
.type foo,%gnu_indirect_function
EOF
if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
then
libc_cv_asm_gnu_indirect_function=yes
else
libc_cv_asm_gnu_indirect_function=no
fi
rm -f conftest*])
else
libc_cv_asm_gnu_indirect_function=no
fi
if test x"$libc_cv_asm_gnu_indirect_function" != xyes; then
AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
fi
fi
AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
[cat > conftest.s <<EOF
${libc_cv_dot_text}
@@ -2200,18 +2277,18 @@ if test $shared = default; then
shared=$elf
fi
AC_CACHE_CHECK([whether -fPIC is default], pic_default,
[pic_default=yes
AC_CACHE_CHECK([whether -fPIC is default], libc_cv_pic_default,
[libc_cv_pic_default=yes
cat > conftest.c <<EOF
#if defined __PIC__ || defined __pic__ || defined PIC || defined pic
# error PIC is default.
#endif
EOF
if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
pic_default=no
libc_cv_pic_default=no
fi
rm -f conftest.*])
AC_SUBST(pic_default)
AC_SUBST(libc_cv_pic_default)
AC_SUBST(profile)
AC_SUBST(omitfp)
+15 -4
View File
@@ -1,4 +1,4 @@
# Copyright (C) 1996, 2000, 2001, 2007 Free Software Foundation, Inc.
# Copyright (C) 1996, 2000, 2001, 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
@@ -26,10 +26,10 @@ headers := crypt.h
extra-libs := libcrypt
extra-libs-others := $(extra-libs)
libcrypt-routines := crypt-entry md5-crypt md5 sha256-crypt sha256 \
sha512-crypt sha512 crypt crypt_util
libcrypt-routines := crypt-entry md5-crypt sha256-crypt sha512-crypt crypt \
crypt_util
tests := cert md5test md5c-test sha256test sha256c-test sha512test sha512c-test
tests := cert md5c-test sha256c-test sha512c-test
distribute := ufc-crypt.h crypt-private.h ufc.c speeds.c README.ufc-crypt \
Banner md5.h sha256.h sha512.h
@@ -40,9 +40,20 @@ ifeq ($(crypt-in-libc),yes)
routines += $(libcrypt-routines)
endif
ifeq ($(nss-crypt),yes)
CPPFLAGS-sha256-crypt.c = -DUSE_NSS -I$(shell nss-config --includedir)
CPPFLAGS-sha512-crypt.c = -DUSE_NSS -I$(shell nss-config --includedir)
CPPFLAGS-md5-crypt.c = -DUSE_NSS -I$(shell nss-config --includedir)
LDLIBS-crypt.so = -lfreebl3
else
libcrypt-routines += md5 sha256 sha512
tests += md5test sha256test sha512test
$(objpfx)md5test: $(objpfx)md5.o
$(objpfx)sha256test: $(objpfx)sha256.o
$(objpfx)sha512test: $(objpfx)sha512.o
endif
include ../Rules
+101 -37
View File
@@ -1,6 +1,6 @@
/* One way encryption based on MD5 sum.
Compatible with the behavior of MD5 crypt introduced in FreeBSD 2.0.
Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2004
Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2004, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -29,6 +29,52 @@
#include "md5.h"
#ifdef USE_NSS
typedef int PRBool;
# include <hasht.h>
# include <nsslowhash.h>
# define md5_init_ctx(ctxp, nss_ctxp) \
do \
{ \
if (((nss_ctxp = NSSLOWHASH_NewContext (nss_ictx, HASH_AlgMD5)) \
== NULL)) \
{ \
if (nss_ctx != NULL) \
NSSLOWHASH_Destroy (nss_ctx); \
if (nss_alt_ctx != NULL) \
NSSLOWHASH_Destroy (nss_alt_ctx); \
return NULL; \
} \
NSSLOWHASH_Begin (nss_ctxp); \
} \
while (0)
# define md5_process_bytes(buf, len, ctxp, nss_ctxp) \
NSSLOWHASH_Update (nss_ctxp, (const unsigned char *) buf, len)
# define md5_finish_ctx(ctxp, nss_ctxp, result) \
do \
{ \
unsigned int ret; \
NSSLOWHASH_End (nss_ctxp, result, &ret, sizeof (result)); \
assert (ret == sizeof (result)); \
NSSLOWHASH_Destroy (nss_ctxp); \
nss_ctxp = NULL; \
} \
while (0)
#else
# define md5_init_ctx(ctxp, nss_ctxp) \
__md5_init_ctx (ctxp)
# define md5_process_bytes(buf, len, ctxp, nss_ctxp) \
__md5_process_bytes(buf, len, ctxp)
# define md5_finish_ctx(ctxp, nss_ctxp, result) \
__md5_finish_ctx (ctxp, result)
#endif
/* Define our magic string to mark salt for MD5 "encryption"
replacement. This is meant to be the same as for other MD5 based
encryption implementations. */
@@ -56,8 +102,6 @@ __md5_crypt_r (key, salt, buffer, buflen)
{
unsigned char alt_result[16]
__attribute__ ((__aligned__ (__alignof__ (md5_uint32))));
struct md5_ctx ctx;
struct md5_ctx alt_ctx;
size_t salt_len;
size_t key_len;
size_t cnt;
@@ -94,43 +138,56 @@ __md5_crypt_r (key, salt, buffer, buflen)
assert ((salt - (char *) 0) % __alignof__ (md5_uint32) == 0);
}
#ifdef USE_NSS
/* Initialize libfreebl3. */
NSSLOWInitContext *nss_ictx = NSSLOW_Init ();
if (nss_ictx == NULL)
return NULL;
NSSLOWHASHContext *nss_ctx = NULL;
NSSLOWHASHContext *nss_alt_ctx = NULL;
#else
struct md5_ctx ctx;
struct md5_ctx alt_ctx;
#endif
/* Prepare for the real work. */
__md5_init_ctx (&ctx);
md5_init_ctx (&ctx, nss_ctx);
/* Add the key string. */
__md5_process_bytes (key, key_len, &ctx);
md5_process_bytes (key, key_len, &ctx, nss_ctx);
/* Because the SALT argument need not always have the salt prefix we
add it separately. */
__md5_process_bytes (md5_salt_prefix, sizeof (md5_salt_prefix) - 1, &ctx);
md5_process_bytes (md5_salt_prefix, sizeof (md5_salt_prefix) - 1,
&ctx, nss_ctx);
/* The last part is the salt string. This must be at most 8
characters and it ends at the first `$' character (for
compatibility with existing implementations). */
__md5_process_bytes (salt, salt_len, &ctx);
md5_process_bytes (salt, salt_len, &ctx, nss_ctx);
/* Compute alternate MD5 sum with input KEY, SALT, and KEY. The
final result will be added to the first context. */
__md5_init_ctx (&alt_ctx);
md5_init_ctx (&alt_ctx, nss_alt_ctx);
/* Add key. */
__md5_process_bytes (key, key_len, &alt_ctx);
md5_process_bytes (key, key_len, &alt_ctx, nss_alt_ctx);
/* Add salt. */
__md5_process_bytes (salt, salt_len, &alt_ctx);
md5_process_bytes (salt, salt_len, &alt_ctx, nss_alt_ctx);
/* Add key again. */
__md5_process_bytes (key, key_len, &alt_ctx);
md5_process_bytes (key, key_len, &alt_ctx, nss_alt_ctx);
/* Now get result of this (16 bytes) and add it to the other
context. */
__md5_finish_ctx (&alt_ctx, alt_result);
md5_finish_ctx (&alt_ctx, nss_alt_ctx, alt_result);
/* Add for any character in the key one byte of the alternate sum. */
for (cnt = key_len; cnt > 16; cnt -= 16)
__md5_process_bytes (alt_result, 16, &ctx);
__md5_process_bytes (alt_result, cnt, &ctx);
md5_process_bytes (alt_result, 16, &ctx, nss_ctx);
md5_process_bytes (alt_result, cnt, &ctx, nss_ctx);
/* For the following code we need a NUL byte. */
*alt_result = '\0';
@@ -140,11 +197,12 @@ __md5_crypt_r (key, salt, buffer, buflen)
bit the first character of the key. This does not seem to be
what was intended but we have to follow this to be compatible. */
for (cnt = key_len; cnt > 0; cnt >>= 1)
__md5_process_bytes ((cnt & 1) != 0 ? (const char *) alt_result : key, 1,
&ctx);
md5_process_bytes ((cnt & 1) != 0
? (const void *) alt_result : (const void *) key, 1,
&ctx, nss_ctx);
/* Create intermediate result. */
__md5_finish_ctx (&ctx, alt_result);
md5_finish_ctx (&ctx, nss_ctx, alt_result);
/* Now comes another weirdness. In fear of password crackers here
comes a quite long loop which just processes the output of the
@@ -152,32 +210,37 @@ __md5_crypt_r (key, salt, buffer, buflen)
for (cnt = 0; cnt < 1000; ++cnt)
{
/* New context. */
__md5_init_ctx (&ctx);
md5_init_ctx (&ctx, nss_ctx);
/* Add key or last result. */
if ((cnt & 1) != 0)
__md5_process_bytes (key, key_len, &ctx);
md5_process_bytes (key, key_len, &ctx, nss_ctx);
else
__md5_process_bytes (alt_result, 16, &ctx);
md5_process_bytes (alt_result, 16, &ctx, nss_ctx);
/* Add salt for numbers not divisible by 3. */
if (cnt % 3 != 0)
__md5_process_bytes (salt, salt_len, &ctx);
md5_process_bytes (salt, salt_len, &ctx, nss_ctx);
/* Add key for numbers not divisible by 7. */
if (cnt % 7 != 0)
__md5_process_bytes (key, key_len, &ctx);
md5_process_bytes (key, key_len, &ctx, nss_ctx);
/* Add key or last result. */
if ((cnt & 1) != 0)
__md5_process_bytes (alt_result, 16, &ctx);
md5_process_bytes (alt_result, 16, &ctx, nss_ctx);
else
__md5_process_bytes (key, key_len, &ctx);
md5_process_bytes (key, key_len, &ctx, nss_ctx);
/* Create intermediate result. */
__md5_finish_ctx (&ctx, alt_result);
md5_finish_ctx (&ctx, nss_ctx, alt_result);
}
#ifdef USE_NSS
/* Free libfreebl3 resources. */
NSSLOW_Shutdown (nss_ictx);
#endif
/* Now we can construct the result string. It consists of three
parts. */
cp = __stpncpy (buffer, md5_salt_prefix, MAX (0, buflen));
@@ -192,18 +255,17 @@ __md5_crypt_r (key, salt, buffer, buflen)
--buflen;
}
#define b64_from_24bit(B2, B1, B0, N) \
do { \
unsigned int w = ((B2) << 16) | ((B1) << 8) | (B0); \
int n = (N); \
while (n-- > 0 && buflen > 0) \
{ \
*cp++ = b64t[w & 0x3f]; \
--buflen; \
w >>= 6; \
} \
} while (0)
void b64_from_24bit (unsigned int b2, unsigned int b1, unsigned int b0,
int n)
{
unsigned int w = (b2 << 16) | (b1 << 8) | b0;
while (n-- > 0 && buflen > 0)
{
*cp++ = b64t[w & 0x3f];
--buflen;
w >>= 6;
}
}
b64_from_24bit (alt_result[0], alt_result[6], alt_result[12], 4);
b64_from_24bit (alt_result[1], alt_result[7], alt_result[13], 4);
@@ -223,10 +285,12 @@ __md5_crypt_r (key, salt, buffer, buflen)
attaching to processes or reading core dumps cannot get any
information. We do it in this way to clear correct_words[]
inside the MD5 implementation as well. */
#ifndef USE_NSS
__md5_init_ctx (&ctx);
__md5_finish_ctx (&ctx, alt_result);
memset (&ctx, '\0', sizeof (ctx));
memset (&alt_ctx, '\0', sizeof (alt_ctx));
#endif
if (copied_key != NULL)
memset (copied_key, '\0', key_len);
if (copied_salt != NULL)
+106 -43
View File
@@ -1,5 +1,5 @@
/* One way encryption based on SHA256 sum.
Copyright (C) 2007 Free Software Foundation, Inc.
Copyright (C) 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2007.
@@ -28,6 +28,52 @@
#include "sha256.h"
#ifdef USE_NSS
typedef int PRBool;
# include <hasht.h>
# include <nsslowhash.h>
# define sha256_init_ctx(ctxp, nss_ctxp) \
do \
{ \
if (((nss_ctxp = NSSLOWHASH_NewContext (nss_ictx, HASH_AlgSHA256)) \
== NULL)) \
{ \
if (nss_ctx != NULL) \
NSSLOWHASH_Destroy (nss_ctx); \
if (nss_alt_ctx != NULL) \
NSSLOWHASH_Destroy (nss_alt_ctx); \
return NULL; \
} \
NSSLOWHASH_Begin (nss_ctxp); \
} \
while (0)
# define sha256_process_bytes(buf, len, ctxp, nss_ctxp) \
NSSLOWHASH_Update (nss_ctxp, (const unsigned char *) buf, len)
# define sha256_finish_ctx(ctxp, nss_ctxp, result) \
do \
{ \
unsigned int ret; \
NSSLOWHASH_End (nss_ctxp, result, &ret, sizeof (result)); \
assert (ret == sizeof (result)); \
NSSLOWHASH_Destroy (nss_ctxp); \
nss_ctxp = NULL; \
} \
while (0)
#else
# define sha256_init_ctx(ctxp, nss_ctxp) \
__sha256_init_ctx (ctxp)
# define sha256_process_bytes(buf, len, ctxp, nss_ctxp) \
__sha256_process_bytes(buf, len, ctxp)
# define sha256_finish_ctx(ctxp, nss_ctxp, result) \
__sha256_finish_ctx (ctxp, result)
#endif
/* Define our magic string to mark salt for SHA256 "encryption"
replacement. */
static const char sha256_salt_prefix[] = "$5$";
@@ -66,8 +112,6 @@ __sha256_crypt_r (key, salt, buffer, buflen)
__attribute__ ((__aligned__ (__alignof__ (uint32_t))));
unsigned char temp_result[32]
__attribute__ ((__aligned__ (__alignof__ (uint32_t))));
struct sha256_ctx ctx;
struct sha256_ctx alt_ctx;
size_t salt_len;
size_t key_len;
size_t cnt;
@@ -123,59 +167,71 @@ __sha256_crypt_r (key, salt, buffer, buflen)
assert ((salt - (char *) 0) % __alignof__ (uint32_t) == 0);
}
#ifdef USE_NSS
/* Initialize libfreebl3. */
NSSLOWInitContext *nss_ictx = NSSLOW_Init ();
if (nss_ictx == NULL)
return NULL;
NSSLOWHASHContext *nss_ctx = NULL;
NSSLOWHASHContext *nss_alt_ctx = NULL;
#else
struct sha256_ctx ctx;
struct sha256_ctx alt_ctx;
#endif
/* Prepare for the real work. */
__sha256_init_ctx (&ctx);
sha256_init_ctx (&ctx, nss_ctx);
/* Add the key string. */
__sha256_process_bytes (key, key_len, &ctx);
sha256_process_bytes (key, key_len, &ctx, nss_ctx);
/* The last part is the salt string. This must be at most 16
characters and it ends at the first `$' character. */
__sha256_process_bytes (salt, salt_len, &ctx);
sha256_process_bytes (salt, salt_len, &ctx, nss_ctx);
/* Compute alternate SHA256 sum with input KEY, SALT, and KEY. The
final result will be added to the first context. */
__sha256_init_ctx (&alt_ctx);
sha256_init_ctx (&alt_ctx, nss_alt_ctx);
/* Add key. */
__sha256_process_bytes (key, key_len, &alt_ctx);
sha256_process_bytes (key, key_len, &alt_ctx, nss_alt_ctx);
/* Add salt. */
__sha256_process_bytes (salt, salt_len, &alt_ctx);
sha256_process_bytes (salt, salt_len, &alt_ctx, nss_alt_ctx);
/* Add key again. */
__sha256_process_bytes (key, key_len, &alt_ctx);
sha256_process_bytes (key, key_len, &alt_ctx, nss_alt_ctx);
/* Now get result of this (32 bytes) and add it to the other
context. */
__sha256_finish_ctx (&alt_ctx, alt_result);
sha256_finish_ctx (&alt_ctx, nss_alt_ctx, alt_result);
/* Add for any character in the key one byte of the alternate sum. */
for (cnt = key_len; cnt > 32; cnt -= 32)
__sha256_process_bytes (alt_result, 32, &ctx);
__sha256_process_bytes (alt_result, cnt, &ctx);
sha256_process_bytes (alt_result, 32, &ctx, nss_ctx);
sha256_process_bytes (alt_result, cnt, &ctx, nss_ctx);
/* Take the binary representation of the length of the key and for every
1 add the alternate sum, for every 0 the key. */
for (cnt = key_len; cnt > 0; cnt >>= 1)
if ((cnt & 1) != 0)
__sha256_process_bytes (alt_result, 32, &ctx);
sha256_process_bytes (alt_result, 32, &ctx, nss_ctx);
else
__sha256_process_bytes (key, key_len, &ctx);
sha256_process_bytes (key, key_len, &ctx, nss_ctx);
/* Create intermediate result. */
__sha256_finish_ctx (&ctx, alt_result);
sha256_finish_ctx (&ctx, nss_ctx, alt_result);
/* Start computation of P byte sequence. */
__sha256_init_ctx (&alt_ctx);
sha256_init_ctx (&alt_ctx, nss_alt_ctx);
/* For every character in the password add the entire password. */
for (cnt = 0; cnt < key_len; ++cnt)
__sha256_process_bytes (key, key_len, &alt_ctx);
sha256_process_bytes (key, key_len, &alt_ctx, nss_alt_ctx);
/* Finish the digest. */
__sha256_finish_ctx (&alt_ctx, temp_result);
sha256_finish_ctx (&alt_ctx, nss_alt_ctx, temp_result);
/* Create byte sequence P. */
cp = p_bytes = alloca (key_len);
@@ -184,14 +240,14 @@ __sha256_crypt_r (key, salt, buffer, buflen)
memcpy (cp, temp_result, cnt);
/* Start computation of S byte sequence. */
__sha256_init_ctx (&alt_ctx);
sha256_init_ctx (&alt_ctx, nss_alt_ctx);
/* For every character in the password add the entire password. */
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
__sha256_process_bytes (salt, salt_len, &alt_ctx);
sha256_process_bytes (salt, salt_len, &alt_ctx, nss_alt_ctx);
/* Finish the digest. */
__sha256_finish_ctx (&alt_ctx, temp_result);
sha256_finish_ctx (&alt_ctx, nss_alt_ctx, temp_result);
/* Create byte sequence S. */
cp = s_bytes = alloca (salt_len);
@@ -204,32 +260,37 @@ __sha256_crypt_r (key, salt, buffer, buflen)
for (cnt = 0; cnt < rounds; ++cnt)
{
/* New context. */
__sha256_init_ctx (&ctx);
sha256_init_ctx (&ctx, nss_ctx);
/* Add key or last result. */
if ((cnt & 1) != 0)
__sha256_process_bytes (p_bytes, key_len, &ctx);
sha256_process_bytes (p_bytes, key_len, &ctx, nss_ctx);
else
__sha256_process_bytes (alt_result, 32, &ctx);
sha256_process_bytes (alt_result, 32, &ctx, nss_ctx);
/* Add salt for numbers not divisible by 3. */
if (cnt % 3 != 0)
__sha256_process_bytes (s_bytes, salt_len, &ctx);
sha256_process_bytes (s_bytes, salt_len, &ctx, nss_ctx);
/* Add key for numbers not divisible by 7. */
if (cnt % 7 != 0)
__sha256_process_bytes (p_bytes, key_len, &ctx);
sha256_process_bytes (p_bytes, key_len, &ctx, nss_ctx);
/* Add key or last result. */
if ((cnt & 1) != 0)
__sha256_process_bytes (alt_result, 32, &ctx);
sha256_process_bytes (alt_result, 32, &ctx, nss_ctx);
else
__sha256_process_bytes (p_bytes, key_len, &ctx);
sha256_process_bytes (p_bytes, key_len, &ctx, nss_ctx);
/* Create intermediate result. */
__sha256_finish_ctx (&ctx, alt_result);
sha256_finish_ctx (&ctx, nss_ctx, alt_result);
}
#ifdef USE_NSS
/* Free libfreebl3 resources. */
NSSLOW_Shutdown (nss_ictx);
#endif
/* Now we can construct the result string. It consists of three
parts. */
cp = __stpncpy (buffer, sha256_salt_prefix, MAX (0, buflen));
@@ -252,17 +313,17 @@ __sha256_crypt_r (key, salt, buffer, buflen)
--buflen;
}
#define b64_from_24bit(B2, B1, B0, N) \
do { \
unsigned int w = ((B2) << 16) | ((B1) << 8) | (B0); \
int n = (N); \
while (n-- > 0 && buflen > 0) \
{ \
*cp++ = b64t[w & 0x3f]; \
--buflen; \
w >>= 6; \
} \
} while (0)
void b64_from_24bit (unsigned int b2, unsigned int b1, unsigned int b0,
int n)
{
unsigned int w = (b2 << 16) | (b1 << 8) | b0;
while (n-- > 0 && buflen > 0)
{
*cp++ = b64t[w & 0x3f];
--buflen;
w >>= 6;
}
}
b64_from_24bit (alt_result[0], alt_result[10], alt_result[20], 4);
b64_from_24bit (alt_result[21], alt_result[1], alt_result[11], 4);
@@ -287,13 +348,15 @@ __sha256_crypt_r (key, salt, buffer, buflen)
attaching to processes or reading core dumps cannot get any
information. We do it in this way to clear correct_words[]
inside the SHA256 implementation as well. */
#ifndef USE_NSS
__sha256_init_ctx (&ctx);
__sha256_finish_ctx (&ctx, alt_result);
memset (&ctx, '\0', sizeof (ctx));
memset (&alt_ctx, '\0', sizeof (alt_ctx));
#endif
memset (temp_result, '\0', sizeof (temp_result));
memset (p_bytes, '\0', key_len);
memset (s_bytes, '\0', salt_len);
memset (&ctx, '\0', sizeof (ctx));
memset (&alt_ctx, '\0', sizeof (alt_ctx));
if (copied_key != NULL)
memset (copied_key, '\0', key_len);
if (copied_salt != NULL)
+11 -1
View File
@@ -84,7 +84,17 @@ main (void)
"\xf1\x80\x9a\x48\xa4\x97\x20\x0e\x04\x6d\x39\xcc\xc7\x11\x2c\xd0";
if (memcmp (expected, sum, 32) != 0)
{
printf ("test %d failed\n", cnt);
printf ("test %d failed\n", cnt++);
result = 1;
}
__sha256_init_ctx (&ctx);
for (int i = 0; i < 100000; ++i)
__sha256_process_bytes (buf, 10, &ctx);
__sha256_finish_ctx (&ctx, sum);
if (memcmp (expected, sum, 32) != 0)
{
printf ("test %d failed\n", cnt++);
result = 1;
}
+106 -43
View File
@@ -1,5 +1,5 @@
/* One way encryption based on SHA512 sum.
Copyright (C) 2007 Free Software Foundation, Inc.
Copyright (C) 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2007.
@@ -28,6 +28,52 @@
#include "sha512.h"
#ifdef USE_NSS
typedef int PRBool;
# include <hasht.h>
# include <nsslowhash.h>
# define sha512_init_ctx(ctxp, nss_ctxp) \
do \
{ \
if (((nss_ctxp = NSSLOWHASH_NewContext (nss_ictx, HASH_AlgSHA512)) \
== NULL)) \
{ \
if (nss_ctx != NULL) \
NSSLOWHASH_Destroy (nss_ctx); \
if (nss_alt_ctx != NULL) \
NSSLOWHASH_Destroy (nss_alt_ctx); \
return NULL; \
} \
NSSLOWHASH_Begin (nss_ctxp); \
} \
while (0)
# define sha512_process_bytes(buf, len, ctxp, nss_ctxp) \
NSSLOWHASH_Update (nss_ctxp, (const unsigned char *) buf, len)
# define sha512_finish_ctx(ctxp, nss_ctxp, result) \
do \
{ \
unsigned int ret; \
NSSLOWHASH_End (nss_ctxp, result, &ret, sizeof (result)); \
assert (ret == sizeof (result)); \
NSSLOWHASH_Destroy (nss_ctxp); \
nss_ctxp = NULL; \
} \
while (0)
#else
# define sha512_init_ctx(ctxp, nss_ctxp) \
__sha512_init_ctx (ctxp)
# define sha512_process_bytes(buf, len, ctxp, nss_ctxp) \
__sha512_process_bytes(buf, len, ctxp)
# define sha512_finish_ctx(ctxp, nss_ctxp, result) \
__sha512_finish_ctx (ctxp, result)
#endif
/* Define our magic string to mark salt for SHA512 "encryption"
replacement. */
static const char sha512_salt_prefix[] = "$6$";
@@ -66,8 +112,6 @@ __sha512_crypt_r (key, salt, buffer, buflen)
__attribute__ ((__aligned__ (__alignof__ (uint64_t))));
unsigned char temp_result[64]
__attribute__ ((__aligned__ (__alignof__ (uint64_t))));
struct sha512_ctx ctx;
struct sha512_ctx alt_ctx;
size_t salt_len;
size_t key_len;
size_t cnt;
@@ -123,59 +167,71 @@ __sha512_crypt_r (key, salt, buffer, buflen)
assert ((salt - (char *) 0) % __alignof__ (uint64_t) == 0);
}
#ifdef USE_NSS
/* Initialize libfreebl3. */
NSSLOWInitContext *nss_ictx = NSSLOW_Init ();
if (nss_ictx == NULL)
return NULL;
NSSLOWHASHContext *nss_ctx = NULL;
NSSLOWHASHContext *nss_alt_ctx = NULL;
#else
struct sha512_ctx ctx;
struct sha512_ctx alt_ctx;
#endif
/* Prepare for the real work. */
__sha512_init_ctx (&ctx);
sha512_init_ctx (&ctx, nss_ctx);
/* Add the key string. */
__sha512_process_bytes (key, key_len, &ctx);
sha512_process_bytes (key, key_len, &ctx, nss_ctx);
/* The last part is the salt string. This must be at most 16
characters and it ends at the first `$' character. */
__sha512_process_bytes (salt, salt_len, &ctx);
sha512_process_bytes (salt, salt_len, &ctx, nss_ctx);
/* Compute alternate SHA512 sum with input KEY, SALT, and KEY. The
final result will be added to the first context. */
__sha512_init_ctx (&alt_ctx);
sha512_init_ctx (&alt_ctx, nss_alt_ctx);
/* Add key. */
__sha512_process_bytes (key, key_len, &alt_ctx);
sha512_process_bytes (key, key_len, &alt_ctx, nss_alt_ctx);
/* Add salt. */
__sha512_process_bytes (salt, salt_len, &alt_ctx);
sha512_process_bytes (salt, salt_len, &alt_ctx, nss_alt_ctx);
/* Add key again. */
__sha512_process_bytes (key, key_len, &alt_ctx);
sha512_process_bytes (key, key_len, &alt_ctx, nss_alt_ctx);
/* Now get result of this (64 bytes) and add it to the other
context. */
__sha512_finish_ctx (&alt_ctx, alt_result);
sha512_finish_ctx (&alt_ctx, nss_alt_ctx, alt_result);
/* Add for any character in the key one byte of the alternate sum. */
for (cnt = key_len; cnt > 64; cnt -= 64)
__sha512_process_bytes (alt_result, 64, &ctx);
__sha512_process_bytes (alt_result, cnt, &ctx);
sha512_process_bytes (alt_result, 64, &ctx, nss_ctx);
sha512_process_bytes (alt_result, cnt, &ctx, nss_ctx);
/* Take the binary representation of the length of the key and for every
1 add the alternate sum, for every 0 the key. */
for (cnt = key_len; cnt > 0; cnt >>= 1)
if ((cnt & 1) != 0)
__sha512_process_bytes (alt_result, 64, &ctx);
sha512_process_bytes (alt_result, 64, &ctx, nss_ctx);
else
__sha512_process_bytes (key, key_len, &ctx);
sha512_process_bytes (key, key_len, &ctx, nss_ctx);
/* Create intermediate result. */
__sha512_finish_ctx (&ctx, alt_result);
sha512_finish_ctx (&ctx, nss_ctx, alt_result);
/* Start computation of P byte sequence. */
__sha512_init_ctx (&alt_ctx);
sha512_init_ctx (&alt_ctx, nss_alt_ctx);
/* For every character in the password add the entire password. */
for (cnt = 0; cnt < key_len; ++cnt)
__sha512_process_bytes (key, key_len, &alt_ctx);
sha512_process_bytes (key, key_len, &alt_ctx, nss_alt_ctx);
/* Finish the digest. */
__sha512_finish_ctx (&alt_ctx, temp_result);
sha512_finish_ctx (&alt_ctx, nss_alt_ctx, temp_result);
/* Create byte sequence P. */
cp = p_bytes = alloca (key_len);
@@ -184,14 +240,14 @@ __sha512_crypt_r (key, salt, buffer, buflen)
memcpy (cp, temp_result, cnt);
/* Start computation of S byte sequence. */
__sha512_init_ctx (&alt_ctx);
sha512_init_ctx (&alt_ctx, nss_alt_ctx);
/* For every character in the password add the entire password. */
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
__sha512_process_bytes (salt, salt_len, &alt_ctx);
sha512_process_bytes (salt, salt_len, &alt_ctx, nss_alt_ctx);
/* Finish the digest. */
__sha512_finish_ctx (&alt_ctx, temp_result);
sha512_finish_ctx (&alt_ctx, nss_alt_ctx, temp_result);
/* Create byte sequence S. */
cp = s_bytes = alloca (salt_len);
@@ -204,32 +260,37 @@ __sha512_crypt_r (key, salt, buffer, buflen)
for (cnt = 0; cnt < rounds; ++cnt)
{
/* New context. */
__sha512_init_ctx (&ctx);
sha512_init_ctx (&ctx, nss_ctx);
/* Add key or last result. */
if ((cnt & 1) != 0)
__sha512_process_bytes (p_bytes, key_len, &ctx);
sha512_process_bytes (p_bytes, key_len, &ctx, nss_ctx);
else
__sha512_process_bytes (alt_result, 64, &ctx);
sha512_process_bytes (alt_result, 64, &ctx, nss_ctx);
/* Add salt for numbers not divisible by 3. */
if (cnt % 3 != 0)
__sha512_process_bytes (s_bytes, salt_len, &ctx);
sha512_process_bytes (s_bytes, salt_len, &ctx, nss_ctx);
/* Add key for numbers not divisible by 7. */
if (cnt % 7 != 0)
__sha512_process_bytes (p_bytes, key_len, &ctx);
sha512_process_bytes (p_bytes, key_len, &ctx, nss_ctx);
/* Add key or last result. */
if ((cnt & 1) != 0)
__sha512_process_bytes (alt_result, 64, &ctx);
sha512_process_bytes (alt_result, 64, &ctx, nss_ctx);
else
__sha512_process_bytes (p_bytes, key_len, &ctx);
sha512_process_bytes (p_bytes, key_len, &ctx, nss_ctx);
/* Create intermediate result. */
__sha512_finish_ctx (&ctx, alt_result);
sha512_finish_ctx (&ctx, nss_ctx, alt_result);
}
#ifdef USE_NSS
/* Free libfreebl3 resources. */
NSSLOW_Shutdown (nss_ictx);
#endif
/* Now we can construct the result string. It consists of three
parts. */
cp = __stpncpy (buffer, sha512_salt_prefix, MAX (0, buflen));
@@ -252,17 +313,17 @@ __sha512_crypt_r (key, salt, buffer, buflen)
--buflen;
}
#define b64_from_24bit(B2, B1, B0, N) \
do { \
unsigned int w = ((B2) << 16) | ((B1) << 8) | (B0); \
int n = (N); \
while (n-- > 0 && buflen > 0) \
{ \
*cp++ = b64t[w & 0x3f]; \
--buflen; \
w >>= 6; \
} \
} while (0)
void b64_from_24bit (unsigned int b2, unsigned int b1, unsigned int b0,
int n)
{
unsigned int w = (b2 << 16) | (b1 << 8) | b0;
while (n-- > 0 && buflen > 0)
{
*cp++ = b64t[w & 0x3f];
--buflen;
w >>= 6;
}
}
b64_from_24bit (alt_result[0], alt_result[21], alt_result[42], 4);
b64_from_24bit (alt_result[22], alt_result[43], alt_result[1], 4);
@@ -299,13 +360,15 @@ __sha512_crypt_r (key, salt, buffer, buflen)
attaching to processes or reading core dumps cannot get any
information. We do it in this way to clear correct_words[]
inside the SHA512 implementation as well. */
#ifndef USE_NSS
__sha512_init_ctx (&ctx);
__sha512_finish_ctx (&ctx, alt_result);
memset (&ctx, '\0', sizeof (ctx));
memset (&alt_ctx, '\0', sizeof (alt_ctx));
#endif
memset (temp_result, '\0', sizeof (temp_result));
memset (p_bytes, '\0', key_len);
memset (s_bytes, '\0', salt_len);
memset (&ctx, '\0', sizeof (ctx));
memset (&alt_ctx, '\0', sizeof (alt_ctx));
if (copied_key != NULL)
memset (copied_key, '\0', key_len);
if (copied_salt != NULL)
+3 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1995,1997,1999-2002,2004,2006,2008
/* Copyright (C) 1995,1997,1999-2002,2004,2006,2008,2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -53,8 +53,8 @@ __vasprintf_chk (char **result_ptr, int flags, const char *format,
#ifdef _IO_MTSAFE_IO
sf._sbf._f._lock = NULL;
#endif
_IO_no_init ((_IO_FILE *) &sf._sbf, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
_IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS (&sf._sbf) = &_IO_str_jumps;
_IO_str_init_static_internal (&sf, string, init_string_size, string);
sf._sbf._f._flags &= ~_IO_USER_BUF;
sf._s._allocate_buffer = (_IO_alloc_type) malloc;
+3 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1995, 1997, 1998, 2004, 2006
/* Copyright (C) 1991, 1995, 1997, 1998, 2004, 2006, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -53,7 +53,7 @@ ___vsnprintf_chk (char *s, size_t maxlen, int flags, size_t slen,
}
_IO_no_init (&sf.f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS ((struct _IO_FILE_plus *) &sf.f._sbf) = &_IO_strn_jumps;
_IO_JUMPS (&sf.f._sbf) = &_IO_strn_jumps;
s[0] = '\0';
/* For flags > 0 (i.e. __USE_FORTIFY_LEVEL > 1) request that %n
@@ -62,7 +62,7 @@ ___vsnprintf_chk (char *s, size_t maxlen, int flags, size_t slen,
sf.f._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;
_IO_str_init_static_internal (&sf.f, s, maxlen - 1, s);
ret = INTUSE(_IO_vfprintf) ((_IO_FILE *) &sf.f._sbf, format, args);
ret = INTUSE(_IO_vfprintf) (&sf.f._sbf._f, format, args);
if (sf.f._sbf._f._IO_buf_base != sf.overflow_buf)
*sf.f._sbf._f._IO_write_ptr = '\0';
+3 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1994, 1997, 1999-2003, 2004, 2006
/* Copyright (C) 1994, 1997, 1999-2003, 2004, 2006, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -75,7 +75,7 @@ ___vsprintf_chk (char *s, int flags, size_t slen, const char *format,
__chk_fail ();
_IO_no_init (&f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS ((struct _IO_FILE_plus *) &f._sbf) = &_IO_str_chk_jumps;
_IO_JUMPS (&f._sbf) = &_IO_str_chk_jumps;
s[0] = '\0';
_IO_str_init_static_internal (&f, s, slen - 1, s);
@@ -84,7 +84,7 @@ ___vsprintf_chk (char *s, int flags, size_t slen, const char *format,
if (flags > 0)
f._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;
ret = INTUSE(_IO_vfprintf) ((_IO_FILE *) &f._sbf, format, args);
ret = INTUSE(_IO_vfprintf) (&f._sbf._f, format, args);
*f._sbf._f._IO_write_ptr = '\0';
return ret;
+3 -4
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc.
/* Copyright (C) 1992, 1997, 1998, 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
@@ -20,8 +20,7 @@
#include <string.h>
int
alphasort (const void *a, const void *b)
alphasort (const struct dirent **a, const struct dirent **b)
{
return strcoll ((*(const struct dirent **) a)->d_name,
(*(const struct dirent **) b)->d_name);
return strcoll ((*a)->d_name, (*b)->d_name);
}
+3 -4
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1992, 1997, 1998, 2000 Free Software Foundation, Inc.
/* Copyright (C) 1992, 1997, 1998, 2000, 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
@@ -20,8 +20,7 @@
#include <string.h>
int
alphasort64 (const void *a, const void *b)
alphasort64 (const struct dirent64 **a, const struct dirent64 **b)
{
return strcoll ((*(const struct dirent64 **) a)->d_name,
(*(const struct dirent64 **) b)->d_name);
return strcoll ((*a)->d_name, (*b)->d_name);
}
+29 -20
View File
@@ -252,7 +252,8 @@ extern int dirfd (DIR *__dirp) __THROW __nonnull ((1));
extern int scandir (__const char *__restrict __dir,
struct dirent ***__restrict __namelist,
int (*__selector) (__const struct dirent *),
int (*__cmp) (__const void *, __const void *))
int (*__cmp) (__const struct dirent **,
__const struct dirent **))
__nonnull ((1, 2));
# else
# ifdef __REDIRECT
@@ -260,7 +261,8 @@ extern int __REDIRECT (scandir,
(__const char *__restrict __dir,
struct dirent ***__restrict __namelist,
int (*__selector) (__const struct dirent *),
int (*__cmp) (__const void *, __const void *)),
int (*__cmp) (__const struct dirent **,
__const struct dirent **)),
scandir64) __nonnull ((1, 2));
# else
# define scandir scandir64
@@ -273,18 +275,21 @@ extern int __REDIRECT (scandir,
extern int scandir64 (__const char *__restrict __dir,
struct dirent64 ***__restrict __namelist,
int (*__selector) (__const struct dirent64 *),
int (*__cmp) (__const void *, __const void *))
int (*__cmp) (__const struct dirent64 **,
__const struct dirent64 **))
__nonnull ((1, 2));
# endif
/* Function to compare two `struct dirent's alphabetically. */
# ifndef __USE_FILE_OFFSET64
extern int alphasort (__const void *__e1, __const void *__e2)
extern int alphasort (__const struct dirent **__e1,
__const struct dirent **__e2)
__THROW __attribute_pure__ __nonnull ((1, 2));
# else
# ifdef __REDIRECT
extern int __REDIRECT_NTH (alphasort,
(__const void *__e1, __const void *__e2),
(__const struct dirent **__e1,
__const struct dirent **__e2),
alphasort64) __attribute_pure__ __nonnull ((1, 2));
# else
# define alphasort alphasort64
@@ -292,51 +297,54 @@ extern int __REDIRECT_NTH (alphasort,
# endif
# if defined __USE_GNU && defined __USE_LARGEFILE64
extern int alphasort64 (__const void *__e1, __const void *__e2)
extern int alphasort64 (__const struct dirent64 **__e1,
__const struct dirent64 **__e2)
__THROW __attribute_pure__ __nonnull ((1, 2));
# endif
#endif /* Use BSD or misc or XPG7. */
# if defined __USE_BSD || defined __USE_MISC
#if defined __USE_BSD || defined __USE_MISC
/* Read directory entries from FD into BUF, reading at most NBYTES.
Reading starts at offset *BASEP, and *BASEP is updated with the new
position after reading. Returns the number of bytes read; zero when at
end of directory; or -1 for errors. */
# ifndef __USE_FILE_OFFSET64
# ifndef __USE_FILE_OFFSET64
extern __ssize_t getdirentries (int __fd, char *__restrict __buf,
size_t __nbytes,
__off_t *__restrict __basep)
__THROW __nonnull ((2, 4));
# else
# ifdef __REDIRECT
# else
# ifdef __REDIRECT
extern __ssize_t __REDIRECT_NTH (getdirentries,
(int __fd, char *__restrict __buf,
size_t __nbytes,
__off64_t *__restrict __basep),
getdirentries64) __nonnull ((2, 4));
# else
# define getdirentries getdirentries64
# endif
# else
# define getdirentries getdirentries64
# endif
# endif
# ifdef __USE_LARGEFILE64
# ifdef __USE_LARGEFILE64
extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
size_t __nbytes,
__off64_t *__restrict __basep)
__THROW __nonnull ((2, 4));
# endif
# endif /* Use BSD or misc. */
#endif /* Use BSD or misc or XPG7. */
# endif
#endif /* Use BSD or misc. */
#ifdef __USE_GNU
/* Function to compare two `struct dirent's by name & version. */
# ifndef __USE_FILE_OFFSET64
extern int versionsort (__const void *__e1, __const void *__e2)
extern int versionsort (__const struct dirent **__e1,
__const struct dirent **__e2)
__THROW __attribute_pure__ __nonnull ((1, 2));
# else
# ifdef __REDIRECT
extern int __REDIRECT_NTH (versionsort,
(__const void *__e1, __const void *__e2),
(__const struct dirent **__e1,
__const struct dirent **__e2),
versionsort64)
__attribute_pure__ __nonnull ((1, 2));
# else
@@ -345,7 +353,8 @@ extern int __REDIRECT_NTH (versionsort,
# endif
# ifdef __USE_LARGEFILE64
extern int versionsort64 (__const void *__e1, __const void *__e2)
extern int versionsort64 (__const struct dirent64 **__e1,
__const struct dirent64 **__e2)
__THROW __attribute_pure__ __nonnull ((1, 2));
# endif
#endif /* Use GNU. */
+4 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1992-1998, 2000, 2002, 2003 Free Software Foundation, Inc.
/* Copyright (C) 1992-1998,2000,2002,2003,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
@@ -57,7 +57,7 @@ SCANDIR (dir, namelist, select, cmp)
const char *dir;
DIRENT_TYPE ***namelist;
int (*select) (const DIRENT_TYPE *);
int (*cmp) (const void *, const void *);
int (*cmp) (const DIRENT_TYPE **, const DIRENT_TYPE **);
{
DIR *dp = __opendir (dir);
DIRENT_TYPE **v = NULL;
@@ -134,7 +134,8 @@ SCANDIR (dir, namelist, select, cmp)
{
/* Sort the list if we have a comparison function to sort with. */
if (cmp != NULL)
qsort (v, c.cnt, sizeof (*v), cmp);
qsort (v, c.cnt, sizeof (*v),
(int (*) (const void *, const void *)) cmp);
*namelist = v;
}
+3 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation, Inc.
/* Copyright (C) 2000, 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
@@ -25,6 +25,7 @@
int scandir64 (__const char *__restrict __dir,
struct dirent64 ***__restrict __namelist,
int (*__selector) (__const struct dirent64 *),
int (*__cmp) (__const void *, __const void *));
int (*__cmp) (__const struct dirent64 **,
__const struct dirent64 **));
#include <dirent/scandir.c>
+3 -4
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc.
/* Copyright (C) 1992, 1997, 1998, 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
@@ -20,8 +20,7 @@
#include <string.h>
int
versionsort (const void *a, const void *b)
versionsort (const struct dirent **a, const struct dirent **b)
{
return __strverscmp ((*(const struct dirent **) a)->d_name,
(*(const struct dirent **) b)->d_name);
return __strverscmp ((*a)->d_name, (*b)->d_name);
}
+3 -4
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1992, 1997, 1998, 2000 Free Software Foundation, Inc.
/* Copyright (C) 1992, 1997, 1998, 2000, 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
@@ -20,8 +20,7 @@
#include <string.h>
int
versionsort64 (const void *a, const void *b)
versionsort64 (const struct dirent64 **a, const struct dirent64 **b)
{
return __strverscmp ((*(const struct dirent64 **) a)->d_name,
(*(const struct dirent64 **) b)->d_name);
return __strverscmp ((*a)->d_name, (*b)->d_name);
}
+2 -2
View File
@@ -1,5 +1,5 @@
/* Locate the shared object symbol nearest a given address.
Copyright (C) 1996-2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Copyright (C) 1996-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
@@ -132,7 +132,7 @@ _dl_addr (const void *address, Dl_info *info,
__rtld_lock_lock_recursive (GL(dl_load_lock));
/* Find the highest-addressed object that ADDRESS is not below. */
for (Lmid_t ns = 0; ns < DL_NNS; ++ns)
for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
for (struct link_map *l = GL(dl_ns)[ns]._ns_loaded; l; l = l->l_next)
if (addr >= l->l_map_start && addr < l->l_map_end
&& (l->l_contiguous || _dl_addr_inside_object (l, addr)))
+2 -2
View File
@@ -1,5 +1,5 @@
/* Check whether caller comes from the right place.
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004, 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
@@ -35,7 +35,7 @@ _dl_check_caller (const void *caller, enum allowmask mask)
#endif
static const char expected4[] = LD_SO;
for (Lmid_t ns = 0; ns < DL_NNS; ++ns)
for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
for (struct link_map *l = GL(dl_ns)[ns]._ns_loaded; l != NULL;
l = l->l_next)
if (caller >= (const void *) l->l_map_start
+14 -2
View File
@@ -1,5 +1,5 @@
/* Close a shared object opened by `_dl_open'.
Copyright (C) 1996-2005, 2006, 2007 Free Software Foundation, Inc.
Copyright (C) 1996-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
@@ -695,6 +695,18 @@ _dl_close_worker (struct link_map *map)
}
#endif
if (__builtin_expect (ns->_ns_loaded == NULL, 0)
&& nsid == GL(dl_nns) - 1)
do
{
--GL(dl_nns);
#ifndef SHARED
if (GL(dl_nns) == 0)
break;
#endif
}
while (GL(dl_ns)[GL(dl_nns) - 1]._ns_loaded == NULL);
/* Notify the debugger those objects are finalized and gone. */
r->r_state = RT_CONSISTENT;
_dl_debug_state ();
@@ -763,7 +775,7 @@ free_slotinfo (struct dtv_slotinfo_list **elemp)
libc_freeres_fn (free_mem)
{
for (Lmid_t nsid = 0; nsid < DL_NNS; ++nsid)
for (Lmid_t nsid = 0; nsid < GL(dl_nns); ++nsid)
if (__builtin_expect (GL(dl_ns)[nsid]._ns_global_scope_alloc, 0) != 0
&& (GL(dl_ns)[nsid]._ns_main_searchlist->r_nlist
// XXX Check whether we need NS-specific initial_searchlist
+2 -2
View File
@@ -1,5 +1,5 @@
/* Call the termination functions of loaded shared objects.
Copyright (C) 1995,96,1998-2002,2004, 2005 Free Software Foundation, Inc.
Copyright (C) 1995,96,1998-2002,2004-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
@@ -140,7 +140,7 @@ _dl_fini (void)
int do_audit = 0;
again:
#endif
for (Lmid_t ns = DL_NNS - 1; ns >= 0; --ns)
for (Lmid_t ns = GL(dl_nns) - 1; ns >= 0; --ns)
{
/* Protect against concurrent loads and unloads. */
__rtld_lock_lock_recursive (GL(dl_load_lock));
+2 -2
View File
@@ -1,5 +1,5 @@
/* Get loaded objects program headers.
Copyright (C) 2001-2004,2006,2007,2008 Free Software Foundation, Inc.
Copyright (C) 2001-2004, 2006-2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2001.
@@ -47,7 +47,7 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
const void *caller = RETURN_ADDRESS (0);
size_t nloaded = GL(dl_ns)[0]._ns_nloaded;
Lmid_t ns = 0;
for (Lmid_t cnt = DL_NNS - 1; cnt > 0; --cnt)
for (Lmid_t cnt = GL(dl_nns) - 1; cnt > 0; --cnt)
for (struct link_map *l = GL(dl_ns)[cnt]._ns_loaded; l; l = l->l_next)
{
/* We have to count the total number of loaded objects. */
+2 -2
View File
@@ -1,5 +1,5 @@
/* Handle loading and unloading shared objects for internal libc purposes.
Copyright (C) 1999-2002,2004,2005,2006 Free Software Foundation, Inc.
Copyright (C) 1999-2002,2004,2005,2006,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Zack Weinberg <zack@rabi.columbia.edu>, 1999.
@@ -236,7 +236,7 @@ libc_freeres_fn (free_mem)
}
/* Remove all additional names added to the objects. */
for (Lmid_t ns = 0; ns < DL_NNS; ++ns)
for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
{
struct libname_list *lnp = l->l_libname->next;
+6 -12
View File
@@ -85,14 +85,6 @@
#define STRING(x) __STRING (x)
#ifdef MAP_ANON
/* The fd is not examined when using MAP_ANON. */
# define ANONFD -1
#else
int _dl_zerofd = -1;
# define ANONFD _dl_zerofd
#endif
/* Handle situations where we have a preferred location in memory for
the shared objects. */
#ifdef ELF_PREFERRED_ADDRESS_DATA
@@ -941,7 +933,8 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
{
#ifdef SHARED
/* Auditing checkpoint: we are going to add new objects. */
if (__builtin_expect (GLRO(dl_naudit) > 0, 0))
if ((mode & __RTLD_AUDIT) == 0
&& __builtin_expect (GLRO(dl_naudit) > 0, 0))
{
struct link_map *head = GL(dl_ns)[nsid]._ns_loaded;
/* Do not call the functions for any auditing object. */
@@ -1311,7 +1304,7 @@ cannot allocate TLS data structures for initial thread");
caddr_t mapat;
mapat = __mmap ((caddr_t) zeropage, zeroend - zeropage,
c->prot, MAP_ANON|MAP_PRIVATE|MAP_FIXED,
ANONFD, 0);
-1, 0);
if (__builtin_expect (mapat == MAP_FAILED, 0))
{
errstring = N_("cannot map zero-fill pages");
@@ -1662,7 +1655,8 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
EI_PAD), 0))
{
/* Something is wrong. */
if (*(Elf32_Word *) &ehdr->e_ident !=
const Elf32_Word *magp = (const void *) ehdr->e_ident;
if (*magp !=
#if BYTE_ORDER == LITTLE_ENDIAN
((ELFMAG0 << (EI_MAG0 * 8)) |
(ELFMAG1 << (EI_MAG1 * 8)) |
@@ -1966,7 +1960,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
struct filebuf fb;
assert (nsid >= 0);
assert (nsid < DL_NNS);
assert (nsid < GL(dl_nns));
/* Look for this name among those already loaded. */
for (l = GL(dl_ns)[nsid]._ns_loaded; l; l = l->l_next)
+2 -12
View File
@@ -1,5 +1,5 @@
/* Minimal replacements for basic facilities used in the dynamic linker.
Copyright (C) 1995-1998,2000-2002,2004-2006,2007
Copyright (C) 1995-1998,2000-2002,2004-2006,2007,2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -51,16 +51,6 @@ extern unsigned long int weak_function strtoul (const char *nptr,
void * weak_function
__libc_memalign (size_t align, size_t n)
{
#ifdef MAP_ANON
#define _dl_zerofd (-1)
#else
extern int _dl_zerofd;
if (_dl_zerofd == -1)
_dl_zerofd = _dl_sysdep_open_zero_fill ();
#define MAP_ANON 0
#endif
if (alloc_end == 0)
{
/* Consume any unused space in the last page of our data segment. */
@@ -87,7 +77,7 @@ __libc_memalign (size_t align, size_t n)
nup = GLRO(dl_pagesize);
}
page = __mmap (0, nup, PROT_READ|PROT_WRITE,
MAP_ANON|MAP_PRIVATE, _dl_zerofd, 0);
MAP_ANON|MAP_PRIVATE, -1, 0);
if (page == MAP_FAILED)
return NULL;
if (page != alloc_end)
+1 -12
View File
@@ -1,5 +1,5 @@
/* Miscellaneous support functions for dynamic linker
Copyright (C) 1997-2002, 2003, 2004, 2006 Free Software Foundation, Inc.
Copyright (C) 1997-2004, 2006, 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
@@ -34,17 +34,6 @@
#include <stdio-common/_itoa.h>
#include <bits/libc-lock.h>
#ifndef MAP_ANON
/* This is the only dl-sysdep.c function that is actually needed at run-time
by _dl_map_object. */
int
_dl_sysdep_open_zero_fill (void)
{
return __open ("/dev/zero", O_RDONLY);
}
#endif
/* Read the whole contents of FILE into new mmap'd space with given
protections. *SIZEP gets the size of the file. On error MAP_FAILED
is returned. */
+38 -18
View File
@@ -1,5 +1,5 @@
/* Load a shared object at runtime, relocate it, and run its initializer.
Copyright (C) 1996-2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Copyright (C) 1996-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
@@ -206,10 +206,6 @@ dl_open_worker (void *a)
struct dl_open_args *args = a;
const char *file = args->file;
int mode = args->mode;
struct link_map *new;
int lazy;
unsigned int i;
bool any_tls = false;
struct link_map *call_map = NULL;
/* Check whether _dl_open() has been called from a valid DSO. */
@@ -232,7 +228,7 @@ dl_open_worker (void *a)
call_map = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
struct link_map *l;
for (Lmid_t ns = 0; ns < DL_NNS; ++ns)
for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
if (caller_dlopen >= (const void *) l->l_map_start
&& caller_dlopen < (const void *) l->l_map_end
@@ -263,15 +259,14 @@ dl_open_worker (void *a)
if (__builtin_expect (dst != NULL, 0))
{
size_t len = strlen (file);
size_t required;
char *new_file;
/* Determine how much space we need. We have to allocate the
memory locally. */
required = DL_DST_REQUIRED (call_map, file, len, _dl_dst_count (dst, 0));
size_t required = DL_DST_REQUIRED (call_map, file, len,
_dl_dst_count (dst, 0));
/* Get space for the new file name. */
new_file = (char *) alloca (required + 1);
char *new_file = (char *) alloca (required + 1);
/* Generate the new file name. */
_dl_dst_substitute (call_map, file, new_file, 0);
@@ -290,6 +285,7 @@ dl_open_worker (void *a)
}
/* Load the named object. */
struct link_map *new;
args->map = new = _dl_map_object (call_map, file, 0, lt_loaded, 0,
mode | __RTLD_CALLMAP, args->nsid);
@@ -331,7 +327,7 @@ dl_open_worker (void *a)
mode & (__RTLD_DLOPEN | RTLD_DEEPBIND | __RTLD_AUDIT));
/* So far, so good. Now check the versions. */
for (i = 0; i < new->l_searchlist.r_nlist; ++i)
for (unsigned int i = 0; i < new->l_searchlist.r_nlist; ++i)
if (new->l_searchlist.r_list[i]->l_real->l_versions == NULL)
(void) _dl_check_map_versions (new->l_searchlist.r_list[i]->l_real,
0, 0);
@@ -366,7 +362,9 @@ dl_open_worker (void *a)
_dl_debug_state ();
/* Only do lazy relocation if `LD_BIND_NOW' is not set. */
lazy = (mode & RTLD_BINDING_MASK) == RTLD_LAZY && GLRO(dl_lazy);
int reloc_mode = mode & __RTLD_AUDIT;
if (GLRO(dl_lazy))
reloc_mode |= mode & RTLD_LAZY;
/* Relocate the objects loaded. We do this in reverse order so that copy
relocs of earlier objects overwrite the data written by later objects. */
@@ -388,7 +386,7 @@ dl_open_worker (void *a)
start the profiling. */
struct link_map *old_profile_map = GL(dl_profile_map);
_dl_relocate_object (l, l->l_scope, 1, 1);
_dl_relocate_object (l, l->l_scope, reloc_mode | RTLD_LAZY, 1);
if (old_profile_map == NULL && GL(dl_profile_map) != NULL)
{
@@ -401,7 +399,7 @@ dl_open_worker (void *a)
}
else
#endif
_dl_relocate_object (l, l->l_scope, lazy, 0);
_dl_relocate_object (l, l->l_scope, reloc_mode, 0);
}
if (l == new)
@@ -411,7 +409,8 @@ dl_open_worker (void *a)
/* If the file is not loaded now as a dependency, add the search
list of the newly loaded object to the scope. */
for (i = 0; i < new->l_searchlist.r_nlist; ++i)
bool any_tls = false;
for (unsigned int i = 0; i < new->l_searchlist.r_nlist; ++i)
{
struct link_map *imap = new->l_searchlist.r_list[i];
@@ -491,6 +490,18 @@ dl_open_worker (void *a)
if (imap->l_need_tls_init)
{
/* For static TLS we have to allocate the memory here
and now. This includes allocating memory in the DTV.
But we cannot change any DTV other than our own. So,
if we cannot guarantee that there is room in the DTV
we don't even try it and fail the load.
XXX We could track the minimum DTV slots allocated in
all threads. */
if (! RTLD_SINGLE_THREAD_P && imap->l_tls_modid > DTV_SURPLUS)
_dl_signal_error (0, "dlopen", NULL, N_("\
cannot load any more object with static TLS"));
imap->l_need_tls_init = 0;
#ifdef SHARED
/* Update the slot information data for at least the
@@ -551,10 +562,10 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
/* Make sure we are alone. */
__rtld_lock_lock_recursive (GL(dl_load_lock));
if (nsid == LM_ID_NEWLM)
if (__builtin_expect (nsid == LM_ID_NEWLM, 0))
{
/* Find a new namespace. */
for (nsid = 1; nsid < DL_NNS; ++nsid)
for (nsid = 1; nsid < GL(dl_nns); ++nsid)
if (GL(dl_ns)[nsid]._ns_loaded == NULL)
break;
@@ -567,16 +578,25 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
no more namespaces available for dlmopen()"));
}
if (nsid == GL(dl_nns))
++GL(dl_nns);
_dl_debug_initialize (0, nsid)->r_state = RT_CONSISTENT;
}
/* Never allow loading a DSO in a namespace which is empty. Such
direct placements is only causing problems. Also don't allow
loading into a namespace used for auditing. */
else if (nsid != LM_ID_BASE && nsid != __LM_ID_CALLER
else if (__builtin_expect (nsid != LM_ID_BASE && nsid != __LM_ID_CALLER, 0)
&& (GL(dl_ns)[nsid]._ns_nloaded == 0
|| GL(dl_ns)[nsid]._ns_loaded->l_auditing))
_dl_signal_error (EINVAL, file, NULL,
N_("invalid target namespace in dlmopen()"));
#ifndef SHARED
else if ((nsid == LM_ID_BASE || nsid == __LM_ID_CALLER)
&& GL(dl_ns)[LM_ID_BASE]._ns_loaded == NULL
&& GL(dl_nns) == 0)
GL(dl_nns) = 1;
#endif
struct dl_open_args args;
args.file = file;
+44 -9
View File
@@ -1,5 +1,5 @@
/* Profiling of shared libraries.
Copyright (C) 1997-2002, 2003, 2004, 2006 Free Software Foundation, Inc.
Copyright (C) 1997-2004, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
Based on the BSD mcount implementation.
@@ -178,8 +178,6 @@ _dl_start_profile (void)
const ElfW(Phdr) *ph;
ElfW(Addr) mapstart = ~((ElfW(Addr)) 0);
ElfW(Addr) mapend = 0;
struct gmon_hdr gmon_hdr;
struct gmon_hist_hdr hist_hdr;
char *hist, *cp;
size_t idx;
size_t tossize;
@@ -251,15 +249,52 @@ _dl_start_profile (void)
+ 4 + 4 + fromssize * sizeof (struct here_cg_arc_record));
/* Create the gmon_hdr we expect or write. */
memset (&gmon_hdr, '\0', sizeof (struct gmon_hdr));
struct real_gmon_hdr
{
char cookie[4];
int32_t version;
char spare[3 * 4];
} gmon_hdr;
if (sizeof (gmon_hdr) != sizeof (struct gmon_hdr)
|| (offsetof (struct real_gmon_hdr, cookie)
!= offsetof (struct gmon_hdr, cookie))
|| (offsetof (struct real_gmon_hdr, version)
!= offsetof (struct gmon_hdr, version)))
abort ();
memcpy (&gmon_hdr.cookie[0], GMON_MAGIC, sizeof (gmon_hdr.cookie));
*(int32_t *) gmon_hdr.version = GMON_SHOBJ_VERSION;
gmon_hdr.version = GMON_SHOBJ_VERSION;
memset (gmon_hdr.spare, '\0', sizeof (gmon_hdr.spare));
/* Create the hist_hdr we expect or write. */
*(char **) hist_hdr.low_pc = (char *) mapstart;
*(char **) hist_hdr.high_pc = (char *) mapend;
*(int32_t *) hist_hdr.hist_size = kcountsize / sizeof (HISTCOUNTER);
*(int32_t *) hist_hdr.prof_rate = __profile_frequency ();
struct real_gmon_hist_hdr
{
char *low_pc;
char *high_pc;
int32_t hist_size;
int32_t prof_rate;
char dimen[15];
char dimen_abbrev;
} hist_hdr;
if (sizeof (hist_hdr) != sizeof (struct gmon_hist_hdr)
|| (offsetof (struct real_gmon_hist_hdr, low_pc)
!= offsetof (struct gmon_hist_hdr, low_pc))
|| (offsetof (struct real_gmon_hist_hdr, high_pc)
!= offsetof (struct gmon_hist_hdr, high_pc))
|| (offsetof (struct real_gmon_hist_hdr, hist_size)
!= offsetof (struct gmon_hist_hdr, hist_size))
|| (offsetof (struct real_gmon_hist_hdr, prof_rate)
!= offsetof (struct gmon_hist_hdr, prof_rate))
|| (offsetof (struct real_gmon_hist_hdr, dimen)
!= offsetof (struct gmon_hist_hdr, dimen))
|| (offsetof (struct real_gmon_hist_hdr, dimen_abbrev)
!= offsetof (struct gmon_hist_hdr, dimen_abbrev)))
abort ();
hist_hdr.low_pc = (char *) mapstart;
hist_hdr.high_pc = (char *) mapend;
hist_hdr.hist_size = kcountsize / sizeof (HISTCOUNTER);
hist_hdr.prof_rate = __profile_frequency ();
if (sizeof (hist_hdr.dimen) >= sizeof ("seconds"))
{
memcpy (hist_hdr.dimen, "seconds", sizeof ("seconds"));
+5 -3
View File
@@ -1,5 +1,5 @@
/* Relocate a shared object and resolve its references to other loaded objects.
Copyright (C) 1995-2004, 2005, 2006, 2008 Free Software Foundation, Inc.
Copyright (C) 1995-2006, 2008, 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
@@ -151,7 +151,7 @@ _dl_nothread_init_static_tls (struct link_map *map)
void
_dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
int lazy, int consider_profiling)
int reloc_mode, int consider_profiling)
{
struct textrels
{
@@ -162,10 +162,12 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
} *textrels = NULL;
/* Initialize it to make the compiler happy. */
const char *errstring = NULL;
int lazy = reloc_mode & RTLD_LAZY;
#ifdef SHARED
/* If we are auditing, install the same handlers we need for profiling. */
consider_profiling |= GLRO(dl_audit) != NULL;
if ((reloc_mode & __RTLD_AUDIT) == 0)
consider_profiling |= GLRO(dl_audit) != NULL;
#elif defined PROF
/* Never use dynamic linker profiling for gprof profiling code. */
# define consider_profiling 0
+26 -9
View File
@@ -1,5 +1,5 @@
/* On-demand PLT fixup for shared objects.
Copyright (C) 1995-2006, 2007 Free Software Foundation, Inc.
Copyright (C) 1995-2006, 2007, 2008, 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
@@ -46,6 +46,12 @@
# define ARCH_FIXUP_ATTRIBUTE
#endif
#ifndef reloc_offset
# define reloc_offset reloc_arg
# define reloc_index reloc_arg / sizeof (PLTREL)
#endif
/* This function is called through a special trampoline from the PLT the
first time each PLT entry is called. We must perform the relocation
@@ -63,7 +69,7 @@ _dl_fixup (
# endif
/* GKM FIXME: Fix trampoline to pass bounds so we can do
without the `__unbounded' qualifier. */
struct link_map *__unbounded l, ElfW(Word) reloc_offset)
struct link_map *__unbounded l, ElfW(Word) reloc_arg)
{
const ElfW(Sym) *const symtab
= (const void *) D_PTR (l, l_info[DT_SYMTAB]);
@@ -130,6 +136,9 @@ _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))
value = ((DL_FIXUP_VALUE_TYPE (*) (void)) DL_FIXUP_VALUE_ADDR (value)) ();
/* Finally, fix up the plt itself. */
if (__builtin_expect (GLRO(dl_bind_not), 0))
return value;
@@ -139,22 +148,20 @@ _dl_fixup (
#endif
#if !defined PROF && !defined ELF_MACHINE_NO_PLT && !__BOUNDED_POINTERS__
DL_FIXUP_VALUE_TYPE
__attribute ((noinline)) ARCH_FIXUP_ATTRIBUTE
_dl_profile_fixup (
#ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
ELF_MACHINE_RUNTIME_FIXUP_ARGS,
#endif
struct link_map *l, ElfW(Word) reloc_offset,
struct link_map *l, ElfW(Word) reloc_arg,
ElfW(Addr) retaddr, void *regs, long int *framesizep)
{
void (*mcount_fct) (ElfW(Addr), ElfW(Addr)) = INTUSE(_dl_mcount);
/* This is the address in the array where we store the result of previous
relocations. */
struct reloc_result *reloc_result
= &l->l_reloc_result[reloc_offset / sizeof (PLTREL)];
struct reloc_result *reloc_result = &l->l_reloc_result[reloc_index];
DL_FIXUP_VALUE_TYPE *resultp = &reloc_result->addr;
DL_FIXUP_VALUE_TYPE value = *resultp;
@@ -215,12 +222,23 @@ _dl_profile_fixup (
defsym != NULL
? LOOKUP_VALUE_ADDRESS (result)
+ defsym->st_value : 0);
if (__builtin_expect (ELFW(ST_TYPE) (defsym->st_info)
== STT_GNU_IFUNC, 0))
value = ((DL_FIXUP_VALUE_TYPE (*) (void))
DL_FIXUP_VALUE_ADDR (value)) ();
}
else
{
/* We already found the symbol. The module (and therefore its load
address) is also known. */
value = DL_FIXUP_MAKE_VALUE (l, l->l_addr + refsym->st_value);
if (__builtin_expect (ELFW(ST_TYPE) (refsym->st_info)
== STT_GNU_IFUNC, 0))
value = ((DL_FIXUP_VALUE_TYPE (*) (void))
DL_FIXUP_VALUE_ADDR (value)) ();
result = l;
}
/* And now perhaps the relocation addend. */
@@ -403,7 +421,7 @@ _dl_profile_fixup (
#include <stdio.h>
void
ARCH_FIXUP_ATTRIBUTE
_dl_call_pltexit (struct link_map *l, ElfW(Word) reloc_offset,
_dl_call_pltexit (struct link_map *l, ElfW(Word) reloc_arg,
const void *inregs, void *outregs)
{
#ifdef SHARED
@@ -411,8 +429,7 @@ _dl_call_pltexit (struct link_map *l, ElfW(Word) reloc_offset,
relocations. */
// XXX Maybe the bound information must be stored on the stack since
// XXX with bind_not a new value could have been stored in the meantime.
struct reloc_result *reloc_result
= &l->l_reloc_result[reloc_offset / sizeof (PLTREL)];
struct reloc_result *reloc_result = &l->l_reloc_result[reloc_index];
ElfW(Sym) *defsym = ((ElfW(Sym) *) D_PTR (reloc_result->bound,
l_info[DT_SYMTAB])
+ reloc_result->boundndx);
+1
View File
@@ -70,6 +70,7 @@ int _dl_bind_not;
/* Namespace information. */
struct link_namespaces _dl_ns[DL_NNS];
size_t _dl_nns;
/* Incremented whenever something may have been added to dl_loaded. */
unsigned long long _dl_load_adds;
+2 -2
View File
@@ -1,5 +1,5 @@
/* Look up a symbol in a shared object loaded by `dlopen'.
Copyright (C) 1999-2002,2004,2006,2007 Free Software Foundation, Inc.
Copyright (C) 1999-2002,2004,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
@@ -95,7 +95,7 @@ do_sym (void *handle, const char *name, void *who,
struct link_map *match = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
/* Find the highest-addressed object that CALLER is not below. */
for (Lmid_t ns = 0; ns < DL_NNS; ++ns)
for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
for (struct link_map *l = GL(dl_ns)[ns]._ns_loaded; l != NULL;
l = l->l_next)
if (caller >= l->l_map_start && caller < l->l_map_end
+30 -29
View File
@@ -269,36 +269,37 @@ _dl_show_auxv (void)
{
static const struct
{
const char label[20];
enum { unknown = 0, dec, hex, str, ignore } form;
const char label[17];
enum { unknown = 0, dec, hex, str, ignore } form : 8;
} auxvars[] =
{
[AT_EXECFD - 2] = { "AT_EXECFD: ", dec },
[AT_EXECFN - 2] = { "AT_EXECFN: ", str },
[AT_PHDR - 2] = { "AT_PHDR: 0x", hex },
[AT_PHENT - 2] = { "AT_PHENT: ", dec },
[AT_PHNUM - 2] = { "AT_PHNUM: ", dec },
[AT_PAGESZ - 2] = { "AT_PAGESZ: ", dec },
[AT_BASE - 2] = { "AT_BASE: 0x", hex },
[AT_FLAGS - 2] = { "AT_FLAGS: 0x", hex },
[AT_ENTRY - 2] = { "AT_ENTRY: 0x", hex },
[AT_NOTELF - 2] = { "AT_NOTELF: ", hex },
[AT_UID - 2] = { "AT_UID: ", dec },
[AT_EUID - 2] = { "AT_EUID: ", dec },
[AT_GID - 2] = { "AT_GID: ", dec },
[AT_EGID - 2] = { "AT_EGID: ", dec },
[AT_PLATFORM - 2] = { "AT_PLATFORM: ", str },
[AT_HWCAP - 2] = { "AT_HWCAP: ", hex },
[AT_CLKTCK - 2] = { "AT_CLKTCK: ", dec },
[AT_FPUCW - 2] = { "AT_FPUCW: ", hex },
[AT_DCACHEBSIZE - 2] = { "AT_DCACHEBSIZE: 0x", hex },
[AT_ICACHEBSIZE - 2] = { "AT_ICACHEBSIZE: 0x", hex },
[AT_UCACHEBSIZE - 2] = { "AT_UCACHEBSIZE: 0x", hex },
[AT_IGNOREPPC - 2] = { "AT_IGNOREPPC", ignore },
[AT_SECURE - 2] = { "AT_SECURE: ", dec },
[AT_SYSINFO - 2] = { "AT_SYSINFO: 0x", hex },
[AT_SYSINFO_EHDR - 2] = { "AT_SYSINFO_EHDR: 0x", hex },
[AT_RANDOM - 2] = { "AT_RANDOM: 0x", hex },
[AT_EXECFD - 2] = { "EXECFD: ", dec },
[AT_EXECFN - 2] = { "EXECFN: ", str },
[AT_PHDR - 2] = { "PHDR: 0x", hex },
[AT_PHENT - 2] = { "PHENT: ", dec },
[AT_PHNUM - 2] = { "PHNUM: ", dec },
[AT_PAGESZ - 2] = { "PAGESZ: ", dec },
[AT_BASE - 2] = { "BASE: 0x", hex },
[AT_FLAGS - 2] = { "FLAGS: 0x", hex },
[AT_ENTRY - 2] = { "ENTRY: 0x", hex },
[AT_NOTELF - 2] = { "NOTELF: ", hex },
[AT_UID - 2] = { "UID: ", dec },
[AT_EUID - 2] = { "EUID: ", dec },
[AT_GID - 2] = { "GID: ", dec },
[AT_EGID - 2] = { "EGID: ", dec },
[AT_PLATFORM - 2] = { "PLATFORM: ", str },
[AT_HWCAP - 2] = { "HWCAP: ", hex },
[AT_CLKTCK - 2] = { "CLKTCK: ", dec },
[AT_FPUCW - 2] = { "FPUCW: ", hex },
[AT_DCACHEBSIZE - 2] = { "DCACHEBSIZE: 0x", hex },
[AT_ICACHEBSIZE - 2] = { "ICACHEBSIZE: 0x", hex },
[AT_UCACHEBSIZE - 2] = { "UCACHEBSIZE: 0x", hex },
[AT_IGNOREPPC - 2] = { "IGNOREPPC", ignore },
[AT_SECURE - 2] = { "SECURE: ", dec },
[AT_BASE_PLATFORM - 2] = { "BASE_PLATFORM:", str },
[AT_SYSINFO - 2] = { "SYSINFO: 0x", hex },
[AT_SYSINFO_EHDR - 2] = { "SYSINFO_EHDR: 0x", hex },
[AT_RANDOM - 2] = { "RANDOM: 0x", hex },
};
unsigned int idx = (unsigned int) (av->a_type - 2);
@@ -327,7 +328,7 @@ _dl_show_auxv (void)
val = _itoa ((unsigned long int) av->a_un.a_val,
buf + sizeof buf - 1, 16, 0);
_dl_printf ("%s%s\n", auxvars[idx].label, val);
_dl_printf ("AT_%s%s\n", auxvars[idx].label, val);
continue;
}
+10 -8
View File
@@ -1,5 +1,5 @@
/* Look up a symbol in the loaded objects.
Copyright (C) 1995-2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Copyright (C) 1995-2007, 2008, 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
@@ -79,19 +79,21 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
__attribute_noinline__
check_match (const ElfW(Sym) *sym)
{
unsigned int stt = ELFW(ST_TYPE) (sym->st_info);
assert (ELF_RTYPE_CLASS_PLT == 1);
if (__builtin_expect ((sym->st_value == 0 /* No value. */
&& ELFW(ST_TYPE) (sym->st_info) != STT_TLS)
&& stt != STT_TLS)
|| (type_class & (sym->st_shndx == SHN_UNDEF)),
0))
return NULL;
if (__builtin_expect (ELFW(ST_TYPE) (sym->st_info) > STT_FUNC
&& ELFW(ST_TYPE) (sym->st_info) != STT_COMMON
&& ELFW(ST_TYPE) (sym->st_info) != STT_TLS, 0))
/* Ignore all but STT_NOTYPE, STT_OBJECT, STT_FUNC, and STT_COMMON
entries (and STT_TLS if TLS is supported) since these
are no code/data definitions. */
if (__builtin_expect (stt > STT_FUNC
&& stt != STT_COMMON
&& stt != STT_TLS
&& stt != STT_GNU_IFUNC, 0))
/* Ignore all but STT_NOTYPE, STT_OBJECT, STT_FUNC, STT_COMMON,
STT_TLS, and STT_GNU_IFUNC since these are no code/data
definitions. */
return NULL;
if (sym != ref && strcmp (strtab + sym->st_name, undef_name))
+57 -24
View File
@@ -1,5 +1,5 @@
/* This file defines standard ELF types, structures, and macros.
Copyright (C) 1995-2003,2004,2005,2006,2007,2008
Copyright (C) 1995-2003,2004,2005,2006,2007,2008,2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -459,6 +459,7 @@ typedef struct
#define STT_TLS 6 /* Symbol is thread-local data object*/
#define STT_NUM 7 /* Number of defined types. */
#define STT_LOOS 10 /* Start of OS-specific */
#define STT_GNU_IFUNC 10 /* Symbol is indirect code object */
#define STT_HIOS 12 /* End of OS-specific */
#define STT_LOPROC 13 /* Start of processor-specific */
#define STT_HIPROC 15 /* End of processor-specific */
@@ -1245,6 +1246,7 @@ typedef struct
#define R_SPARC_PC_LM22 39 /* Low miggle 22 bits of ... */
#define R_SPARC_WDISP16 40 /* PC relative 16 bit shifted */
#define R_SPARC_WDISP19 41 /* PC relative 19 bit shifted */
#define R_SPARC_GLOB_JMP 42 /* was part of v9 ABI but was removed */
#define R_SPARC_7 43 /* Direct 7 bit */
#define R_SPARC_5 44 /* Direct 5 bit */
#define R_SPARC_6 45 /* Direct 6 bit */
@@ -1282,8 +1284,19 @@ typedef struct
#define R_SPARC_TLS_DTPOFF64 77
#define R_SPARC_TLS_TPOFF32 78
#define R_SPARC_TLS_TPOFF64 79
#define R_SPARC_GOTDATA_HIX22 80
#define R_SPARC_GOTDATA_LOX10 81
#define R_SPARC_GOTDATA_OP_HIX22 82
#define R_SPARC_GOTDATA_OP_LOX10 83
#define R_SPARC_GOTDATA_OP 84
#define R_SPARC_H34 85
#define R_SPARC_SIZE32 86
#define R_SPARC_SIZE64 87
#define R_SPARC_GNU_VTINHERIT 250
#define R_SPARC_GNU_VTENTRY 251
#define R_SPARC_REV32 252
/* Keep this the last entry. */
#define R_SPARC_NUM 80
#define R_SPARC_NUM 253
/* For Sparc64, legal values for d_tag of Elf64_Dyn. */
@@ -2192,42 +2205,62 @@ typedef Elf32_Addr Elf32_Conflict;
/* ARM specific declarations */
/* Processor specific flags for the ELF header e_flags field. */
#define EF_ARM_RELEXEC 0x01
#define EF_ARM_HASENTRY 0x02
#define EF_ARM_INTERWORK 0x04
#define EF_ARM_APCS_26 0x08
#define EF_ARM_APCS_FLOAT 0x10
#define EF_ARM_PIC 0x20
#define EF_ARM_ALIGN8 0x40 /* 8-bit structure alignment is in use */
#define EF_ARM_NEW_ABI 0x80
#define EF_ARM_OLD_ABI 0x100
#define EF_ARM_RELEXEC 0x01
#define EF_ARM_HASENTRY 0x02
#define EF_ARM_INTERWORK 0x04
#define EF_ARM_APCS_26 0x08
#define EF_ARM_APCS_FLOAT 0x10
#define EF_ARM_PIC 0x20
#define EF_ARM_ALIGN8 0x40 /* 8-bit structure alignment is in use */
#define EF_ARM_NEW_ABI 0x80
#define EF_ARM_OLD_ABI 0x100
#define EF_ARM_SOFT_FLOAT 0x200
#define EF_ARM_VFP_FLOAT 0x400
#define EF_ARM_MAVERICK_FLOAT 0x800
/* Other constants defined in the ARM ELF spec. version B-01. */
/* NB. These conflict with values defined above. */
#define EF_ARM_SYMSARESORTED 0x04
#define EF_ARM_DYNSYMSUSESEGIDX 0x08
#define EF_ARM_DYNSYMSUSESEGIDX 0x08
#define EF_ARM_MAPSYMSFIRST 0x10
#define EF_ARM_EABIMASK 0XFF000000
#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
#define EF_ARM_EABI_UNKNOWN 0x00000000
#define EF_ARM_EABI_VER1 0x01000000
#define EF_ARM_EABI_VER2 0x02000000
/* Constants defined in AAELF. */
#define EF_ARM_BE8 0x00800000
#define EF_ARM_LE8 0x00400000
/* Additional symbol types for Thumb */
#define STT_ARM_TFUNC 0xd
#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
#define EF_ARM_EABI_UNKNOWN 0x00000000
#define EF_ARM_EABI_VER1 0x01000000
#define EF_ARM_EABI_VER2 0x02000000
#define EF_ARM_EABI_VER3 0x03000000
#define EF_ARM_EABI_VER4 0x04000000
#define EF_ARM_EABI_VER5 0x05000000
/* Additional symbol types for Thumb. */
#define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */
#define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */
/* ARM-specific values for sh_flags */
#define SHF_ARM_ENTRYSECT 0x10000000 /* Section contains an entry point */
#define SHF_ARM_COMDEF 0x80000000 /* Section may be multiply defined
in the input to a link step */
#define SHF_ARM_ENTRYSECT 0x10000000 /* Section contains an entry point */
#define SHF_ARM_COMDEF 0x80000000 /* Section may be multiply defined
in the input to a link step. */
/* ARM-specific program header flags */
#define PF_ARM_SB 0x10000000 /* Segment contains the location
addressed by the static base */
#define PF_ARM_SB 0x10000000 /* Segment contains the location
addressed by the static base. */
#define PF_ARM_PI 0x20000000 /* Position-independent segment. */
#define PF_ARM_ABS 0x40000000 /* Absolute segment. */
/* Processor specific values for the Phdr p_type field. */
#define PT_ARM_EXIDX 0x70000001 /* .ARM.exidx segment */
#define PT_ARM_EXIDX (PT_LOPROC + 1) /* ARM unwind segment. */
/* Processor specific values for the Shdr sh_type field. */
#define SHT_ARM_EXIDX (SHT_LOPROC + 1) /* ARM unwind section. */
#define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2) /* Preemption details. */
#define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3) /* ARM attributes section. */
/* ARM relocs. */
+20 -24
View File
@@ -24,7 +24,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/mman.h> /* Check if MAP_ANON is defined. */
#include <sys/mman.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <ldsodefs.h>
@@ -125,8 +125,9 @@ struct rtld_global _rtld_global =
/* Default presumption without further information is executable stack. */
._dl_stack_flags = PF_R|PF_W|PF_X,
#ifdef _LIBC_REENTRANT
._dl_load_lock = _RTLD_LOCK_RECURSIVE_INITIALIZER
._dl_load_lock = _RTLD_LOCK_RECURSIVE_INITIALIZER,
#endif
._dl_nns = 1
};
/* If we would use strong_alias here the compiler would see a
non-hidden definition. This would undo the effect of the previous
@@ -574,7 +575,7 @@ _dl_start (void *arg)
struct relocate_args
{
struct link_map *l;
int lazy;
int reloc_mode;
};
struct map_args
@@ -613,7 +614,7 @@ relocate_doit (void *a)
{
struct relocate_args *args = (struct relocate_args *) a;
_dl_relocate_object (args->l, args->l->l_scope, args->lazy, 0);
_dl_relocate_object (args->l, args->l->l_scope, args->reloc_mode, 0);
}
static void
@@ -1011,7 +1012,8 @@ of this helper program; chances are you did not intend to run this program.\n\
--library-path PATH use given PATH instead of content of the environment\n\
variable LD_LIBRARY_PATH\n\
--inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\
in LIST\n");
in LIST\n\
--audit LIST use objects named in LIST as auditors\n");
++_dl_skip_args;
--_dl_argc;
@@ -1781,12 +1783,6 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
for (i = main_map->l_searchlist.r_nlist; i > 0; )
main_map->l_searchlist.r_list[--i]->l_global = 1;
#ifndef MAP_ANON
/* We are done mapping things, so close the zero-fill descriptor. */
__close (_dl_zerofd);
_dl_zerofd = -1;
#endif
/* Remove _dl_rtld_map from the chain. */
GL(dl_rtld_map).l_prev->l_next = GL(dl_rtld_map).l_next;
if (GL(dl_rtld_map).l_next != NULL)
@@ -1908,7 +1904,9 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
struct link_map *l = main_map;
/* Relocate the main executable. */
struct relocate_args args = { .l = l, .lazy = GLRO(dl_lazy) };
struct relocate_args args = { .l = l,
.reloc_mode = (GLRO(dl_lazy)
? RTLD_LAZY : 0) };
_dl_receive_error (print_unresolved, relocate_doit, &args);
/* This loop depends on the dependencies of the executable to
@@ -1985,7 +1983,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
struct relocate_args args;
struct link_map *l;
args.lazy = GLRO(dl_lazy);
args.reloc_mode = GLRO(dl_lazy) ? RTLD_LAZY : 0;
l = main_map;
while (l->l_next != NULL)
@@ -2183,8 +2181,6 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
if (l->l_tls_blocksize != 0 && tls_init_tp_called)
_dl_add_to_slotinfo (l);
}
_dl_sysdep_start_cleanup ();
}
else
{
@@ -2225,7 +2221,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
}
if (l != &GL(dl_rtld_map))
_dl_relocate_object (l, l->l_scope, GLRO(dl_lazy),
_dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0,
consider_profiling);
/* Add object to slot information data if necessasy. */
@@ -2239,13 +2235,6 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
HP_TIMING_DIFF (relocate_time, start, stop);
/* Do any necessary cleanups for the startup OS interface code.
We do these now so that no calls are made after rtld re-relocation
which might be resolved to different functions than we expect.
We cannot do this before relocating the other objects because
_dl_relocate_object might need to call `mprotect' for DT_TEXTREL. */
_dl_sysdep_start_cleanup ();
/* Now enable profiling if needed. Like the previous call,
this has to go here because the calls it makes should use the
rtld versions of the functions (particularly calloc()), but it
@@ -2301,6 +2290,13 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
HP_TIMING_ACCUM_NT (relocate_time, add);
}
/* Do any necessary cleanups for the startup OS interface code.
We do these now so that no calls are made after rtld re-relocation
which might be resolved to different functions than we expect.
We cannot do this before relocating the other objects because
_dl_relocate_object might need to call `mprotect' for DT_TEXTREL. */
_dl_sysdep_start_cleanup ();
#ifdef SHARED
/* Auditing checkpoint: we have added all objects. */
if (__builtin_expect (GLRO(dl_naudit) > 0, 0))
@@ -2756,7 +2752,7 @@ print_statistics (hp_timing_t *rtld_total_timep)
#endif
unsigned long int num_relative_relocations = 0;
for (Lmid_t ns = 0; ns < DL_NNS; ++ns)
for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
{
if (GL(dl_ns)[ns]._ns_loaded == NULL)
continue;
+53 -16
View File
@@ -87,7 +87,7 @@ static const struct argp_option options[] =
/* Short description of program. */
static const char doc[] = N_("Read and display shared object profiling data.");
//For bug reporting instructions, please see:\n \
//For bug reporting instructions, please see:\n
//<http://www.gnu.org/software/libc/bugs.html>.\n");
/* Strings for arguments in help texts. */
@@ -195,13 +195,24 @@ struct shobj
};
struct real_gmon_hist_hdr
{
char *low_pc;
char *high_pc;
int32_t hist_size;
int32_t prof_rate;
char dimen[15];
char dimen_abbrev;
};
struct profdata
{
void *addr;
off_t size;
char *hist;
struct gmon_hist_hdr *hist_hdr;
struct real_gmon_hist_hdr *hist_hdr;
uint16_t *kcount;
uint32_t narcs; /* Number of arcs in toset. */
struct here_cg_arc_record *data;
@@ -740,8 +751,6 @@ load_profdata (const char *name, struct shobj *shobj)
int fd;
struct stat st;
void *addr;
struct gmon_hdr gmon_hdr;
struct gmon_hist_hdr hist_hdr;
uint32_t *narcsp;
size_t fromlimit;
struct here_cg_arc_record *data;
@@ -828,10 +837,10 @@ load_profdata (const char *name, struct shobj *shobj)
/* Pointer to data after the header. */
result->hist = (char *) ((struct gmon_hdr *) addr + 1);
result->hist_hdr = (struct gmon_hist_hdr *) ((char *) result->hist
+ sizeof (uint32_t));
result->hist_hdr = (struct real_gmon_hist_hdr *) ((char *) result->hist
+ sizeof (uint32_t));
result->kcount = (uint16_t *) ((char *) result->hist + sizeof (uint32_t)
+ sizeof (struct gmon_hist_hdr));
+ sizeof (struct real_gmon_hist_hdr));
/* Compute pointer to array of the arc information. */
narcsp = (uint32_t *) ((char *) result->kcount + shobj->kcountsize
@@ -841,18 +850,46 @@ load_profdata (const char *name, struct shobj *shobj)
+ sizeof (uint32_t));
/* Create the gmon_hdr we expect or write. */
memset (&gmon_hdr, '\0', sizeof (struct gmon_hdr));
struct real_gmon_hdr
{
char cookie[4];
int32_t version;
char spare[3 * 4];
} gmon_hdr;
if (sizeof (gmon_hdr) != sizeof (struct gmon_hdr)
|| (offsetof (struct real_gmon_hdr, cookie)
!= offsetof (struct gmon_hdr, cookie))
|| (offsetof (struct real_gmon_hdr, version)
!= offsetof (struct gmon_hdr, version)))
abort ();
memcpy (&gmon_hdr.cookie[0], GMON_MAGIC, sizeof (gmon_hdr.cookie));
*(int32_t *) gmon_hdr.version = GMON_SHOBJ_VERSION;
gmon_hdr.version = GMON_SHOBJ_VERSION;
memset (gmon_hdr.spare, '\0', sizeof (gmon_hdr.spare));
/* Create the hist_hdr we expect or write. */
*(char **) hist_hdr.low_pc = (char *) shobj->lowpc - shobj->map->l_addr;
*(char **) hist_hdr.high_pc = (char *) shobj->highpc - shobj->map->l_addr;
struct real_gmon_hist_hdr hist_hdr;
if (sizeof (hist_hdr) != sizeof (struct gmon_hist_hdr)
|| (offsetof (struct real_gmon_hist_hdr, low_pc)
!= offsetof (struct gmon_hist_hdr, low_pc))
|| (offsetof (struct real_gmon_hist_hdr, high_pc)
!= offsetof (struct gmon_hist_hdr, high_pc))
|| (offsetof (struct real_gmon_hist_hdr, hist_size)
!= offsetof (struct gmon_hist_hdr, hist_size))
|| (offsetof (struct real_gmon_hist_hdr, prof_rate)
!= offsetof (struct gmon_hist_hdr, prof_rate))
|| (offsetof (struct real_gmon_hist_hdr, dimen)
!= offsetof (struct gmon_hist_hdr, dimen))
|| (offsetof (struct real_gmon_hist_hdr, dimen_abbrev)
!= offsetof (struct gmon_hist_hdr, dimen_abbrev)))
abort ();
hist_hdr.low_pc = (char *) shobj->lowpc - shobj->map->l_addr;
hist_hdr.high_pc = (char *) shobj->highpc - shobj->map->l_addr;
if (do_test)
printf ("low_pc = %p\nhigh_pc = %p\n",
*(char **) hist_hdr.low_pc, *(char **) hist_hdr.high_pc);
*(int32_t *) hist_hdr.hist_size = shobj->kcountsize / sizeof (HISTCOUNTER);
*(int32_t *) hist_hdr.prof_rate = __profile_frequency ();
printf ("low_pc = %p\nhigh_pc = %p\n", hist_hdr.low_pc, hist_hdr.high_pc);
hist_hdr.hist_size = shobj->kcountsize / sizeof (HISTCOUNTER);
hist_hdr.prof_rate = __profile_frequency ();
strncpy (hist_hdr.dimen, "seconds", sizeof (hist_hdr.dimen));
hist_hdr.dimen_abbrev = 's';
@@ -1280,7 +1317,7 @@ generate_flat_profile (struct profdata *profdata)
size_t n;
void *data = NULL;
tick_unit = 1.0 / *(uint32_t *) profdata->hist_hdr->prof_rate;
tick_unit = 1.0 / profdata->hist_hdr->prof_rate;
printf ("Flat profile:\n\n"
"Each sample counts as %g %s.\n",
+43 -9
View File
@@ -40,6 +40,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <unistd.h>
#include <libc-internal.h>
#include <not-cancel.h>
@@ -180,10 +181,18 @@ write_hist (fd)
int fd;
{
u_char tag = GMON_TAG_TIME_HIST;
struct gmon_hist_hdr thdr __attribute__ ((aligned (__alignof__ (char *))));
if (_gmonparam.kcountsize > 0)
{
struct real_gmon_hist_hdr
{
char *low_pc;
char *high_pc;
int32_t hist_size;
int32_t prof_rate;
char dimen[15];
char dimen_abbrev;
} thdr;
struct iovec iov[3] =
{
{ &tag, sizeof (tag) },
@@ -191,11 +200,25 @@ write_hist (fd)
{ _gmonparam.kcount, _gmonparam.kcountsize }
};
*(char **) thdr.low_pc = (char *) _gmonparam.lowpc;
*(char **) thdr.high_pc = (char *) _gmonparam.highpc;
*(int32_t *) thdr.hist_size = (_gmonparam.kcountsize
/ sizeof (HISTCOUNTER));
*(int32_t *) thdr.prof_rate = __profile_frequency ();
if (sizeof (thdr) != sizeof (struct gmon_hist_hdr)
|| (offsetof (struct real_gmon_hist_hdr, low_pc)
!= offsetof (struct gmon_hist_hdr, low_pc))
|| (offsetof (struct real_gmon_hist_hdr, high_pc)
!= offsetof (struct gmon_hist_hdr, high_pc))
|| (offsetof (struct real_gmon_hist_hdr, hist_size)
!= offsetof (struct gmon_hist_hdr, hist_size))
|| (offsetof (struct real_gmon_hist_hdr, prof_rate)
!= offsetof (struct gmon_hist_hdr, prof_rate))
|| (offsetof (struct real_gmon_hist_hdr, dimen)
!= offsetof (struct gmon_hist_hdr, dimen))
|| (offsetof (struct real_gmon_hist_hdr, dimen_abbrev)
!= offsetof (struct gmon_hist_hdr, dimen_abbrev)))
abort ();
thdr.low_pc = (char *) _gmonparam.lowpc;
thdr.high_pc = (char *) _gmonparam.highpc;
thdr.hist_size = _gmonparam.kcountsize / sizeof (HISTCOUNTER);
thdr.prof_rate = __profile_frequency ();
strncpy (thdr.dimen, "seconds", sizeof (thdr.dimen));
thdr.dimen_abbrev = 's';
@@ -318,7 +341,6 @@ write_bb_counts (fd)
static void
write_gmon (void)
{
struct gmon_hdr ghdr __attribute__ ((aligned (__alignof__ (int))));
int fd = -1;
char *env;
@@ -350,9 +372,21 @@ write_gmon (void)
}
/* write gmon.out header: */
memset (&ghdr, '\0', sizeof (struct gmon_hdr));
struct real_gmon_hdr
{
char cookie[4];
int32_t version;
char spare[3 * 4];
} ghdr;
if (sizeof (ghdr) != sizeof (struct gmon_hdr)
|| (offsetof (struct real_gmon_hdr, cookie)
!= offsetof (struct gmon_hdr, cookie))
|| (offsetof (struct real_gmon_hdr, version)
!= offsetof (struct gmon_hdr, version)))
abort ();
memcpy (&ghdr.cookie[0], GMON_MAGIC, sizeof (ghdr.cookie));
*(int32_t *) ghdr.version = GMON_VERSION;
ghdr.version = GMON_VERSION;
memset (ghdr.spare, '\0', sizeof (ghdr.spare));
write_not_cancel (fd, &ghdr, sizeof (struct gmon_hdr));
/* write PC histogram: */
+38
View File
@@ -0,0 +1,38 @@
# Copyright (C) 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
# 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.
#
# Makefile for gshadow.
#
subdir := gshadow
headers = gshadow.h
routines = getsgent getsgnam sgetsgent fgetsgent putsgent \
getsgent_r getsgnam_r sgetsgent_r fgetsgent_r
tests = tst-gshadow
CFLAGS-getsgent_r.c = -fexceptions
CFLAGS-getsgent.c = -fexceptions
CFLAGS-fgetsgent.c = -fexceptions
CFLAGS-fgetsgent_r.c = -fexceptions -D_IO_MTSAFE_IO
CFLAGS-putsgent.c = -fexceptions -D_IO_MTSAFE_IO
CFLAGS-getsgnam.c = -fexceptions
CFLAGS-getsgnam_r.c = -fexceptions
include ../Rules
+21
View File
@@ -0,0 +1,21 @@
libc {
GLIBC_2.10 {
# e*
endsgent;
# f*
fgetsgent; fgetsgent_r;
# g*
getsgent; getsgent_r; getsgnam; getsgnam_r;
# p*
putsgent;
# s*
setsgent;
# s*
sgetsgent; sgetsgent_r;
}
}
+88
View File
@@ -0,0 +1,88 @@
/* Copyright (C) 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
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 <errno.h>
#include <bits/libc-lock.h>
#include <gshadow.h>
#include <stdio.h>
#include <stdlib.h>
/* A reasonable size for a buffer to start with. */
#define BUFLEN_SPWD 1024
/* We need to protect the dynamic buffer handling. */
__libc_lock_define_initialized (static, lock);
libc_freeres_ptr (static char *buffer);
/* Read one shadow entry from the given stream. */
struct sgrp *
fgetsgent (FILE *stream)
{
static size_t buffer_size;
static struct sgrp resbuf;
fpos_t pos;
struct sgrp *result;
int save;
if (fgetpos (stream, &pos) != 0)
return NULL;
/* Get lock. */
__libc_lock_lock (lock);
/* Allocate buffer if not yet available. */
if (buffer == NULL)
{
buffer_size = BUFLEN_SPWD;
buffer = malloc (buffer_size);
}
while (buffer != NULL
&& (__fgetsgent_r (stream, &resbuf, buffer, buffer_size, &result)
== ERANGE))
{
char *new_buf;
buffer_size += BUFLEN_SPWD;
new_buf = realloc (buffer, buffer_size);
if (new_buf == NULL)
{
/* We are out of memory. Free the current buffer so that the
process gets a chance for a normal termination. */
save = errno;
free (buffer);
__set_errno (save);
}
buffer = new_buf;
/* Reset the stream. */
if (fsetpos (stream, &pos) != 0)
buffer = NULL;
}
if (buffer == NULL)
result = NULL;
/* Release lock. Preserve error value. */
save = errno;
__libc_lock_unlock (lock);
__set_errno (save);
return result;
}
+76
View File
@@ -0,0 +1,76 @@
/* Copyright (C) 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
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 <ctype.h>
#include <errno.h>
#include <gshadow.h>
#include <stdio.h>
/* Define a line parsing function using the common code
used in the nss_files module. */
#define STRUCTURE sgrp
#define ENTNAME sgent
#define EXTERN_PARSER 1
struct sgent_data {};
#include <nss/nss_files/files-parse.c>
/* Read one shadow entry from the given stream. */
int
__fgetsgent_r (FILE *stream, struct sgrp *resbuf, char *buffer, size_t buflen,
struct sgrp **result)
{
char *p;
_IO_flockfile (stream);
do
{
buffer[buflen - 1] = '\xff';
p = fgets_unlocked (buffer, buflen, stream);
if (p == NULL && feof_unlocked (stream))
{
_IO_funlockfile (stream);
*result = NULL;
__set_errno (ENOENT);
return errno;
}
if (p == NULL || buffer[buflen - 1] != '\xff')
{
_IO_funlockfile (stream);
*result = NULL;
__set_errno (ERANGE);
return errno;
}
/* Skip leading blanks. */
while (isspace (*p))
++p;
} while (*p == '\0' || *p == '#' || /* Ignore empty and comment lines. */
/* Parse the line. If it is invalid, loop to
get the next line of the file to parse. */
! parse_line (buffer, (void *) resbuf, (void *) buffer, buflen,
&errno));
_IO_funlockfile (stream);
*result = resbuf;
return 0;
}
weak_alias (__fgetsgent_r, fgetsgent_r)
+30
View File
@@ -0,0 +1,30 @@
/* Copyright (C) 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2009.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <gshadow.h>
#define LOOKUP_TYPE struct sgrp
#define SETFUNC_NAME setsgent
#define GETFUNC_NAME getsgent
#define ENDFUNC_NAME endsgent
#define DATABASE_NAME gshadow
#define BUFLEN 1024
#include "../nss/getXXent.c"
+31
View File
@@ -0,0 +1,31 @@
/* Copyright (C) 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2009.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <gshadow.h>
#define LOOKUP_TYPE struct sgrp
#define SETFUNC_NAME setsgent
#define GETFUNC_NAME getsgent
#define ENDFUNC_NAME endsgent
#define DATABASE_NAME gshadow
#define BUFLEN 1024
#define NO_COMPAT_NEEDED 1
#include "../nss/getXXent_r.c"
+30
View File
@@ -0,0 +1,30 @@
/* Copyright (C) 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2009.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <gshadow.h>
#define LOOKUP_TYPE struct sgrp
#define FUNCTION_NAME getsgnam
#define DATABASE_NAME gshadow
#define ADD_PARAMS const char *name
#define ADD_VARIABLES name
#define BUFLEN 1024
#include "../nss/getXXbyYY.c"
+31
View File
@@ -0,0 +1,31 @@
/* Copyright (C) 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2009.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <gshadow.h>
#define LOOKUP_TYPE struct sgrp
#define FUNCTION_NAME getsgnam
#define DATABASE_NAME gshadow
#define ADD_PARAMS const char *name
#define ADD_VARIABLES name
#define BUFLEN 1024
#define NO_COMPAT_NEEDED 1
#include "../nss/getXXbyYY_r.c"
+131
View File
@@ -0,0 +1,131 @@
/* Copyright (C) 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
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. */
/* Declaration of types and functions for shadow group suite. */
#ifndef _GSHADOW_H
#define _GSHADOW_H 1
#include <features.h>
#include <paths.h>
#define __need_FILE
#include <stdio.h>
#define __need_size_t
#include <stddef.h>
/* Path to the user database files. */
#define GSHADOW _PATH_GSHADOW
__BEGIN_DECLS
/* Structure of the group file. */
struct sgrp
{
char *sg_namp; /* Group name. */
char *sg_passwd; /* Encrypted password. */
char **sg_adm; /* Group administrator list. */
char **sg_mem; /* Group member list. */
};
/* Open database for reading.
This function is not part of POSIX and therefore no official
cancellation point. But due to similarity with an POSIX interface
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
extern void setsgent (void);
/* Close database.
This function is not part of POSIX and therefore no official
cancellation point. But due to similarity with an POSIX interface
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
extern void endsgent (void);
/* Get next entry from database, perhaps after opening the file.
This function is not part of POSIX and therefore no official
cancellation point. But due to similarity with an POSIX interface
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
extern struct sgrp *getsgent (void);
/* Get shadow entry matching NAME.
This function is not part of POSIX and therefore no official
cancellation point. But due to similarity with an POSIX interface
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
extern struct sgrp *getsgnam (__const char *__name);
/* Read shadow entry from STRING.
This function is not part of POSIX and therefore no official
cancellation point. But due to similarity with an POSIX interface
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
extern struct sgrp *sgetsgent (__const char *__string);
/* Read next shadow entry from STREAM.
This function is not part of POSIX and therefore no official
cancellation point. But due to similarity with an POSIX interface
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
extern struct sgrp *fgetsgent (FILE *__stream);
/* Write line containing shadow password entry to stream.
This function is not part of POSIX and therefore no official
cancellation point. But due to similarity with an POSIX interface
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
extern int putsgent (__const struct sgrp *__g, FILE *__stream);
#ifdef __USE_MISC
/* Reentrant versions of some of the functions above.
These functions are not part of POSIX and therefore no official
cancellation point. But due to similarity with an POSIX interface
or due to the implementation they are cancellation points and
therefore not marked with __THROW. */
extern int getsgent_r (struct sgrp *__result_buf, char *__buffer,
size_t __buflen, struct sgrp **__result);
extern int getsgnam_r (__const char *__name, struct sgrp *__result_buf,
char *__buffer, size_t __buflen,
struct sgrp **__result);
extern int sgetsgent_r (__const char *__string, struct sgrp *__result_buf,
char *__buffer, size_t __buflen,
struct sgrp **__result);
extern int fgetsgent_r (FILE *__stream, struct sgrp *__result_buf,
char *__buffer, size_t __buflen,
struct sgrp **__result);
#endif /* misc */
__END_DECLS
#endif /* gshadow.h */
+71
View File
@@ -0,0 +1,71 @@
/* Copyright (C) 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
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 <stdbool.h>
#include <stdio.h>
#include <gshadow.h>
#define _S(x) x ? x : ""
/* Write an entry to the given stream.
This must know the format of the group file. */
int
putsgent (const struct sgrp *g, FILE *stream)
{
int errors = 0;
_IO_flockfile (stream);
if (fprintf (stream, "%s:%s:", g->sg_namp, _S (g->sg_passwd)) < 0)
++errors;
bool first = true;
char **sp = g->sg_adm;
if (sp != NULL)
while (*sp != NULL)
{
if (fprintf (stream, "%s%s", first ? "" : ",", *sp++) < 0)
{
++errors;
break;
}
first = false;
}
if (putc_unlocked (':', stream) == EOF)
++errors;
first = true;
sp = g->sg_mem;
if (sp != NULL)
while (*sp != NULL)
{
if (fprintf (stream, "%s%s", first ? "" : ",", *sp++) < 0)
{
++errors;
break;
}
first = false;
}
if (putc_unlocked ('\n', stream) == EOF)
++errors;
_IO_funlockfile (stream);
return errors ? -1 : 0;
}
+78
View File
@@ -0,0 +1,78 @@
/* Copyright (C) 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
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 <errno.h>
#include <bits/libc-lock.h>
#include <gshadow.h>
#include <stdlib.h>
/* A reasonable size for a buffer to start with. */
#define BUFLEN_SPWD 1024
/* We need to protect the dynamic buffer handling. */
__libc_lock_define_initialized (static, lock);
/* Read one shadow entry from the given stream. */
struct sgrp *
sgetsgent (const char *string)
{
static char *buffer;
static size_t buffer_size;
static struct sgrp resbuf;
struct sgrp *result;
int save;
/* Get lock. */
__libc_lock_lock (lock);
/* Allocate buffer if not yet available. */
if (buffer == NULL)
{
buffer_size = BUFLEN_SPWD;
buffer = malloc (buffer_size);
}
while (buffer != NULL
&& __sgetsgent_r (string, &resbuf, buffer, buffer_size, &result) != 0
&& errno == ERANGE)
{
char *new_buf;
buffer_size += BUFLEN_SPWD;
new_buf = realloc (buffer, buffer_size);
if (new_buf == NULL)
{
/* We are out of memory. Free the current buffer so that the
process gets a chance for a normal termination. */
save = errno;
free (buffer);
__set_errno (save);
}
buffer = new_buf;
}
if (buffer == NULL)
result = NULL;
/* Release lock. Preserve error value. */
save = errno;
__libc_lock_unlock (lock);
__set_errno (save);
return result;
}
+75
View File
@@ -0,0 +1,75 @@
/* Copyright (C) 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
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 <ctype.h>
#include <errno.h>
#include <gshadow.h>
#include <stdio.h>
#include <string.h>
/* Define a line parsing function using the common code
used in the nss_files module. */
#define STRUCTURE sgrp
#define ENTNAME sgent
struct sgent_data {};
#define TRAILING_LIST_MEMBER sg_mem
#define TRAILING_LIST_SEPARATOR_P(c) ((c) == ',')
#include <nss/nss_files/files-parse.c>
LINE_PARSER
(,
STRING_FIELD (result->sg_namp, ISCOLON, 0);
if (line[0] == '\0'
&& (result->sg_namp[0] == '+' || result->sg_namp[0] == '-'))
{
result->sg_passwd = NULL;
result->sg_adm = NULL;
result->sg_mem = NULL;
}
else
{
STRING_FIELD (result->sg_passwd, ISCOLON, 0);
STRING_LIST (result->sg_adm, ':');
}
)
/* Read one shadow entry from the given stream. */
int
__sgetsgent_r (const char *string, struct sgrp *resbuf, char *buffer,
size_t buflen, struct sgrp **result)
{
char *sp;
if (string < buffer || string >= buffer + buflen)
{
buffer[buflen - 1] = '\0';
sp = strncpy (buffer, string, buflen);
if (buffer[buflen - 1] != '\0')
return ERANGE;
}
else
sp = (char *) string;
int parse_result = parse_line (sp, resbuf, (void *) buffer, buflen, &errno);
*result = parse_result > 0 ? resbuf : NULL;
return *result == NULL ? errno : 0;
}
weak_alias (__sgetsgent_r, sgetsgent_r)
+141
View File
@@ -0,0 +1,141 @@
#include <gshadow.h>
#include <stdio.h>
#include <string.h>
static const struct sgrp data[] =
{
{ (char *) "one", (char *) "pwdone",
(char *[]) { (char *) "admoneone", (char *) "admonetwo",
(char *) "admonethree", NULL },
(char *[]) { (char *) "memoneone", (char *) "memonetwo",
(char *) "memonethree", NULL } },
{ (char *) "two", (char *) "pwdtwo",
(char *[]) { (char *) "admtwoone", (char *) "admtwotwo", NULL },
(char *[]) { (char *) "memtwoone", (char *) "memtwotwo",
(char *) "memtwothree", NULL } },
{ (char *) "three", (char *) "pwdthree",
(char *[]) { (char *) "admthreeone", (char *) "admthreetwo", NULL },
(char *[]) { (char *) "memthreeone", (char *) "memthreetwo", NULL } },
{ (char *) "four", (char *) "pwdfour",
(char *[]) { (char *) "admfourone", (char *) "admfourtwo", NULL },
(char *[]) { NULL } },
{ (char *) "five", (char *) "pwdfive",
(char *[]) { NULL },
(char *[]) { (char *) "memfiveone", (char *) "memfivetwo", NULL } },
};
#define ndata (sizeof (data) / sizeof (data[0]))
static int
do_test (void)
{
FILE *fp = tmpfile ();
if (fp == NULL)
{
puts ("cannot open temporary file");
return 1;
}
for (size_t i = 0; i < ndata; ++i)
if (putsgent (&data[i], fp) != 0)
{
printf ("putsgent call %zu failed\n", i + 1);
return 1;
}
rewind (fp);
int result = 0;
int seen = -1;
struct sgrp *g;
while ((g = fgetsgent (fp)) != NULL)
{
++seen;
if (strcmp (g->sg_namp, data[seen].sg_namp) != 0)
{
printf ("sg_namp of entry %d does not match: %s vs %s\n",
seen + 1, g->sg_namp, data[seen].sg_namp);
result = 1;
}
if (strcmp (g->sg_passwd, data[seen].sg_passwd) != 0)
{
printf ("sg_passwd of entry %d does not match: %s vs %s\n",
seen + 1, g->sg_passwd, data[seen].sg_passwd);
result = 1;
}
if (g->sg_adm == NULL)
{
printf ("sg_adm of entry %d is NULL\n", seen + 1);
result = 1;
}
else
{
int i = 1;
char **sp1 = g->sg_adm;
char **sp2 = data[seen].sg_adm;
while (*sp1 != NULL && *sp2 != NULL)
{
if (strcmp (*sp1, *sp2) != 0)
{
printf ("sg_adm[%d] of entry %d does not match: %s vs %s\n",
i, seen + 1, *sp1, *sp2);
result = 1;
}
++sp1;
++sp2;
++i;
}
if (*sp1 == NULL && *sp2 != NULL)
{
printf ("sg_adm of entry %d has too few entries\n", seen + 1);
result = 1;
}
else if (*sp1 != NULL && *sp2 == NULL)
{
printf ("sg_adm of entry %d has too many entries\n", seen + 1);
result = 1;
}
}
if (g->sg_mem == NULL)
{
printf ("sg_mem of entry %d is NULL\n", seen + 1);
result = 1;
}
else
{
int i = 1;
char **sp1 = g->sg_mem;
char **sp2 = data[seen].sg_mem;
while (*sp1 != NULL && *sp2 != NULL)
{
if (strcmp (*sp1, *sp2) != 0)
{
printf ("sg_mem[%d] of entry %d does not match: %s vs %s\n",
i, seen + 1, *sp1, *sp2);
result = 1;
}
++sp1;
++sp2;
++i;
}
if (*sp1 == NULL && *sp2 != NULL)
{
printf ("sg_mem of entry %d has too few entries\n", seen + 1);
result = 1;
}
else if (*sp1 != NULL && *sp2 == NULL)
{
printf ("sg_mem of entry %d has too many entries\n", seen + 1);
result = 1;
}
}
}
fclose (fp);
return result;
}
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
+4 -2
View File
@@ -1,5 +1,5 @@
/* Simple transformations functions.
Copyright (C) 1997-2005, 2007, 2008 Free Software Foundation, Inc.
Copyright (C) 1997-2005, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -1037,7 +1037,9 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
/* If i < cnt, some trail byte was not >= 0x80, < 0xc0. \
If cnt > 2 and ch < 2^(5*cnt-4), the wide character ch could \
have been represented with fewer than cnt bytes. */ \
if (i < cnt || (cnt > 2 && (ch >> (5 * cnt - 4)) == 0)) \
if (i < cnt || (cnt > 2 && (ch >> (5 * cnt - 4)) == 0) \
/* Do not accept UTF-16 surrogates. */ \
|| (ch >= 0xd800 && ch <= 0xdfff)) \
{ \
/* This is an illegal encoding. */ \
goto errout; \
+16 -12
View File
@@ -1,5 +1,5 @@
/* Mapping tables for SJIS handling.
Copyright (C) 1997-2001, 2002 Free Software Foundation, Inc.
Copyright (C) 1997-2001, 2002, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -4372,15 +4372,19 @@ static const char from_ucs4_extra[0x100][2] =
\
ch2 = inptr[1]; \
idx = ch * 256 + ch2; \
if (__builtin_expect (ch2 < 0x40, 0) \
|| (__builtin_expect (idx > 0x84be, 0) && idx < 0x889f) \
|| (__builtin_expect (idx > 0x88fc, 0) && idx < 0x8940) \
|| (__builtin_expect (idx > 0x9ffc, 0) && idx < 0xe040) \
|| __builtin_expect (idx > 0xeaa4, 0)) \
if (__builtin_expect (ch2 < 0x40, 0)) \
{ \
/* This is illegal. */ \
STANDARD_FROM_LOOP_ERR_HANDLER (1); \
} \
else if ((__builtin_expect (idx > 0x84be && idx < 0x889f, 0)) \
|| (__builtin_expect (idx > 0x88fc && idx < 0x8940, 0)) \
|| (__builtin_expect (idx > 0x9ffc && idx < 0xe040, 0)) \
|| __builtin_expect (idx > 0xeaa4, 0)) \
{ \
/* This is illegal. */ \
STANDARD_FROM_LOOP_ERR_HANDLER (2); \
} \
else \
{ \
/* We could pack the data a bit more dense. The second \
@@ -4395,13 +4399,13 @@ static const char from_ucs4_extra[0x100][2] =
else \
ch = cjk_block4[(ch - 0xe0) * 192 + ch2 - 0x40]; \
\
inptr += 2; \
} \
if (__builtin_expect (ch == 0, 0)) \
{ \
/* This is an illegal character. */ \
STANDARD_FROM_LOOP_ERR_HANDLER (2); \
} \
\
if (__builtin_expect (ch == 0, 0)) \
{ \
/* This is an illegal character. */ \
STANDARD_FROM_LOOP_ERR_HANDLER (2); \
inptr += 2; \
} \
} \
\
+5 -3
View File
@@ -17,14 +17,16 @@ extern int __readdir64_r (DIR *__dirp, struct dirent64 *__entry,
extern int __scandir64 (__const char * __dir,
struct dirent64 *** __namelist,
int (*__selector) (__const struct dirent64 *),
int (*__cmp) (__const void *, __const void *));
int (*__cmp) (__const struct dirent64 **,
__const struct dirent64 **));
extern __ssize_t __getdents (int __fd, char *__buf, size_t __nbytes)
internal_function;
extern __ssize_t __getdents64 (int __fd, char *__buf, size_t __nbytes)
internal_function;
extern int __alphasort64 (const void *a, const void *b)
extern int __alphasort64 (const struct dirent64 **a, const struct dirent64 **b)
__attribute_pure__;
extern int __versionsort64 (const void *a, const void *b)
extern int __versionsort64 (const struct dirent64 **a,
const struct dirent64 **b)
__attribute_pure__;
extern DIR *__alloc_dir (int fd, bool close_fd, const struct stat64 *statp)
internal_function;
+3 -1
View File
@@ -230,6 +230,8 @@
#if (_POSIX_C_SOURCE - 0) >= 200112L
# define __USE_XOPEN2K 1
# undef __USE_ISOC99
# define __USE_ISOC99 1
#endif
#if (_POSIX_C_SOURCE - 0) >= 200809L
@@ -326,7 +328,7 @@
/* Major and minor version number of the GNU C library package. Use
these macros to test for features in specific releases. */
#define __GLIBC__ 2
#define __GLIBC_MINOR__ 9
#define __GLIBC_MINOR__ 10
#define __GLIBC_PREREQ(maj, min) \
((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
+15
View File
@@ -0,0 +1,15 @@
#ifndef _GSHADOW_H
#include <gshadow/gshadow.h>
extern int __fgetsgent_r (FILE *stream, struct sgrp *resbuf, char *buffer,
size_t buflen, struct sgrp **result);
extern int __sgetsgent_r (const char *string, struct sgrp *resbuf,
char *buffer, size_t buflen, struct sgrp **result);
struct parser_data;
extern int _nss_files_parse_sgent (char *line, struct sgrp *result,
struct parser_data *data,
size_t datalen, int *errnop);
libc_hidden_proto (_nss_files_parse_sgent)
#endif
+12 -2
View File
@@ -1,7 +1,6 @@
/* Support macros for making weak and strong aliases for symbols,
and for using symbol sets and linker warnings with GNU ld.
Copyright (C) 1995-1998,2000-2003,2004,2005,2006
Free Software Foundation, Inc.
Copyright (C) 1995-1998, 2000-2006, 2008 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
@@ -835,4 +834,15 @@ for linking")
# define compat_data_section .section ".data.compat", "aw";
#endif
/* Marker used for indirection function symbols. */
#define libc_ifunc(name, expr) \
extern void *name##_ifunc (void) __asm__ (#name); \
void *name##_ifunc (void) \
{ \
INIT_ARCH (); \
__typeof (name) *res = expr; \
return res; \
} \
__asm__ (".type " #name ", %gnu_indirect_function");
#endif /* libc-symbols.h */
+1
View File
@@ -152,6 +152,7 @@ libc_hidden_proto (fread_unlocked)
libc_hidden_proto (fwrite_unlocked)
libc_hidden_proto (fgets_unlocked)
libc_hidden_proto (fputs_unlocked)
libc_hidden_proto (fmemopen)
libc_hidden_proto (open_memstream)
libc_hidden_proto (__libc_fatal)
libc_hidden_proto (__vsprintf_chk)
+2 -2
View File
@@ -1,4 +1,4 @@
# Copyright (C) 1991-2006, 2007 Free Software Foundation, Inc.
# Copyright (C) 1991-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
@@ -53,7 +53,7 @@ aux := check_pf check_native ifreq
tests := htontest test_ifindex tst-ntoa tst-ether_aton tst-network \
tst-gethnm test-ifaddrs bug-if1 test-inet6_opt tst-ether_line \
tst-getni1 tst-getni2
tst-getni1 tst-getni2 tst-inet6_rth
include ../Rules
+3 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2006 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -216,7 +216,8 @@ option_alloc (struct cmsghdr *cmsg, int datalen, int multx, int plusy)
/* Too long. */
return NULL;
((struct ip6_ext *) CMSG_DATA (cmsg))->ip6e_len = len8b;
struct ip6_ext *ie = (void *) CMSG_DATA (cmsg);
ie->ip6e_len = len8b;
return result;
}
+7 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2006 Free Software Foundation, Inc.
/* Copyright (C) 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2006.
@@ -93,6 +93,9 @@ inet6_rth_add (void *bp, const struct in6_addr *addr)
struct ip6_rthdr0 *rthdr0;
case IPV6_RTHDR_TYPE_0:
rthdr0 = (struct ip6_rthdr0 *) rthdr;
if (rthdr0->ip6r0_len * 8 / sizeof (struct in6_addr)
- rthdr0->ip6r0_segleft < 1)
return -1;
memcpy (&rthdr0->ip6r0_addr[rthdr0->ip6r0_segleft++],
addr, sizeof (struct in6_addr));
@@ -127,7 +130,7 @@ inet6_rth_reverse (const void *in, void *out)
/* Copy header, not the addresses. The memory regions can overlap. */
memmove (out_rthdr0, in_rthdr0, sizeof (struct ip6_rthdr0));
int total = in_rthdr0->ip6r0_segleft * 8 / sizeof (struct in6_addr);
int total = in_rthdr0->ip6r0_len * 8 / sizeof (struct in6_addr);
for (int i = 0; i < total / 2; ++i)
{
/* Remember, IN_RTHDR0 and OUT_RTHDR0 might overlap. */
@@ -138,6 +141,8 @@ inet6_rth_reverse (const void *in, void *out)
if (total % 2 != 0 && in != out)
out_rthdr0->ip6r0_addr[total / 2] = in_rthdr0->ip6r0_addr[total / 2];
out_rthdr0->ip6r0_segleft = total;
return 0;
}
+13 -8
View File
@@ -112,7 +112,13 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
{
char paddr[INET6_ADDRSTRLEN];
struct addrinfo hints, *res, *ai;
struct sockaddr_storage from;
union
{
struct sockaddr sa;
struct sockaddr_storage ss;
struct sockaddr_in sin;
struct sockaddr_in6 sin6;
} from;
struct pollfd pfd[2];
int32_t oldmask;
pid_t pid;
@@ -274,14 +280,13 @@ poll: protocol failure in circuit setup\n")) >= 0))
(void)__close(s2);
goto bad;
}
s3 = TEMP_FAILURE_RETRY (accept(s2, (struct sockaddr *)&from,
&len));
switch (from.ss_family) {
s3 = TEMP_FAILURE_RETRY (accept(s2, &from.sa, &len));
switch (from.sa.sa_family) {
case AF_INET:
rport = ntohs(((struct sockaddr_in *)&from)->sin_port);
rport = ntohs(from.sin.sin_port);
break;
case AF_INET6:
rport = ntohs(((struct sockaddr_in6 *)&from)->sin6_port);
rport = ntohs(from.sin6.sin6_port);
break;
default:
rport = 0;
@@ -605,13 +610,13 @@ iruserok_af (raddr, superuser, ruser, luser, af)
memset (&ra, '\0', sizeof(ra));
switch (af){
case AF_INET:
((struct sockaddr_in *)&ra)->sin_family = AF_INET;
ra.ss_family = AF_INET;
memcpy (&(((struct sockaddr_in *)&ra)->sin_addr), raddr,
sizeof(struct in_addr));
ralen = sizeof(struct sockaddr_in);
break;
case AF_INET6:
((struct sockaddr_in6 *)&ra)->sin6_family = AF_INET6;
ra.ss_family = AF_INET6;
memcpy (&(((struct sockaddr_in6 *)&ra)->sin6_addr), raddr,
sizeof(struct in6_addr));
ralen = sizeof(struct sockaddr_in6);
+9 -4
View File
@@ -56,7 +56,7 @@ rexec_af(ahost, rport, name, pass, cmd, fd2p, af)
int *fd2p;
sa_family_t af;
{
struct sockaddr_storage sa2, from;
struct sockaddr_storage from;
struct addrinfo hints, *res0;
const char *orig_name = name;
const char *orig_pass = pass;
@@ -115,6 +115,11 @@ retry:
} else {
char num[32];
int s2;
union
{
struct sockaddr_storage ss;
struct sockaddr sa;
} sa2;
socklen_t sa2len;
s2 = __socket(res0->ai_family, res0->ai_socktype, 0);
@@ -124,17 +129,17 @@ retry:
}
__listen(s2, 1);
sa2len = sizeof (sa2);
if (__getsockname(s2, (struct sockaddr *)&sa2, &sa2len) < 0) {
if (__getsockname(s2, &sa2.sa, &sa2len) < 0) {
perror("getsockname");
(void) __close(s2);
goto bad;
} else if (sa2len != SA_LEN((struct sockaddr *)&sa2)) {
} else if (sa2len != SA_LEN(&sa2.sa)) {
__set_errno(EINVAL);
(void) __close(s2);
goto bad;
}
port = 0;
if (!getnameinfo((struct sockaddr *)&sa2, sa2len,
if (!getnameinfo(&sa2.sa, sa2len,
NULL, 0, servbuff, sizeof(servbuff),
NI_NUMERICSERV))
port = atoi(servbuff);
+188
View File
@@ -0,0 +1,188 @@
#include <stdio.h>
#include <string.h>
#include <arpa/inet.h>
#include <netinet/ip6.h>
static int
do_test (void)
{
int res = 0;
char buf[1000];
void *p = inet6_rth_init (buf, 24, IPV6_RTHDR_TYPE_0, 0);
if (p == NULL)
{
puts ("first inet6_rth_init failed");
res = 1;
}
else if (inet6_rth_add (p, &in6addr_any) == 0)
{
puts ("first inet6_rth_add succeeded");
res = 1;
}
p = inet6_rth_init (buf, 24, IPV6_RTHDR_TYPE_0, 1);
if (p == NULL)
{
puts ("second inet6_rth_init failed");
res = 1;
}
else if (inet6_rth_add (p, &in6addr_any) != 0)
{
puts ("second inet6_rth_add failed");
res = 1;
}
for (int nseg = 4; nseg < 6; ++nseg)
{
printf ("nseg = %d\n", nseg);
p = inet6_rth_init (buf, sizeof (buf), IPV6_RTHDR_TYPE_0, nseg);
if (p == NULL)
{
puts ("third inet6_rth_init failed");
res = 1;
}
else
{
struct in6_addr tmp;
memset (&tmp, '\0', sizeof (tmp));
for (int i = 0; i < nseg; ++i)
{
tmp.s6_addr[0] = i;
if (inet6_rth_add (p, &tmp) != 0)
{
printf ("call %d of third inet6_rth_add failed\n", i + 1);
res = 1;
goto out;
}
}
((struct ip6_rthdr0 *) p)->ip6r0_segleft = 0;
if (inet6_rth_segments (p) != nseg)
{
puts ("\
inet6_rth_segments returned wrong value after loop with third inet6_rth_add");
res = 1;
goto out;
}
char buf2[1000];
if (inet6_rth_reverse (p, buf2) != 0)
{
puts ("first inet6_rth_reverse call failed");
res = 1;
goto out;
}
if (((struct ip6_rthdr0 *) buf2)->ip6r0_segleft != nseg)
{
puts ("segleft after first inet6_rth_reverse wrong");
res = 1;
}
if (inet6_rth_segments (p) != inet6_rth_segments (buf2))
{
puts ("number of seconds after first inet6_rth_reverse differs");
res = 1;
goto out;
}
for (int i = 0; i < nseg; ++i)
{
struct in6_addr *addr = inet6_rth_getaddr (buf2, i);
if (addr == NULL)
{
printf ("call %d of first inet6_rth_getaddr failed\n",
i + 1);
res = 1;
}
else if (addr->s6_addr[0] != nseg - 1 - i
|| memcmp (&addr->s6_addr[1], &in6addr_any.s6_addr[1],
sizeof (in6addr_any)
- sizeof (in6addr_any.s6_addr[0])) != 0)
{
char addrbuf[100];
inet_ntop (AF_INET6, addr, addrbuf, sizeof (addrbuf));
printf ("\
address %d after first inet6_rth_reverse wrong (%s)\n",
i + 1, addrbuf);
res = 1;
}
}
out:
;
}
p = inet6_rth_init (buf, sizeof (buf), IPV6_RTHDR_TYPE_0, nseg);
if (p == NULL)
{
puts ("fourth inet6_rth_init failed");
res = 1;
}
else
{
struct in6_addr tmp;
memset (&tmp, '\0', sizeof (tmp));
for (int i = 0; i < nseg; ++i)
{
tmp.s6_addr[0] = i;
if (inet6_rth_add (p, &tmp) != 0)
{
printf ("call %d of fourth inet6_rth_add failed\n", i + 1);
res = 1;
goto out2;
}
}
((struct ip6_rthdr0 *) p)->ip6r0_segleft = 0;
if (inet6_rth_segments (p) != nseg)
{
puts ("\
inet6_rth_segments returned wrong value after loop with fourth inet6_rth_add");
res = 1;
goto out2;
}
if (inet6_rth_reverse (p, p) != 0)
{
puts ("second inet6_rth_reverse call failed");
res = 1;
goto out2;
}
if (((struct ip6_rthdr0 *) p)->ip6r0_segleft != nseg)
{
puts ("segleft after second inet6_rth_reverse wrong");
res = 1;
}
for (int i = 0; i < nseg; ++i)
{
struct in6_addr *addr = inet6_rth_getaddr (p, i);
if (addr == NULL)
{
printf ("call %d of second inet6_rth_getaddr failed\n",
i + 1);
res = 1;
}
else if (addr->s6_addr[0] != nseg - 1 - i
|| memcmp (&addr->s6_addr[1], &in6addr_any.s6_addr[1],
sizeof (in6addr_any)
- sizeof (in6addr_any.s6_addr[0])) != 0)
{
char addrbuf[100];
inet_ntop (AF_INET6, addr, addrbuf, sizeof (addrbuf));
printf ("\
address %d after second inet6_rth_reverse wrong (%s)\n",
i + 1, addrbuf);
res = 1;
}
}
out2:
;
}
}
return res;
}
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
+3 -1
View File
@@ -249,9 +249,11 @@ extern int __REDIRECT_NTH (fstatat, (int __fd, __const char *__restrict __file,
# endif
# endif
# ifdef __USE_LARGEFILE64
extern int fstatat64 (int __fd, __const char *__restrict __file,
struct stat64 *__restrict __buf, int __flag)
__THROW __nonnull ((2, 3));
# endif
#endif
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
@@ -516,7 +518,7 @@ __NTH (fstat64 (int __fd, struct stat64 *__statbuf))
return __fxstat64 (_STAT_VER, __fd, __statbuf);
}
# ifdef __USE_GNU
# ifdef __USE_ATFILE
__extern_inline int
__NTH (fstatat64 (int __fd, __const char *__filename, struct stat64 *__statbuf,
int __flag))
+3 -1
View File
@@ -1,5 +1,6 @@
/* Fmemopen implementation.
Copyright (C) 2000, 2002, 2005, 2006, 2008 Free Software Foundation, Inc.
Copyright (C) 2000, 2002, 2005, 2006, 2008, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Hanno Mueller, kontakt@hanno.de, 2000.
@@ -258,3 +259,4 @@ fmemopen (void *buf, size_t len, const char *mode)
return _IO_fopencookie (c, mode, iof);
}
libc_hidden_def (fmemopen)
+4 -4
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1993, 1997-2003, 2006 Free Software Foundation, Inc.
/* Copyright (C) 1993, 1997-2003, 2006, 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,10 +38,10 @@ __IO_vsprintf (char *string, const char *format, _IO_va_list args)
sf._sbf._f._lock = NULL;
#endif
_IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
_IO_JUMPS (&sf._sbf) = &_IO_str_jumps;
_IO_str_init_static_internal (&sf, string, -1, string);
ret = INTUSE(_IO_vfprintf) ((_IO_FILE *) &sf._sbf, format, args);
_IO_putc_unlocked ('\0', (_IO_FILE *) &sf._sbf);
ret = INTUSE(_IO_vfprintf) (&sf._sbf._f, format, args);
_IO_putc_unlocked ('\0', &sf._sbf._f);
return ret;
}
INTDEF2(__IO_vsprintf, _IO_vsprintf)
+3 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1993, 1997-2003, 2006 Free Software Foundation, Inc.
/* Copyright (C) 1993, 1997-2003, 2006, 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
@@ -40,9 +40,9 @@ _IO_vsscanf (string, format, args)
sf._sbf._f._lock = NULL;
#endif
_IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
_IO_JUMPS (&sf._sbf) = &_IO_str_jumps;
_IO_str_init_static_internal (&sf, (char*)string, 0, NULL);
ret = INTUSE(_IO_vfscanf) ((_IO_FILE *) &sf._sbf, format, args, NULL);
ret = INTUSE(_IO_vfscanf) (&sf._sbf._f, format, args, NULL);
return ret;
}
ldbl_weak_alias (_IO_vsscanf, __vsscanf)
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1993, 1997, 1998, 1999, 2005 Free Software Foundation, Inc.
/* Copyright (C) 1993,1997,1998,1999,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
@@ -47,7 +47,7 @@ struct _IO_str_fields
struct _IO_streambuf
{
struct _IO_FILE _f;
const void *_vtable;
const struct _IO_jump_t *vtable;
};
typedef struct _IO_strfile_
-41
View File
@@ -1807,47 +1807,6 @@ Free block (U+D7A4-U+D7FF):
힤힥힦힧힨힩힪힫힬힭힮힯ힰힱힲힳힴힵힶힷힸힹힺힻힼힽힾힿퟀퟁퟂퟃퟄퟅퟆ퟇퟈퟉퟊ퟋퟌퟍퟎퟏퟐퟑퟒퟓퟔퟕퟖퟗퟘퟙퟚퟛퟜퟝퟞퟟퟠퟡퟢퟣ
ퟤퟥퟦퟧퟨퟩퟪퟫퟬퟭퟮퟯퟰퟱퟲퟳퟴퟵퟶퟷퟸퟹퟺퟻ퟼퟽퟾퟿
High Surrogates (U+D800-U+DB7F):
High Private Use Surrogates (U+DB80-U+DBFF):
Low Surrogates (U+DC00-U+DFFF):
Private Use (U+E000-U+F8FF):

+4 -3
View File
@@ -1,4 +1,5 @@
/* Copyright (C) 1995,1997,1999-2002,2004,2006 Free Software Foundation, Inc.
/* Copyright (C) 1995,1997,1999-2002,2004,2006,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
@@ -54,8 +55,8 @@ _IO_vasprintf (result_ptr, format, args)
#ifdef _IO_MTSAFE_IO
sf._sbf._f._lock = NULL;
#endif
_IO_no_init ((_IO_FILE *) &sf._sbf, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
_IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS (&sf._sbf) = &_IO_str_jumps;
_IO_str_init_static_internal (&sf, string, init_string_size, string);
sf._sbf._f._flags &= ~_IO_USER_BUF;
sf._s._allocate_buffer = (_IO_alloc_type) malloc;
+3 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1994,1997,1999-2003, 2004, 2006 Free Software Foundation, Inc.
/* Copyright (C) 1994,1997,1999-2004,2006,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
@@ -114,10 +114,10 @@ _IO_vsnprintf (string, maxlen, format, args)
}
_IO_no_init (&sf.f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS ((struct _IO_FILE_plus *) &sf.f._sbf) = &_IO_strn_jumps;
_IO_JUMPS (&sf.f._sbf) = &_IO_strn_jumps;
string[0] = '\0';
_IO_str_init_static_internal (&sf.f, string, maxlen - 1, string);
ret = INTUSE(_IO_vfprintf) ((_IO_FILE *) &sf.f._sbf, format, args);
ret = INTUSE(_IO_vfprintf) (&sf.f._sbf._f, format, args);
if (sf.f._sbf._f._IO_buf_base != sf.overflow_buf)
*sf.f._sbf._f._IO_write_ptr = '\0';
+1
View File
@@ -303,6 +303,7 @@ DEFINE_LANGUAGE_CODE3 ("Mayan languages", myn, myn)
DEFINE_LANGUAGE_CODE3 ("Mende", men, men)
DEFINE_LANGUAGE_CODE3 ("Mi'kmaq; Micmac", mic, mic)
DEFINE_LANGUAGE_CODE3 ("Minangkabau", min, min)
DEFINE_LANGUAGE_CODE3 ("Min Nan", nan, nan)
DEFINE_LANGUAGE_CODE3 ("Mirandese", mwl, mwl)
DEFINE_LANGUAGE_CODE3 ("Miscellaneous languages", mis, mis)
DEFINE_LANGUAGE_CODE3 ("Mohawk", moh, moh)
+3 -2
View File
@@ -1,5 +1,5 @@
/* Definitions for locale archive handling.
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2002, 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
@@ -83,7 +83,8 @@ struct locarhandle
{
int fd;
void *addr;
size_t len;
size_t mmaped;
size_t reserved;
};
+159 -21
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -71,6 +71,10 @@ static const char *locnames[] =
#define INITIAL_NUM_SUMS 2000
/* Size of the reserved address space area. */
#define RESERVE_MMAP_SIZE 512 * 1024 * 1024
static void
create_archive (const char *archivefname, struct locarhandle *ah)
{
@@ -125,8 +129,22 @@ create_archive (const char *archivefname, struct locarhandle *ah)
error (EXIT_FAILURE, errval, _("cannot resize archive file"));
}
/* To prepare for enlargements of the mmaped area reserve some
address space. */
size_t reserved = RESERVE_MMAP_SIZE;
int xflags = 0;
if (total < reserved
&& ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
-1, 0)) != MAP_FAILED))
xflags = MAP_FIXED;
else
{
p = NULL;
reserved = total;
}
/* Map the header and all the administration data structures. */
p = mmap64 (NULL, total, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
p = mmap64 (p, total, PROT_READ | PROT_WRITE, MAP_SHARED | xflags, fd, 0);
if (p == MAP_FAILED)
{
int errval = errno;
@@ -170,7 +188,8 @@ create_archive (const char *archivefname, struct locarhandle *ah)
ah->fd = fd;
ah->addr = p;
ah->len = total;
ah->mmaped = total;
ah->reserved = reserved;
}
@@ -226,6 +245,51 @@ static void add_alias (struct locarhandle *ah, const char *alias,
bool replace, const char *oldname,
uint32_t *locrec_offset_p);
static bool
file_data_available_p (struct locarhandle *ah, uint32_t offset, uint32_t size)
{
if (offset < ah->mmaped && offset + size <= ah->mmaped)
return true;
struct stat64 st;
if (fstat64 (ah->fd, &st) != 0)
return false;
if (st.st_size > ah->reserved)
return false;
const size_t pagesz = getpagesize ();
size_t start = ah->mmaped & ~(pagesz - 1);
void *p = mmap64 (ah->addr + start, st.st_size - start,
PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED,
ah->fd, start);
if (p == MAP_FAILED)
{
ah->mmaped = start;
return false;
}
ah->mmaped = st.st_size;
return true;
}
static int
compare_from_file (struct locarhandle *ah, void *p1, uint32_t offset2,
uint32_t size)
{
void *p2 = xmalloc (size);
if (pread (ah->fd, p2, size, offset2) != size)
WITH_CUR_LOCALE (error (4, errno,
_("cannot read data from locale archive")));
int res = memcmp (p1, p2, size);
free (p2);
return res;
}
static void
enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
{
@@ -249,11 +313,24 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
/* Not all of the old file has to be mapped. Change this now this
we will have to access the whole content. */
if (fstat64 (ah->fd, &st) != 0
|| (ah->addr = mmap64 (NULL, st.st_size, PROT_READ | PROT_WRITE,
MAP_SHARED, ah->fd, 0)) == MAP_FAILED)
if (fstat64 (ah->fd, &st) != 0)
enomap:
error (EXIT_FAILURE, errno, _("cannot map locale archive file"));
ah->len = st.st_size;
if (st.st_size < ah->reserved)
ah->addr = mmap64 (ah->addr, st.st_size, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_FIXED, ah->fd, 0);
else
{
munmap (ah->addr, ah->reserved);
ah->addr = mmap64 (NULL, st.st_size, PROT_READ | PROT_WRITE,
MAP_SHARED, ah->fd, 0);
ah->reserved = st.st_size;
head = ah->addr;
}
if (ah->addr == MAP_FAILED)
goto enomap;
ah->mmaped = st.st_size;
/* Create a temporary file in the correct directory. */
fd = mkstemp (fname);
@@ -314,8 +391,22 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
error (EXIT_FAILURE, errval, _("cannot resize archive file"));
}
/* To prepare for enlargements of the mmaped area reserve some
address space. */
size_t reserved = RESERVE_MMAP_SIZE;
int xflags = 0;
if (total < reserved
&& ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
-1, 0)) != MAP_FAILED))
xflags = MAP_FIXED;
else
{
p = NULL;
reserved = total;
}
/* Map the header and all the administration data structures. */
p = mmap64 (NULL, total, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
p = mmap64 (p, total, PROT_READ | PROT_WRITE, MAP_SHARED | xflags, fd, 0);
if (p == MAP_FAILED)
{
int errval = errno;
@@ -331,9 +422,10 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
error (EXIT_FAILURE, errval, _("cannot lock new archive"));
}
new_ah.len = total;
new_ah.mmaped = total;
new_ah.addr = p;
new_ah.fd = fd;
new_ah.reserved = reserved;
/* Walk through the hash name hash table to find out what data is
still referenced and transfer it into the new file. */
@@ -380,7 +472,7 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
= ((char *) ah->addr
+ oldnamehashtab[oldlocrecarray[cnt - 1].cnt].name_offset);
add_alias (&new_ah,
add_alias (&new_ah,
((char *) ah->addr
+ oldnamehashtab[oldlocrecarray[cnt].cnt].name_offset),
0, oldname, &last_locrec_offset);
@@ -514,18 +606,33 @@ open_archive (struct locarhandle *ah, bool readonly)
}
ah->fd = fd;
ah->len = (head.sumhash_offset
+ head.sumhash_size * sizeof (struct sumhashent));
ah->mmaped = st.st_size;
/* Now we know how large the administrative information part is.
Map all of it. */
ah->addr = mmap64 (NULL, ah->len, PROT_READ | (readonly ? 0 : PROT_WRITE),
MAP_SHARED, fd, 0);
/* To prepare for enlargements of the mmaped area reserve some
address space. */
size_t reserved = RESERVE_MMAP_SIZE;
int xflags = 0;
void *p;
if (st.st_size < reserved
&& ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
-1, 0)) != MAP_FAILED))
xflags = MAP_FIXED;
else
{
p = NULL;
reserved = st.st_size;
}
/* Map the entire file. We might need to compare the category data
in the file with the newly added data. */
ah->addr = mmap64 (p, st.st_size, PROT_READ | (readonly ? 0 : PROT_WRITE),
MAP_SHARED | xflags, fd, 0);
if (ah->addr == MAP_FAILED)
{
(void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead));
error (EXIT_FAILURE, errno, _("cannot map archive header"));
}
ah->reserved = reserved;
}
@@ -534,7 +641,7 @@ close_archive (struct locarhandle *ah)
{
if (ah->fd != -1)
{
munmap (ah->addr, ah->len);
munmap (ah->addr, ah->reserved);
close (ah->fd);
}
}
@@ -760,10 +867,41 @@ add_locale (struct locarhandle *ah,
{
if (memcmp (data[cnt].sum, sumhashtab[idx].sum, 16) == 0)
{
/* Found it. */
file_offsets[cnt] = sumhashtab[idx].file_offset;
--num_new_offsets;
break;
/* Check the content, there could be a collision of
the hash sum.
Unfortunately the sumhashent record does not include
the size of the stored data. So we have to search for
it. */
locrecent = (struct locrecent *) ((char *) ah->addr
+ head->locrectab_offset);
size_t iloc;
for (iloc = 0; iloc < head->locrectab_used; ++iloc)
if (locrecent[iloc].refs != 0
&& (locrecent[iloc].record[cnt].offset
== sumhashtab[idx].file_offset))
break;
if (iloc != head->locrectab_used
&& data[cnt].size == locrecent[iloc].record[cnt].len
/* We have to compare the content. Either we can
have the data mmaped or we have to read from
the file. */
&& (file_data_available_p (ah, sumhashtab[idx].file_offset,
data[cnt].size)
? memcmp (data[cnt].addr,
(char *) ah->addr
+ sumhashtab[idx].file_offset,
data[cnt].size) == 0
: compare_from_file (ah, data[cnt].addr,
sumhashtab[idx].file_offset,
data[cnt].size) == 0))
{
/* Found it. */
file_offsets[cnt] = sumhashtab[idx].file_offset;
--num_new_offsets;
break;
}
}
idx += incr;
+92
View File
@@ -1,3 +1,95 @@
2009-05-04 Ulrich Drepper <drepper@redhat.com>
* localedata/locales/bn_BD: Remove comment about missing collation
rules.
* localedata/locales/iso14651_t1_common: Add Bengali collation rules.
Patch by Pravin Satpute <psatpute@redhat.com>.
2009-03-08 Samuel Thibault <samuel.thibault@ens-lyon.org>
* locales/cs.CZ: Change week[2] to 19971130, change first_weekday and
first_workday to 2.
* locales/da_DK: Likewise.
* locales/de_DE: Likewise.
* locales/fr_FR: Likewise.
* locales/fur_IT: Likewise.
* locales/fy_DE: Likewise.
* locales/ht_HT: Likewise.
* locales/hu_HU: Likewise.
* locales/li_BE: Likewise.
* locales/li_NL: Likewise.
* locales/mk_MK: Likewise.
* locales/nb_NO: Likewise.
* locales/nds_DE: Likewise.
* locales/nds_NL: Likewise.
* locales/nn_NO: Likewise.
* locales/pl_PL: Likewise.
* locales/sc_IT: Likewise.
* locales/sk_SK: Likewise.
* locales/uk_UA: Likewise.
* locales/csb_PL: Change week[2] to 19971130.
* locales/en_GB: Likewise.
* locales/et_EE: Likewise.
* locales/sr_ME: Set week to 7;19971130;4.
* locales/sr_RS: Likewise.
* locales/sr_RS@latin: Likewise.
2009-04-22 Ulrich Drepper <drepper@redhat.com>
[BZ #9963]
* locales/en_PH: Fix LC_PAPER.
* locales/es_CL: Likewise.
* locales/es_CO: Likewise.
* locales/es_MX: Likewise.
* locales/es_US: Likewise.
* locales/es_VE: Likewise.
* locales/fil_PH: Likewise.
* locales/ik_CA: Likewise.
* locales/iu_CA: Likewise.
* locales/tl_PH: Likewise.
2009-04-18 Ulrich Drepper <drepper@redhat.com>
* SUPPORTED: Add ks_IN.
2009-04-07 Ulrich Drepper <drepper@redhat.com>
* locales/ks_IN@devanagari: Replace duplicated information with copy.
Fix title. Patch by Pravin Satpute <psatpute@redhat.com>.
2009-04-06 Ulrich Drepper <drepper@redhat.com>
* locales/ks_IN: New file.
Patch by Mohammad Nayeem <mohammad.nayeem@gmail.com> and
Pravin Satpute <psatpute@redhat.com>.
2009-03-23 Jakub Jelinek <jakub@redhat.com>
[BZ #9985]
* charmaps/UTF-8: Fix encoding of <U1080>..<U109F>, <U12AF>.
Based on patch by Keith Stribley <devel@thanlwinsoft.org>.
2009-03-15 Ulrich Drepper <drepper@redhat.com>
[BZ #9844]
* locales/iso14651_t1_common: Move U0138 entry.
[BZ #9833]
* locales/ko_KR: Fix noexpr. Add nostr.
[BZ #9891]
* locales/mt_MT: Fix spelling of August (Awwissu).
Patch by Martin Pitt.
2009-03-14 Ulrich Drepper <drepper@redhat.com>
[BZ #9916]
* SUPPORTED (SUPPORTED-LOCALES): Add nan_TW@latin.
* locales/nan_TW@latin: New file.
Contributed by Arne Goetje.
2009-02-11 Ulrich Drepper <drepper@redhat.com>
* locales/iso14651_t1_common: Add rules for sorting Malayalam.
+2
View File
@@ -258,6 +258,7 @@ km_KH/UTF-8 \
kn_IN/UTF-8 \
ko_KR.EUC-KR/EUC-KR \
ko_KR.UTF-8/UTF-8 \
ks_IN/UTF-8 \
ks_IN@devanagari/UTF-8 \
ku_TR.UTF-8/UTF-8 \
ku_TR/ISO-8859-9 \
@@ -287,6 +288,7 @@ ms_MY.UTF-8/UTF-8 \
ms_MY/ISO-8859-1 \
mt_MT.UTF-8/UTF-8 \
mt_MT/ISO-8859-3 \
nan_TW@latin/UTF-8 \
nb_NO.UTF-8/UTF-8 \
nb_NO/ISO-8859-1 \
nds_DE/UTF-8 \
+35 -35
View File
@@ -3325,34 +3325,34 @@ CHARMAP
<U107D> /xe1/x81/xbd MYANMAR LETTER SHAN PHA
<U107E> /xe1/x81/xbe MYANMAR LETTER SHAN FA
<U107F> /xe1/x81/xbf MYANMAR LETTER SHAN BA
<U1080> /xe1/x81/x80 MYANMAR LETTER SHAN THA
<U1081> /xe1/x81/x81 MYANMAR LETTER SHAN HA
<U1082> /xe1/x81/x82 MYANMAR CONSONANT SIGN SHAN MEDIAL WA
<U1083> /xe1/x81/x83 MYANMAR VOWEL SIGN SHAN AA
<U1084> /xe1/x81/x84 MYANMAR VOWEL SIGN SHAN E
<U1085> /xe1/x81/x85 MYANMAR VOWEL SIGN SHAN E ABOVE
<U1086> /xe1/x81/x86 MYANMAR VOWEL SIGN SHAN FINAL Y
<U1087> /xe1/x81/x87 MYANMAR SIGN SHAN TONE-2
<U1088> /xe1/x81/x88 MYANMAR SIGN SHAN TONE-3
<U1089> /xe1/x81/x89 MYANMAR SIGN SHAN TONE-5
<U108A> /xe1/x81/x8a MYANMAR SIGN SHAN TONE-6
<U108B> /xe1/x81/x8b MYANMAR SIGN SHAN COUNCIL TONE-2
<U108C> /xe1/x81/x8c MYANMAR SIGN SHAN COUNCIL TONE-3
<U108D> /xe1/x81/x8d MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE
<U108E> /xe1/x81/x8e MYANMAR LETTER RUMAI PALAUNG FA
<U108F> /xe1/x81/x8f MYANMAR SIGN RUMAI PALAUNG TONE-5
<U1090> /xe1/x81/x90 MYANMAR SHAN DIGIT ZERO
<U1091> /xe1/x81/x91 MYANMAR SHAN DIGIT ONE
<U1092> /xe1/x81/x92 MYANMAR SHAN DIGIT TWO
<U1093> /xe1/x81/x93 MYANMAR SHAN DIGIT THREE
<U1094> /xe1/x81/x94 MYANMAR SHAN DIGIT FOUR
<U1095> /xe1/x81/x95 MYANMAR SHAN DIGIT FIVE
<U1096> /xe1/x81/x96 MYANMAR SHAN DIGIT SIX
<U1097> /xe1/x81/x97 MYANMAR SHAN DIGIT SEVEN
<U1098> /xe1/x81/x98 MYANMAR SHAN DIGIT EIGHT
<U1099> /xe1/x81/x99 MYANMAR SHAN DIGIT NINE
<U109E> /xe1/x81/x9e MYANMAR SYMBOL SHAN ONE
<U109F> /xe1/x81/x9f MYANMAR SYMBOL SHAN EXCLAMATION
<U1080> /xe1/x82/x80 MYANMAR LETTER SHAN THA
<U1081> /xe1/x82/x81 MYANMAR LETTER SHAN HA
<U1082> /xe1/x82/x82 MYANMAR CONSONANT SIGN SHAN MEDIAL WA
<U1083> /xe1/x82/x83 MYANMAR VOWEL SIGN SHAN AA
<U1084> /xe1/x82/x84 MYANMAR VOWEL SIGN SHAN E
<U1085> /xe1/x82/x85 MYANMAR VOWEL SIGN SHAN E ABOVE
<U1086> /xe1/x82/x86 MYANMAR VOWEL SIGN SHAN FINAL Y
<U1087> /xe1/x82/x87 MYANMAR SIGN SHAN TONE-2
<U1088> /xe1/x82/x88 MYANMAR SIGN SHAN TONE-3
<U1089> /xe1/x82/x89 MYANMAR SIGN SHAN TONE-5
<U108A> /xe1/x82/x8a MYANMAR SIGN SHAN TONE-6
<U108B> /xe1/x82/x8b MYANMAR SIGN SHAN COUNCIL TONE-2
<U108C> /xe1/x82/x8c MYANMAR SIGN SHAN COUNCIL TONE-3
<U108D> /xe1/x82/x8d MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE
<U108E> /xe1/x82/x8e MYANMAR LETTER RUMAI PALAUNG FA
<U108F> /xe1/x82/x8f MYANMAR SIGN RUMAI PALAUNG TONE-5
<U1090> /xe1/x82/x90 MYANMAR SHAN DIGIT ZERO
<U1091> /xe1/x82/x91 MYANMAR SHAN DIGIT ONE
<U1092> /xe1/x82/x92 MYANMAR SHAN DIGIT TWO
<U1093> /xe1/x82/x93 MYANMAR SHAN DIGIT THREE
<U1094> /xe1/x82/x94 MYANMAR SHAN DIGIT FOUR
<U1095> /xe1/x82/x95 MYANMAR SHAN DIGIT FIVE
<U1096> /xe1/x82/x96 MYANMAR SHAN DIGIT SIX
<U1097> /xe1/x82/x97 MYANMAR SHAN DIGIT SEVEN
<U1098> /xe1/x82/x98 MYANMAR SHAN DIGIT EIGHT
<U1099> /xe1/x82/x99 MYANMAR SHAN DIGIT NINE
<U109E> /xe1/x82/x9e MYANMAR SYMBOL SHAN ONE
<U109F> /xe1/x82/x9f MYANMAR SYMBOL SHAN EXCLAMATION
<U10A0> /xe1/x82/xa0 GEORGIAN CAPITAL LETTER AN
<U10A1> /xe1/x82/xa1 GEORGIAN CAPITAL LETTER BAN
<U10A2> /xe1/x82/xa2 GEORGIAN CAPITAL LETTER GAN
@@ -3841,7 +3841,7 @@ CHARMAP
<U12AC> /xe1/x8a/xac ETHIOPIC SYLLABLE KEE
<U12AD> /xe1/x8a/xad ETHIOPIC SYLLABLE KE
<U12AE> /xe1/x8a/xae ETHIOPIC SYLLABLE KO
<U12AF> /xe1/x8a/x8f ETHIOPIC SYLLABLE KOA
<U12AF> /xe1/x8a/xaf ETHIOPIC SYLLABLE KOA
<U12B0> /xe1/x8a/xb0 ETHIOPIC SYLLABLE KWA
<U12B2> /xe1/x8a/xb2 ETHIOPIC SYLLABLE KWI
<U12B3> /xe1/x8a/xb3 ETHIOPIC SYLLABLE KWAA
@@ -27034,12 +27034,12 @@ CHARMAP
<U000103C3> /xf0/x90/x8f/x83 OLD PERSIAN SIGN HA
<U000103C8> /xf0/x90/x8f/x88 OLD PERSIAN SIGN AURAMAZDAA
<U000103C9> /xf0/x90/x8f/x89 OLD PERSIAN SIGN AURAMAZDAA-2
<U000103CA> /xf0/x90/x8f/x8A OLD PERSIAN SIGN AURAMAZDAAHA
<U000103CB> /xf0/x90/x8f/x8B OLD PERSIAN SIGN XSHAAYATHIYA
<U000103CC> /xf0/x90/x8f/x8C OLD PERSIAN SIGN DAHYAAUSH
<U000103CD> /xf0/x90/x8f/x8D OLD PERSIAN SIGN DAHYAAUSH-2
<U000103CE> /xf0/x90/x8f/x8E OLD PERSIAN SIGN BAGA
<U000103CF> /xf0/x90/x8f/x8F OLD PERSIAN SIGN BUUMISH
<U000103CA> /xf0/x90/x8f/x8a OLD PERSIAN SIGN AURAMAZDAAHA
<U000103CB> /xf0/x90/x8f/x8b OLD PERSIAN SIGN XSHAAYATHIYA
<U000103CC> /xf0/x90/x8f/x8c OLD PERSIAN SIGN DAHYAAUSH
<U000103CD> /xf0/x90/x8f/x8d OLD PERSIAN SIGN DAHYAAUSH-2
<U000103CE> /xf0/x90/x8f/x8e OLD PERSIAN SIGN BAGA
<U000103CF> /xf0/x90/x8f/x8f OLD PERSIAN SIGN BUUMISH
<U000103D0> /xf0/x90/x8f/x90 OLD PERSIAN WORD DIVIDER
<U000103D1> /xf0/x90/x8f/x91 OLD PERSIAN NUMBER ONE
<U000103D2> /xf0/x90/x8f/x92 OLD PERSIAN NUMBER TWO
-1
View File
@@ -32,7 +32,6 @@ category "bn_BD:2001";LC_NAME
END LC_IDENTIFICATION
LC_COLLATE
% TODO: Bengali sorting should be added
copy "iso14651_t1"
END LC_COLLATE
+3 -3
View File
@@ -2438,9 +2438,9 @@ abmon "<U006C><U0065><U0064>";/
% "<U004E><U006F><U0076>";/
% "<U0044><U0065><U0063>"
week 7;19971201;4
first_weekday 1
first_workday 1
week 7;19971130;4
first_weekday 2
first_workday 2
d_t_fmt "<U0025><U0061><U00A0><U0025><U002D><U0064><U002E><U00A0><U0025><U0042><U00A0><U0025><U0059><U002C><U00A0><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U00A0><U0025><U005A>"
+1 -1
View File
@@ -184,7 +184,7 @@ 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;19971201;4
week 7;19971130;4
first_weekday 2
first_workday 2
END LC_TIME
+3 -3
View File
@@ -209,9 +209,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;19971201;4
first_weekday 1
first_workday 1
week 7;19971130;4
first_weekday 2
first_workday 2
END LC_TIME
LC_MESSAGES
+3 -3
View File
@@ -155,9 +155,9 @@ date_fmt "<U0025><U0061><U0020><U0025><U002D><U0064><U002E><U0020>/
<U0025><U0062><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>/
<U0020><U0025><U005A><U0020><U0025><U0059>"
week 7;19971201;4
first_weekday 1
first_workday 1
week 7;19971130;4
first_weekday 2
first_workday 2
END LC_TIME
LC_MESSAGES
+1 -1
View File
@@ -121,7 +121,7 @@ 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;19971201;4
week 7;19971130;4
first_weekday 2
first_workday 2
END LC_TIME
+1 -5
View File
@@ -166,11 +166,7 @@ END LC_MESSAGES
LC_PAPER
% This is the ISO_IEC TR14652 Locale definition for the LC_PAPER category
% generated by IBM Basic CountryPack Transformer.
height 297
width 210
copy "tl_PH"
END LC_PAPER
+2 -4
View File
@@ -125,10 +125,8 @@ date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
END LC_TIME
LC_PAPER
% FIXME
height 297
% FIXME
width 210
height 279
width 216
END LC_PAPER
LC_TELEPHONE
+2 -4
View File
@@ -125,10 +125,8 @@ date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
END LC_TIME
LC_PAPER
% FIXME
height 297
% FIXME
width 210
height 279
width 216
END LC_PAPER
LC_TELEPHONE
+2 -4
View File
@@ -125,10 +125,8 @@ date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
END LC_TIME
LC_PAPER
% FIXME
height 297
% FIXME
width 210
height 279
width 216
END LC_PAPER
LC_TELEPHONE
+1 -2
View File
@@ -177,8 +177,7 @@ date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
END LC_TIME
LC_PAPER
height 279
width 216
copy "en_US"
END LC_PAPER
LC_TELEPHONE
+2 -4
View File
@@ -126,10 +126,8 @@ date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
END LC_TIME
LC_PAPER
% FIXME
height 297
% FIXME
width 210
height 279
width 216
END LC_PAPER
LC_TELEPHONE
+1 -1
View File
@@ -2196,7 +2196,7 @@ 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;19971201;4
week 7;19971130;4
first_weekday 1
first_workday 1
END LC_TIME
+1 -2
View File
@@ -150,8 +150,7 @@ noexpr "<U005B><U0068><U0048><U006E><U004E><U005D><U002E><U002A>"
END LC_MESSAGES
LC_PAPER
height 297
width 210
copy "tl_PH"
END LC_PAPER
LC_MEASUREMENT
+3 -3
View File
@@ -141,9 +141,9 @@ 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;19971201;4
first_weekday 1
first_workday 1
week 7;19971130;4
first_weekday 2
first_workday 2
END LC_TIME
LC_PAPER
+3 -3
View File
@@ -110,9 +110,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;19971201;4
first_weekday 1
first_workday 1
week 7;19971130;4
first_weekday 2
first_workday 2
END LC_TIME
LC_PAPER

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