[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commits] r18307 - in /fsf/trunk/libc: ./ conform/ conform/data/ conform/data/netinet/ elf/ math/ scripts/ sysdeps/i386/fpu/ sysdeps/i...



Author: eglibc
Date: Wed May  2 00:01:51 2012
New Revision: 18307

Log:
Import glibc-mainline for 2012-05-02

Added:
    fsf/trunk/libc/scripts/check-execstack.awk
    fsf/trunk/libc/scripts/check-textrel.awk
    fsf/trunk/libc/scripts/localplt.awk
Removed:
    fsf/trunk/libc/elf/check-execstack.c
    fsf/trunk/libc/elf/check-localplt.c
    fsf/trunk/libc/elf/check-textrel.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/Makeconfig
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/config.make.in
    fsf/trunk/libc/conform/conformtest.pl
    fsf/trunk/libc/conform/data/assert.h-data
    fsf/trunk/libc/conform/data/cpio.h-data
    fsf/trunk/libc/conform/data/ctype.h-data
    fsf/trunk/libc/conform/data/errno.h-data
    fsf/trunk/libc/conform/data/float.h-data
    fsf/trunk/libc/conform/data/fmtmsg.h-data
    fsf/trunk/libc/conform/data/iso646.h-data
    fsf/trunk/libc/conform/data/limits.h-data
    fsf/trunk/libc/conform/data/math.h-data
    fsf/trunk/libc/conform/data/netinet/in.h-data
    fsf/trunk/libc/conform/data/signal.h-data
    fsf/trunk/libc/conform/data/stddef.h-data
    fsf/trunk/libc/conform/data/stdint.h-data
    fsf/trunk/libc/conform/data/stdlib.h-data
    fsf/trunk/libc/conform/data/tar.h-data
    fsf/trunk/libc/elf/Makefile
    fsf/trunk/libc/math/libm-test.inc
    fsf/trunk/libc/math/s_nexttowardf.c
    fsf/trunk/libc/sysdeps/i386/fpu/s_nexttoward.c
    fsf/trunk/libc/sysdeps/i386/fpu/s_nexttowardf.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_nexttoward.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_nexttoward.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c
    fsf/trunk/libc/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S
    fsf/trunk/libc/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S
    fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/ld.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libm.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libpthread.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/librt.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/ld.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libm.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libpthread.abilist

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed May  2 00:01:51 2012
@@ -1,3 +1,498 @@
+2012-05-01  Roland McGrath  <roland@xxxxxxxxxxxxx>
+
+	* elf/Makefile ($(objpfx)check-localplt.out): Redirect the test's
+	output to the target.
+
+	* scripts/localplt.awk: New file.
+	* elf/Makefile ($(objpfx)check-localplt): Target removed.
+	(check-localplt-CFLAGS): Variable removed.
+	($(all-built-dso:=.jmprel)): New static pattern rule.
+	(generated): Add those targets.
+	(localplt-built-dso): New variable.
+	($(objpfx)check-localplt.out): Use the script on the .jmprel files.
+
+	* elf/check-localplt.c: File removed.
+
+	* scripts/check-execstack.awk: New file.
+	* elf/Makefile ($(objpfx)check-execstack): Target removed.
+	(check-execstack-CFLAGS): Variable removed.
+	($(objpfx)check-execstack.h): Target removed.
+	($(objpfx)execstack-default): New target.
+	(generated): Add that instead of check-execstack.h.
+	($(all-built-dso:=.phdr)): New static pattern rule.
+	(generated): Add those targets.
+	* elf/check-execstack.c: File removed.
+
+	* scripts/check-textrel.awk: New file.
+	* elf/Makefile ($(objpfx)check-textrel): Target removed.
+	(check-textrel-CFLAGS): Variable removed.
+	(all-built-dso): Use := to define.o
+	($(all-built-dso:=.dyn)): New static pattern rule.
+	(generated): Add those targets.
+	($(objpfx)check-textrel.out): Use the script on the .dyn files.
+	* config.make.in (READELF): New substituted variable.
+	* elf/check-textrel.c: File removed.
+
+2012-05-01  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* conform/data/assert.h-data [ISO || ISO99 || ISO11] (*_t): Do not
+	allow.
+	* conform/data/ctype.h-data [C99-based standards] (isblank):
+	Expect function.
+	(is*): Change to is[abcdefghijklmnopqrstuvwxyz]*.
+	(to*): Change to to[abcdefghijklmnopqrstuvwxyz]*.
+	[ISO || ISO99 || ISO11] (*_t): Do not allow.
+	* conform/data/errno.h-data (EDOM): Use macro-int-constant.
+	Specify type.  Require positive value.
+	(EILSEQ): Likewise.
+	(ERANGE): Likewise.
+	[ISO || POSIX] (EILSEQ): Do not expect.
+	[!ISO && !ISO99 && !ISO11] (E2BIG): Use macro-int-constant.
+	Specify type.  Require positive value.
+	[!ISO && !ISO99 && !ISO11] (EACCES): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EADDRINUSE): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EADDRNOTAVAIL): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EAFNOSUPPORT): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EAGAIN): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EALREADY): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EBADF): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EBADMSG): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EBUSY): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ECANCELED): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ECHILD): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ECONNABORTED): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ECONNREFUSED): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ECONNRESET): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EDEADLK): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EDESTADDRREQ): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EDQUOT): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EEXIST): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EFAULT): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EFBIG): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EHOSTUNREACH): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EIDRM): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EINPROGRESS): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EINTR): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EINVAL): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EIO): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EISCONN): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EISDIR): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ELOOP): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EMFILE): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EMLINK): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EMSGSIZE): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EMULTIHOP): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENAMETOOLONG): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENETDOWN): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENETUNREACH): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENFILE): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOBUFS): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENODATA): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENODEV): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOENT): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOEXEC): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOLCK): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOLINK): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOMEM): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOMSG): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOPROTOOPT): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOSPC): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOSR): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOSTR): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOSYS): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOTCONN): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOTDIR): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOTEMPTY): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOTSOCK): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOTSUP): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENOTTY): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ENXIO): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EOPNOTSUPP): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EOVERFLOW): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EPERM): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EPIPE): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EPROTO): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EPROTONOSUPPORT): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EPROTOTYPE): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EROFS): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ESPIPE): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ESRCH): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ESTALE): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ETIME): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ETIMEDOUT): Likewise.
+	[!ISO && !ISO99 && !ISO11] (ETXTBSY): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EWOULDBLOCK): Likewise.
+	[!ISO && !ISO99 && !ISO11] (EXDEV): Likewise.
+	[XOPEN2K8 || defined POSIX2008] (ENOTRECOVERABLE): Likewise.
+	[XOPEN2K8 || defined POSIX2008] (EOWNERDEAD): Likewise.
+	* conform/data/float.h-data (FLT_RADIX): Use macro-int-constant.
+	Require >= 2.
+	(FLT_ROUNDS): Expect as macro, not constant.
+	(FLT_MANT_DIG): Use macro-int-constant.
+	(DBL_MANT_DIG): Likewise.
+	(LDBL_MANT_DIG): Likewise.
+	(FLT_DIG): Likewise.
+	(DBL_DIG): Likewise.
+	(LDBL_DIG): Likewise.
+	(FLT_MIN_EXP): Use macro-int-constant.  Require < 0.
+	(DBL_MIN_EXP): Likewise.
+	(LDBL_MIN_EXP): Likewise.
+	(FLT_MAX_EXP): Use macro-int-constant.
+	(DBL_MAX_EXP): Likewise.
+	(LDBL_MAX_EXP): Likewise.
+	(FLT_MAX_10_EXP): Likewise.
+	(DBL_MAX_10_EXP): Likewise.
+	(LDBL_MAX_10_EXP): Likewise.
+	(FLT_MAX): Use macro-constant.
+	(DBL_MAX): Likewise.
+	(LDBL_MAX): Likewise.
+	(FLT_EPSILON): Use macro-constant.  Give upper bound.
+	(DBL_EPSILON): Likewise.
+	(LDBL_EPSILON): Likewise.
+	(FLT_MIN): Likewise.
+	(DBL_MIN): Likewise.
+	(LDBL_MIN): Likewise.
+	[C99-based standards] (DECIMAL_DIG): Use macro-int-constant.
+	[C99-based standards] (FLT_EVAL_METHOD): Likewise.
+	[ISO11] (DBL_HAS_SUBNORM): Use macro-int-constant.
+	[ISO11] (FLT_HAS_SUBNORM): Likewise.
+	[ISO11] (LDBL_HAS_SUBNORM): Likewise.
+	[ISO11] (DBL_DECIMAL_DIG): Likewise.
+	[ISO11] (FLT_DECIMAL_DIG): Likewise.
+	[ISO11] (LDBL_DECIMAL_DIG): Likewise.
+	[ISO11] (DBL_TRUE_MIN): Use macro-constant.
+	[ISO11] (FLT_TRUE_MIN): Likewise.
+	[ISO11] (LDBL_TRUE_MIN): Likewise.
+	[ISO || ISO99 || ISO11] (*_t): Do not allow.
+	* conform/data/limits.h-data (CHAR_BIT): Use macro-int-constant.
+	(SCHAR_MIN): Use macro-int-constant.  Specify type.
+	(SCHAR_MAX): Likewise.
+	(UCHAR_MAX): Likewise.
+	(CHAR_MIN): Likewise.
+	(CHAR_MAX): Likewise.
+	(MB_LEN_MAX): Use macro-int-constant.
+	(SHRT_MIN): Use macro-int-constant.  Specify type.
+	(SHRT_MAX): Likewise.
+	(USHRT_MAX): Likewise.
+	(INT_MAX): Likewise.
+	(INT_MIN): Use macro-int-constant.  Specify type.  Make upper
+	bound negative.
+	(UINT_MAX): Use macro-int-constant.  Specify type.  Suffix lower
+	bound with "U".
+	(LONG_MAX): Use macro-int-constant.  Specify type.  Suffix lower
+	bound with "L".
+	(LONG_MIN): Use macro-int-constant.  Specify type.  Make upper
+	bound negative.  Suffix upper bound with "L".
+	(ULONG_MAX): Use macro-int-constant.  Specify type.  Suffix lower
+	bound with "UL".
+	[C99-based standards] (LLONG_MIN): Use macro-int-constant.
+	Specify type.
+	[C99-based standards] (LLONG_MAX): Likewise.
+	[C99-based standards] (ULLONG_MAX): Likewise.
+	* conform/data/stddef.h-data (NULL): Use macro-constant.  Require
+	== 0.
+	[ISO11] (max_align_t): Require type.
+	[ISO || ISO99 || ISO11] (*_t): Do not allow.
+
+	* conform/conformtest.pl ($CFLAGS_namespace): Define separately
+	from $CFLAGS, without defining away __attribute__ calls.
+	(checknamespace): Use $CFLAGS_namespace.
+
+	* conform/conformtest.pl (@keywords): Only include C99 keywords
+	for standards based on C99 or C11.
+
+	* conform/data/iso646.h-data [ISO || POSIX || XPG3 || XPG4]:
+	Disable tests.
+	* conform/data/stdint.h-data [ISO || POSIX || XPG3 || XPG4 ||
+	UNIX98]: Likewise.
+
+	* conform/conformtest.pl: Handle "macro-int-constant" and test for
+	usability of symbols in #if.
+
+	* conform/conformtest.pl: If macro or constant types start
+	"promoted:", expect the symbol to be of the following type
+	promoted by the integer promotions.
+
+	* conform/conformtest.pl: Parse all "constant" and "macro" lines
+	in one place.  Also handle "macro-constant".
+
+	* conform/conformtest.pl: Only accept expected macro values with
+	"==".  Parse all "macro" lines in one place.
+	* conform/data/stdlib.h-data: Use "==" form on "macro" lines.
+
+	* conform/conformtest.pl: Handle braced types on "constant" lines
+	instead of handling "typed-constant".
+	* conform/data/signal.h-data: Use "constant" instead of
+	"typed-constant".
+
+	* conform/conformtest.pl: Handle "optional-" at start of lines in
+	one place rather than duplicating several cases.  Handle each
+	format of "macro" line with initial "optional-".
+
+	* conform/conformtest.pl: Only accept expected constant or
+	optional-constant values with "==".  Parse all "constant" lines in
+	one place.  Parse all "optional-constant" lines in one place.
+	* conform/data/cpio.h-data: Use "==" form on "constant" lines.
+	* conform/data/fmtmsg.h-data: Likewise.
+	* conform/data/netinet/in.h-data: Likewise.
+	* conform/data/tar.h-data: Likewise.
+	* conform/data/limits.h-data: Use "==" form on "constant" and
+	"optional-constant" lines.
+
+	* conform/conformtest.pl: Use -ansi for XPG3, XPG4 and UNIX98.
+	Use -std=c99 for XOPEN2K.
+	(@knownproblems): Remove.
+	(newtoken): Don't check %isknown.
+
+	* conform/data/math.h-data [XPG3 || XPG4 || UNIX98] (fpclassify):
+	Do not expect macro.
+	[XPG3 || XPG4 || UNIX98] (isfinite): Likewise.
+	[XPG3 || XPG4 || UNIX98] (isinf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (isnan): Likewise.
+	[XPG3 || XPG4 || UNIX98] (isnormal): Likewise.
+	[XPG3 || XPG4 || UNIX98] (signbit): Likewise.
+	[XPG3 || XPG4 || UNIX98] (isgreater): Likewise.
+	[XPG3 || XPG4 || UNIX98] (isgreaterequal): Likewise.
+	[XPG3 || XPG4 || UNIX98] (isless): Likewise.
+	[XPG3 || XPG4 || UNIX98] (islessequal): Likewise.
+	[XPG3 || XPG4 || UNIX98] (islessgreater): Likewise.
+	[XPG3 || XPG4 || UNIX98] (isunordered): Likewise.
+	[XPG3 || XPG4 || UNIX98] (isnan): Expect as function.
+	[XPG3 || XPG4 || UNIX98] (HUGE_VALF): Do not expect.
+	[XPG3 || XPG4 || UNIX98] (HUGE_VALL): Likewise.
+	[XPG3 || XPG4 || UNIX98] (INFINITY): Likewise.
+	[XPG3 || XPG4 || UNIX98] (NAN): Likewise.
+	[XPG3 || XPG4 || UNIX98] (FP_INFINITE): Likewise.
+	[XPG3 || XPG4 || UNIX98] (FP_NAN): Likewise.
+	[XPG3 || XPG4 || UNIX98] (FP_NORMAL): Likewise.
+	[XPG3 || XPG4 || UNIX98] (FP_SUBNORMAL): Likewise.
+	[XPG3 || XPG4 || UNIX98] (FP_ZERO): Likewise.
+	[XPG3 || XPG4 || UNIX98] (FP_FAST_FMA): Likewise.
+	[XPG3 || XPG4 || UNIX98] (FP_FAST_FMAF): Likewise.
+	[XPG3 || XPG4 || UNIX98] (FP_FAST_FMAL): Likewise.
+	[XPG3 || XPG4 || UNIX98] (FP_ILOGB0): Likewise.
+	[XPG3 || XPG4 || UNIX98] (FP_ILOGBNAN): Likewise.
+	[XPG3 || XPG4 || UNIX98] (copysign): Likewise.
+	[XPG3 || XPG4 || UNIX98] (exp2): Likewise.
+	[XPG3 || XPG4 || UNIX98] (log2): Likewise.
+	[XPG3 || XPG4 || UNIX98] (tgama): Likewise.
+	[XPG3] (acosh): Likewise.
+	[XPG3] (asinh): Likewise.
+	[XPG3] (atanh): Likewise.
+	[XPG3] (cbrt): Likewise.
+	[XPG3] (expm1): Likewise.
+	[XPG3] (ilogb): Likewise.
+	[XPG3] (log1p): Likewise.
+	[XPG3] (logb): Likewise.
+	[XPG3] (nextafter): Likewise.
+	[XPG3 || XPG4 || UNIX98] (nexttoward): Likewise.
+	[XPG3 || XPG4 || UNIX98] (nearbyint): Likewise.
+	[XPG3] (remainder): Likewise.
+	[XPG3] (rint): Likewise.
+	[XPG3 || XPG4 || UNIX98] (round): Likewise.
+	[XPG3 || XPG4 || UNIX98] (trunc): Likewise.
+	[XPG3 || XPG4 || UNIX98] (lrint): Likewise.
+	[XPG3 || XPG4 || UNIX98] (llrint): Likewise.
+	[XPG3 || XPG4 || UNIX98] (lround): Likewise.
+	[XPG3 || XPG4 || UNIX98] (llround): Likewise.
+	[XPG3 || XPG4 || UNIX98] (remquo): Likewise.
+	[UNIX98 || XOPEN2K] (scalb): Expect.
+	[XPG3 || XPG4 || UNIX98] (scalbn): Do not expect.
+	[XPG3 || XPG4 || UNIX98] (scalbln): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fdim): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fmax): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fmin): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fma): Likewise.
+	[XPG3 || XPG4 || UNIX98] (nan): Likewise.
+	[XPG3 || XPG4 || UNIX98] (acosf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (asinf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (atanf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (atan2f): Likewise.
+	[XPG3 || XPG4 || UNIX98] (ceilf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (copysignf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (cosf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (coshf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (expf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (exp2f): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fabsf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (floorf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fmodf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (frexpf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (ldexpf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (logf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (log10f): Likewise.
+	[XPG3 || XPG4 || UNIX98] (log2f): Likewise.
+	[XPG3 || XPG4 || UNIX98] (modff): Likewise.
+	[XPG3 || XPG4 || UNIX98] (powf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (sinf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (sinhf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (sqrtf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (tanf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (tanhf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (erff): Likewise.
+	[XPG3 || XPG4 || UNIX98] (erfcf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (gammaf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (hypotf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (j0f): Likewise.
+	[XPG3 || XPG4 || UNIX98] (j1f): Likewise.
+	[XPG3 || XPG4 || UNIX98] (jnf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (lgammaf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (tgammaf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (y0f): Likewise.
+	[XPG3 || XPG4 || UNIX98] (y1f): Likewise.
+	[XPG3 || XPG4 || UNIX98] (ynf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (acoshf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (asinhf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (atanhf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (cbrtf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (expm1f): Likewise.
+	[XPG3 || XPG4 || UNIX98] (ilogbf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (log1pf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (logbf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (nextafterf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (nexttowardf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (nearbyintf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (remainderf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (rintf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (roundf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (truncf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (lrintf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (llrintf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (lroundf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (llroundf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (remquof): Likewise.
+	[XPG3 || XPG4 || UNIX98] (scalbf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (scalbnf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (scalblnf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fdimf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fmaxf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fminf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fmaf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (nanf): Likewise.
+	[XPG3 || XPG4 || UNIX98] (acosl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (asinl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (atanl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (atan2l): Likewise.
+	[XPG3 || XPG4 || UNIX98] (ceill): Likewise.
+	[XPG3 || XPG4 || UNIX98] (copysignl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (cosl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (coshl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (expl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (exp2l): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fabsl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (floorl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fmodl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (frexpl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (ldexpl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (logl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (log10l): Likewise.
+	[XPG3 || XPG4 || UNIX98] (log2l): Likewise.
+	[XPG3 || XPG4 || UNIX98] (modfl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (powl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (sinl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (sinhl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (sqrtl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (tanl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (tanhl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (erfl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (erfcl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (gammal): Likewise.
+	[XPG3 || XPG4 || UNIX98] (hypotl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (j0l): Likewise.
+	[XPG3 || XPG4 || UNIX98] (j1l): Likewise.
+	[XPG3 || XPG4 || UNIX98] (jnl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (lgammal): Likewise.
+	[XPG3 || XPG4 || UNIX98] (tgammal): Likewise.
+	[XPG3 || XPG4 || UNIX98] (y0l): Likewise.
+	[XPG3 || XPG4 || UNIX98] (y1l): Likewise.
+	[XPG3 || XPG4 || UNIX98] (ynl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (acoshl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (asinhl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (atanhl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (cbrtl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (expm1l): Likewise.
+	[XPG3 || XPG4 || UNIX98] (ilogbl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (log1pl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (logbl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (nextafterl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (nexttowardl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (nearbyintl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (remainderl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (rintl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (roundl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (truncl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (lrintl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (llrintl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (lroundl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (llroundl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (remquol): Likewise.
+	[XPG3 || XPG4 || UNIX98] (scalbl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (scalbnl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (scalblnl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fdiml): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fmaxl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fminl): Likewise.
+	[XPG3 || XPG4 || UNIX98] (fmal): Likewise.
+	[XPG3 || XPG4 || UNIX98] (nanl): Likewise.
+
+	* conform/conformtest.pl: Define _XOPEN_SOURCE as well as
+	_XOPEN_SOURCE_EXTENDED for XPG4.
+
+	* conform/conformtest.pl: Handle "symbol" lines for allow-header.
+
+	* Makeconfig (localtime): Remove variable.
+	(inst_localtime-file): Likewise.
+
+2012-05-01  Andreas Schwab  <schwab@xxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/ld.abilist:
+	Update.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist:
+	Update.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libm.abilist:
+	Update.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libpthread.abilist:
+	Update.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/librt.abilist:
+	Update.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/ld.abilist:
+	Update.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist:
+	Update.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libm.abilist:
+	Update.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libpthread.abilist:
+	Update.
+
+2012-05-01  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	[BZ #2550]
+	[BZ #2570]
+	* math/s_nexttowardf.c (__nexttowardf): Use floating-point
+	comparisons to determine direction to adjust input.
+	* sysdeps/i386/fpu/s_nexttoward.c (__nexttoward): Likewise.
+	* sysdeps/i386/fpu/s_nexttowardf.c(__nexttowardf): Likewise.
+	* sysdeps/ieee754/ldbl-128/s_nexttoward.c (__nexttoward):
+	Likewise.
+	* sysdeps/ieee754/ldbl-128/s_nexttowardf.c (__nexttowardf):
+	Likewise.
+	* sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c (__nexttowardf):
+	Likewise.
+	* sysdeps/ieee754/ldbl-96/s_nexttoward.c (__nexttoward): Likewise.
+	* sysdeps/ieee754/ldbl-96/s_nexttowardf.c (__nexttowardf):
+	Likewise.
+	* sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c (__nldbl_nexttowardf):
+	Likewise.
+	* math/libm-test.inc (nexttoward_test): Add more tests.
+
+2012-05-01  Andreas Schwab  <schwab@xxxxxxxxxxxxxx>
+
+	[BZ #14040]
+	* sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S (nearbyintl): Define
+	in version GLIBC_2.1, not GLIBC_2.0.
+	* sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S (nearbyintl):
+	Likewise.
+
 2012-04-30  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	[BZ #13942]
@@ -3206,6 +3701,7 @@
 	* dlfcn/Makefile: Likewise.
 	* posix/Makefile: Likewise.
 
+	[BZ #6959]
 	* timezone/Makefile: Don't install timezone files, just the programs
 	and scripts.
 

Modified: fsf/trunk/libc/Makeconfig
==============================================================================
--- fsf/trunk/libc/Makeconfig (original)
+++ fsf/trunk/libc/Makeconfig Wed May  2 00:01:51 2012
@@ -291,13 +291,6 @@
 endif
 inst_vardbdir = $(install_root)$(vardbdir)
 
-# What timezone should be the installed default (e.g., US/Eastern).
-# Run `make -C time echo-zonenames' to see a list of available zone names.
-# The local timezone can be changed with `zic -l TIMEZONE' at any time.
-ifndef localtime
-localtime = Factory
-endif
-
 # Where to install the "localtime" timezone file; this is the file whose
 # contents $(localtime) specifies.  If this is a relative pathname, it is
 # relative to $(zonedir).  It is a good idea to put this somewhere
@@ -305,7 +298,6 @@
 # localizing the configuration data elsewhere.
 ifndef localtime-file
 localtime-file = $(sysconfdir)/localtime
-inst_localtime-file = $(install_root)$(localtime-file)
 endif
 
 # What to use for leap second specifications in compiling the default

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Wed May  2 00:01:51 2012
@@ -9,20 +9,21 @@
 
 * The following bugs are resolved with this release:
 
-  174, 350, 369, 411, 706, 887, 2074, 2541, 2547, 2548, 2551, 2552, 2553,
-  2554, 2562, 2563, 2565, 2566, 2576, 2636, 2678, 3335, 3768, 3866, 3868,
-  3976, 3992, 4026, 4108, 4596, 4822, 5077, 5461, 5805, 5993, 6471, 6486,
-  6578, 6649, 6730, 6770, 6794, 6884, 6890, 6894, 6895, 6907, 6911, 7064,
-  9739, 9902, 10110, 10135, 10140, 10153, 10210, 10254, 10346, 10545, 10716,
-  11174, 11322, 11365, 11451, 11494, 11521, 11959, 12047, 12340, 13058,
-  13525, 13526, 13527, 13528, 13529, 13530, 13531, 13532, 13533, 13547,
-  13551, 13552, 13553, 13555, 13559, 13566, 13583, 13592, 13618, 13637,
-  13656, 13658, 13673, 13691, 13695, 13704, 13705, 13706, 13726, 13738,
-  13739, 13758, 13760, 13761, 13786, 13792, 13806, 13824, 13840, 13841,
-  13844, 13846, 13851, 13852, 13854, 13871, 13872, 13873, 13879, 13883,
-  13886, 13892, 13895, 13908, 13910, 13911, 13912, 13913, 13915, 13916,
-  13917, 13918, 13919, 13920, 13921, 13924, 13926, 13927, 13928, 13938,
-  13941, 13942, 13963, 13967, 13970, 13973, 14027, 14033, 14034
+  174, 350, 369, 411, 706, 887, 2074, 2541, 2547, 2548, 2550, 2551, 2552,
+  2553, 2554, 2562, 2563, 2565, 2566, 2570, 2576, 2636, 2678, 3335, 3768,
+  3866, 3868, 3976, 3992, 4026, 4108, 4596, 4822, 5077, 5461, 5805, 5993,
+  6471, 6486, 6578, 6649, 6730, 6770, 6794, 6884, 6890, 6894, 6895, 6907,
+  6911, 6959, 7064, 9739, 9902, 10110, 10135, 10140, 10153, 10210, 10254,
+  10346, 10545, 10716, 11174, 11322, 11365, 11451, 11494, 11521, 11959,
+  12047, 12340, 13058, 13525, 13526, 13527, 13528, 13529, 13530, 13531,
+  13532, 13533, 13547, 13551, 13552, 13553, 13555, 13559, 13566, 13583,
+  13592, 13618, 13637, 13656, 13658, 13673, 13691, 13695, 13704, 13705,
+  13706, 13726, 13738, 13739, 13758, 13760, 13761, 13786, 13792, 13806,
+  13824, 13840, 13841, 13844, 13846, 13851, 13852, 13854, 13871, 13872,
+  13873, 13879, 13883, 13886, 13892, 13895, 13908, 13910, 13911, 13912,
+  13913, 13915, 13916, 13917, 13918, 13919, 13920, 13921, 13924, 13926,
+  13927, 13928, 13938, 13941, 13942, 13963, 13967, 13970, 13973, 14027,
+  14033, 14034, 14040
 
 * ISO C11 support:
 

Modified: fsf/trunk/libc/config.make.in
==============================================================================
--- fsf/trunk/libc/config.make.in (original)
+++ fsf/trunk/libc/config.make.in Wed May  2 00:01:51 2012
@@ -112,6 +112,7 @@
 AUTOCONF = @AUTOCONF@
 OBJDUMP = @OBJDUMP@
 OBJCOPY = @OBJCOPY@
+READELF = @READELF@
 
 # Installation tools.
 INSTALL = @INSTALL@

Modified: fsf/trunk/libc/conform/conformtest.pl
==============================================================================
--- fsf/trunk/libc/conform/conformtest.pl (original)
+++ fsf/trunk/libc/conform/conformtest.pl Wed May  2 00:01:51 2012
@@ -36,14 +36,15 @@
 $CFLAGS{"ISO99"} = "-std=c99";
 $CFLAGS{"ISO11"} = "-std=c1x -D_ISOC11_SOURCE";
 $CFLAGS{"POSIX"} = "-D_POSIX_C_SOURCE=199912 -ansi";
-$CFLAGS{"XPG3"} = "-D_XOPEN_SOURCE";
-$CFLAGS{"XPG4"} = "-D_XOPEN_SOURCE_EXTENDED";
-$CFLAGS{"UNIX98"} = "-D_XOPEN_SOURCE=500";
-$CFLAGS{"XOPEN2K"} = "-D_XOPEN_SOURCE=600";
+$CFLAGS{"XPG3"} = "-ansi -D_XOPEN_SOURCE";
+$CFLAGS{"XPG4"} = "-ansi -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED";
+$CFLAGS{"UNIX98"} = "-ansi -D_XOPEN_SOURCE=500";
+$CFLAGS{"XOPEN2K"} = "-std=c99 -D_XOPEN_SOURCE=600";
 $CFLAGS{"XOPEN2K8"} = "-std=c99 -D_XOPEN_SOURCE=700";
 $CFLAGS{"POSIX2008"} = "-std=c99 -D_POSIX_C_SOURCE=200809L";
 
-$CFLAGS = "$flags -fno-builtin '-D__attribute__(x)=' $CFLAGS{$standard} -D_ISOMAC";
+$CFLAGS_namespace = "$flags -fno-builtin $CFLAGS{$standard} -D_ISOMAC";
+$CFLAGS = "$CFLAGS_namespace '-D__attribute__(x)='";
 
 # Check standard name for validity.
 die "unknown standard \"$standard\"" if ($CFLAGS{$standard} eq "");
@@ -64,24 +65,19 @@
 #   $mustprepend{'wordexp.h'} = "#include <stddef.h>\n";
 # }
 
-# These are the ISO C99 keywords.
+# These are the ISO C90 keywords.
 @keywords = ('auto', 'break', 'case', 'char', 'const', 'continue', 'default',
 	     'do', 'double', 'else', 'enum', 'extern', 'float', 'for', 'goto',
-	     'if', 'inline', 'int', 'long', 'register', 'restrict', 'return',
+	     'if', 'int', 'long', 'register', 'return',
 	     'short', 'signed', 'sizeof', 'static', 'struct', 'switch',
 	     'typedef', 'union', 'unsigned', 'void', 'volatile', 'while');
+if ($CFLAGS{$standard} =~ /-std=(c99|c1x)/) {
+  push (@keywords, 'inline', 'restrict');
+}
 
 # Make a hash table from this information.
 while ($#keywords >= 0) {
   $iskeyword{pop (@keywords)} = 1;
-}
-
-# These are symbols which are known to pollute the namespace.
-@knownproblems = ('unix', 'linux', 'i386');
-
-# Make a hash table from the known problems.
-while ($#knownproblems >= 0) {
-  $isknown{pop (@knownproblems)} = 1;
 }
 
 $verbose = 1;
@@ -240,10 +236,6 @@
   for ($idx = 0; $idx <= $#allow; ++$idx) {
     return if (poorfnmatch ($allow[$idx], $token));
   }
-
-  unless ($isknown{$token}) {
-    $errors{$token} = 1;
-  }
 }
 
 
@@ -271,7 +263,7 @@
 
   undef %errors;
   $nknown = 0;
-  open (CONTENT, "$CC $CFLAGS -E $fnamebase.c -P -Wp,-dN | sed -e '/^# [1-9]/d' -e '/^[[:space:]]*\$/d' |");
+  open (CONTENT, "$CC $CFLAGS_namespace -E $fnamebase.c -P -Wp,-dN | sed -e '/^# [1-9]/d' -e '/^[[:space:]]*\$/d' |");
   loop: while (<CONTENT>) {
     chop;
     if (/^#define (.*)/) {
@@ -350,6 +342,11 @@
       last control if ($missing);
     }
 
+    my($optional) = 0;
+    if (/^optional-/) {
+      s/^optional-//;
+      $optional = 1;
+    }
     if (/^element *({([^}]*)}|([^{ ]*)) *({([^}]*)}|([^{ ]*)) *([A-Za-z0-9_]*) *(.*)/) {
       my($struct) = "$2$3";
       my($type) = "$5$6";
@@ -373,47 +370,12 @@
       close (TESTFILE);
 
       $res = compiletest ($fnamebase, "Testing for member $member",
-			  "Member \"$member\" not available.", $res, 0);
-
-
-      # Test the types of the members.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      print TESTFILE "$struct a;\n";
-      print TESTFILE "extern $type b$rest;\n";
-      print TESTFILE "extern __typeof__ (a.$member) b;\n";
-      close (TESTFILE);
-
-      compiletest ($fnamebase, "Testing for type of member $member",
-		   "Member \"$member\" does not have the correct type.",
-		   $res, 0);
-    } elsif (/^optional-element *({([^}]*)}|([^{ ]*)) *({([^}]*)}|([^{ ]*)) *([A-Za-z0-9_]*) *(.*)/) {
-      my($struct) = "$2$3";
-      my($type) = "$5$6";
-      my($member) = "$7";
-      my($rest) = "$8";
-      my($res) = $missing;
-
-      # Remember that this name is allowed.
-      push @allow, $member;
-
-      # Generate a program to test for the availability of this member.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      print TESTFILE "$struct a;\n";
-      print TESTFILE "$struct b;\n";
-      print TESTFILE "extern void xyzzy (__typeof__ (&b.$member), __typeof__ (&a.$member), unsigned);\n";
-      print TESTFILE "void foobarbaz (void) {\n";
-      print TESTFILE "  xyzzy (&a.$member, &b.$member, sizeof (a.$member));\n";
-      print TESTFILE "}\n";
-      close (TESTFILE);
-
-      $res = compiletest ($fnamebase, "Testing for member $member",
-			  "NOT AVAILABLE.", $res, 1);
-
-      if ($res == 0 || $missing != 0) {
+			  ($optional
+			   ? "NOT AVAILABLE."
+			   : "Member \"$member\" not available."), $res,
+			  $optional);
+
+      if ($res == 0 || $missing != 0 || !$optional) {
 	# Test the types of the members.
 	open (TESTFILE, ">$fnamebase.c");
 	print TESTFILE "$prepend";
@@ -427,167 +389,120 @@
 		     "Member \"$member\" does not have the correct type.",
 		     $res, 0);
       }
-    } elsif (/^optional-constant *([a-zA-Z0-9_]*) ([>=<!]+) ([A-Za-z0-9_-]*)/) {
-      my($const) = $1;
-      my($op) = $2;
-      my($value) = $3;
+    } elsif (/^(macro|constant|macro-constant|macro-int-constant) +([a-zA-Z0-9_]*) *(?:{([^}]*)} *)?(?:([>=<!]+) ([A-Za-z0-9_-]*))?/) {
+      my($symbol_type) = $1;
+      my($symbol) = $2;
+      my($type) = $3;
+      my($op) = $4;
+      my($value) = $5;
       my($res) = $missing;
-
-      # Remember that this name is allowed.
-      push @allow, $const;
-
-      # Generate a program to test for the availability of this constant.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      print TESTFILE "__typeof__ ($const) a = $const;\n";
-      close (TESTFILE);
-
-      $res = compiletest ($fnamebase, "Testing for constant $const",
-			  "NOT PRESENT", $res, 1);
-
-      if ($value ne "" && $res == 0) {
-	# Generate a program to test for the value of this constant.
+      my($mres) = $missing;
+      my($cres) = $missing;
+
+      # Remember that this name is allowed.
+      push @allow, $symbol;
+
+      if ($symbol_type =~ /macro/) {
+	# Generate a program to test for availability of this macro.
+	open (TESTFILE, ">$fnamebase.c");
+	print TESTFILE "$prepend";
+	print TESTFILE "#include <$h>\n";
+	print TESTFILE "#ifndef $symbol\n";
+	print TESTFILE "# error \"Macro $symbol not defined\"\n";
+	print TESTFILE "#endif\n";
+	close (TESTFILE);
+
+	$mres = compiletest ($fnamebase, "Test availability of macro $symbol",
+			     ($optional
+			      ? "NOT PRESENT"
+			      : "Macro \"$symbol\" is not available."), $res,
+			     $optional);
+      }
+
+      if ($symbol_type =~ /constant/) {
+	# Generate a program to test for the availability of this constant.
+	open (TESTFILE, ">$fnamebase.c");
+	print TESTFILE "$prepend";
+	print TESTFILE "#include <$h>\n";
+	print TESTFILE "__typeof__ ($symbol) a = $symbol;\n";
+	close (TESTFILE);
+
+	$cres = compiletest ($fnamebase, "Testing for constant $symbol",
+			     ($optional
+			      ? "NOT PRESENT"
+			      : "Constant \"$symbol\" not available."), $res,
+			     $optional);
+      }
+
+      $res = $res || $mres || $cres;
+
+      if ($symbol_type eq "macro-int-constant" && ($res == 0 || !$optional)) {
+	# Test that the symbol is usable in #if.
+	open (TESTFILE, ">$fnamebase.c");
+	print TESTFILE "$prepend";
+	print TESTFILE "#include <$h>\n";
+	print TESTFILE "#if $symbol < 0\n";
+	print TESTFILE "# define conformtest_negative 1\n";
+	my($s) = "0";
+	for (my $i = 0; $i < 63; $i++) {
+	  print TESTFILE "# if $symbol & (1LL << $i)\n";
+	  print TESTFILE "#  define conformtest_bit_$i 0LL\n";
+	  print TESTFILE "# else\n";
+	  print TESTFILE "#  define conformtest_bit_$i (1LL << $i)\n";
+	  print TESTFILE "# endif\n";
+	  $s .= "|conformtest_bit_$i";
+	}
+	print TESTFILE "# define conformtest_value ~($s)\n";
+	print TESTFILE "#else\n";
+	print TESTFILE "# define conformtest_negative 0\n";
+	$s = "0";
+	for (my $i = 0; $i < 64; $i++) {
+	  print TESTFILE "# if $symbol & (1ULL << $i)\n";
+	  print TESTFILE "#  define conformtest_bit_$i (1ULL << $i)\n";
+	  print TESTFILE "# else\n";
+	  print TESTFILE "#  define conformtest_bit_$i 0ULL\n";
+	  print TESTFILE "# endif\n";
+	  $s .= "|conformtest_bit_$i";
+	}
+	print TESTFILE "# define conformtest_value ($s)\n";
+	print TESTFILE "#endif\n";
+	print TESTFILE "int main (void) { return !((($symbol < 0) == conformtest_negative) && ($symbol == conformtest_value)); }\n";
+	close (TESTFILE);
+
+	runtest ($fnamebase, "Testing for #if usability of symbol $symbol",
+		 "Symbol \"$symbol\" not usable in #if.", $res);
+      }
+
+      if (defined ($type) && ($res == 0 || !$optional)) {
+	# Test the type of the symbol.
+	open (TESTFILE, ">$fnamebase.c");
+	print TESTFILE "$prepend";
+	print TESTFILE "#include <$h>\n";
+	if ($type =~ /^promoted:/) {
+	  $type =~ s/^promoted://;
+	  print TESTFILE "__typeof__ (($type) 0 + ($type) 0) a;\n";
+	} else {
+	  print TESTFILE "__typeof__ (($type) 0) a;\n";
+	}
+	print TESTFILE "extern __typeof__ ($symbol) a;\n";
+	close (TESTFILE);
+
+	compiletest ($fnamebase, "Testing for type of symbol $symbol",
+		     "Symbol \"$symbol\" does not have the correct type.",
+		     $res, 0);
+      }
+
+      if (defined ($op) && ($res == 0 || !$optional)) {
+	# Generate a program to test for the value of this symbol.
 	open (TESTFILE, ">$fnamebase.c");
 	print TESTFILE "$prepend";
 	print TESTFILE "#include <$h>\n";
 	# Negate the value since 0 means ok
-	print TESTFILE "int main (void) { return !($const $op $value); }\n";
+	print TESTFILE "int main (void) { return !($symbol $op $value); }\n";
 	close (TESTFILE);
 
-	$res = runtest ($fnamebase, "Testing for value of constant $const",
-			"Constant \"$const\" has not the right value.", $res);
-      }
-    } elsif (/^constant *([a-zA-Z0-9_]*) *([>=<!]+) ([A-Za-z0-9_-]*)/) {
-      my($const) = $1;
-      my($op) = $2;
-      my($value) = $3;
-      my($res) = $missing;
-
-      # Remember that this name is allowed.
-      push @allow, $const;
-
-      # Generate a program to test for the availability of this constant.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      print TESTFILE "__typeof__ ($const) a = $const;\n";
-      close (TESTFILE);
-
-      $res = compiletest ($fnamebase, "Testing for constant $const",
-			  "Constant \"$const\" not available.", $res, 0);
-
-      if ($value ne "") {
-	# Generate a program to test for the value of this constant.
-	open (TESTFILE, ">$fnamebase.c");
-	print TESTFILE "$prepend";
-	print TESTFILE "#include <$h>\n";
-	# Negate the value since 0 means ok
-	print TESTFILE "int main (void) { return !($const $op $value); }\n";
-	close (TESTFILE);
-
-	$res = runtest ($fnamebase, "Testing for value of constant $const",
-			"Constant \"$const\" has not the right value.", $res);
-      }
-    } elsif (/^typed-constant *([a-zA-Z0-9_]*) *({([^}]*)}|([^ ]*)) *([A-Za-z0-9_-]*)?/) {
-      my($const) = $1;
-      my($type) = "$3$4";
-      my($value) = $5;
-      my($res) = $missing;
-
-      # Remember that this name is allowed.
-      push @allow, $const;
-
-      # Generate a program to test for the availability of this constant.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      print TESTFILE "__typeof__ ($const) a = $const;\n";
-      close (TESTFILE);
-
-      $res = compiletest ($fnamebase, "Testing for constant $const",
-			  "Constant \"$const\" not available.", $res, 0);
-
-      # Test the types of the members.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      print TESTFILE "__typeof__ (($type) 0) a;\n";
-      print TESTFILE "extern __typeof__ ($const) a;\n";
-      close (TESTFILE);
-
-      compiletest ($fnamebase, "Testing for type of constant $const",
-		   "Constant \"$const\" does not have the correct type.",
-		   $res, 0);
-
-      if ($value ne "") {
-	# Generate a program to test for the value of this constant.
-	open (TESTFILE, ">$fnamebase.c");
-	print TESTFILE "$prepend";
-	print TESTFILE "#include <$h>\n";
-	print TESTFILE "int main (void) { return $const != $value; }\n";
-	close (TESTFILE);
-
-	$res = runtest ($fnamebase, "Testing for value of constant $const",
-			"Constant \"$const\" has not the right value.", $res);
-      }
-    } elsif (/^optional-constant *([a-zA-Z0-9_]*) *([A-Za-z0-9_-]*)?/) {
-      my($const) = $1;
-      my($value) = $2;
-      my($res) = $missing;
-
-      # Remember that this name is allowed.
-      push @allow, $const;
-
-      # Generate a program to test for the availability of this constant.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      print TESTFILE "__typeof__ ($const) a = $const;\n";
-      close (TESTFILE);
-
-      $res = compiletest ($fnamebase, "Testing for constant $const",
-			  "NOT PRESENT", $res, 1);
-
-      if ($value ne "" && $res == 0) {
-	# Generate a program to test for the value of this constant.
-	open (TESTFILE, ">$fnamebase.c");
-	print TESTFILE "$prepend";
-	print TESTFILE "#include <$h>\n";
-	print TESTFILE "int main (void) { return $const != $value; }\n";
-	close (TESTFILE);
-
-	$res = runtest ($fnamebase, "Testing for value of constant $const",
-			"Constant \"$const\" has not the right value.", $res);
-      }
-    } elsif (/^constant *([a-zA-Z0-9_]*) *([A-Za-z0-9_-]*)?/) {
-      my($const) = $1;
-      my($value) = $2;
-      my($res) = $missing;
-
-      # Remember that this name is allowed.
-      push @allow, $const;
-
-      # Generate a program to test for the availability of this constant.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      print TESTFILE "__typeof__ ($const) a = $const;\n";
-      close (TESTFILE);
-
-      $res = compiletest ($fnamebase, "Testing for constant $const",
-			  "Constant \"$const\" not available.", $res, 0);
-
-      if ($value ne "") {
-	# Generate a program to test for the value of this constant.
-	open (TESTFILE, ">$fnamebase.c");
-	print TESTFILE "$prepend";
-	print TESTFILE "#include <$h>\n";
-	print TESTFILE "int main (void) { return $const != $value; }\n";
-	close (TESTFILE);
-
-	$res = runtest ($fnamebase, "Testing for value of constant $const",
-			"Constant \"$const\" has not the right value.", $res);
+	$res = runtest ($fnamebase, "Testing for value of symbol $symbol",
+			"Symbol \"$symbol\" has not the right value.", $res);
       }
     } elsif (/^symbol *([a-zA-Z0-9_]*) *([A-Za-z0-9_-]*)?/) {
       my($symbol) = $1;
@@ -620,7 +535,7 @@
 	$res = runtest ($fnamebase, "Testing for value of symbol $symbol",
 			"Symbol \"$symbol\" has not the right value.", $res);
       }
-    } elsif (/^optional-type *({([^}]*)|([a-zA-Z0-9_]*))/) {
+    } elsif (/^type *({([^}]*)|([a-zA-Z0-9_]*))/) {
       my($type) = "$2$3";
       my($maybe_opaque) = 0;
 
@@ -634,7 +549,7 @@
 	$maybe_opaque = 1;
       }
 
-      # Generate a program to test for the availability of this constant.
+      # Generate a program to test for the availability of this type.
       open (TESTFILE, ">$fnamebase.c");
       print TESTFILE "$prepend";
       print TESTFILE "#include <$h>\n";
@@ -646,10 +561,11 @@
       close (TESTFILE);
 
       compiletest ($fnamebase, "Testing for type $type",
-		   "NOT AVAILABLE", $missing, 1);
-    } elsif (/^type *({([^}]*)|([a-zA-Z0-9_]*))/) {
+		   ($optional
+		    ? "NOT AVAILABLE"
+		    : "Type \"$type\" not available."), $missing, $optional);
+    } elsif (/^tag *({([^}]*)|([a-zA-Z0-9_]*))/) {
       my($type) = "$2$3";
-      my($maybe_opaque) = 0;
 
       # Remember that this name is allowed.
       if ($type =~ /^struct *(.*)/) {
@@ -658,44 +574,18 @@
 	push @allow, $1;
       } else {
 	push @allow, $type;
-	$maybe_opaque = 1;
       }
 
       # Generate a program to test for the availability of this type.
       open (TESTFILE, ">$fnamebase.c");
       print TESTFILE "$prepend";
       print TESTFILE "#include <$h>\n";
-      if ($maybe_opaque == 1) {
-	print TESTFILE "$type *a;\n";
-      } else {
-	print TESTFILE "$type a;\n";
-      }
+      print TESTFILE "$type;\n";
       close (TESTFILE);
 
       compiletest ($fnamebase, "Testing for type $type",
 		   "Type \"$type\" not available.", $missing, 0);
-    } elsif (/^tag *({([^}]*)|([a-zA-Z0-9_]*))/) {
-      my($type) = "$2$3";
-
-      # Remember that this name is allowed.
-      if ($type =~ /^struct *(.*)/) {
-	push @allow, $1;
-      } elsif ($type =~ /^union *(.*)/) {
-	push @allow, $1;
-      } else {
-	push @allow, $type;
-      }
-
-      # Generate a program to test for the availability of this type.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      print TESTFILE "$type;\n";
-      close (TESTFILE);
-
-      compiletest ($fnamebase, "Testing for type $type",
-		   "Type \"$type\" not available.", $missing, 0);
-    } elsif (/^optional-function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) {
+    } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) {
       my($rettype) = "$2$3";
       my($fname) = "$4";
       my($args) = "$5";
@@ -713,9 +603,12 @@
       close (TESTFILE);
 
       $res = compiletest ($fnamebase, "Test availability of function $fname",
-			  "NOT AVAILABLE", $res, 1);
-
-      if ($res == 0 || $missing == 1) {
+			  ($optional
+			   ? "NOT AVAILABLE"
+			   : "Function \"$fname\" is not available."), $res,
+			  $optional);
+
+      if ($res == 0 || $missing == 1 || !$optional) {
 	# Generate a program to test for the type of this function.
 	open (TESTFILE, ">$fnamebase.c");
 	print TESTFILE "$prepend";
@@ -728,7 +621,7 @@
 	compiletest ($fnamebase, "Test for type of function $fname",
 		     "Function \"$fname\" has incorrect type.", $res, 0);
       }
-    } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) {
+    } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
       my($rettype) = "$2$3";
       my($fname) = "$4";
       my($args) = "$5";
@@ -742,44 +635,16 @@
       print TESTFILE "$prepend";
       print TESTFILE "#include <$h>\n";
       # print TESTFILE "#undef $fname\n";
-      print TESTFILE "$rettype (*(*foobarbaz) $args = $fname;\n";
+      print TESTFILE "$rettype (*foobarbaz) $args = $fname;\n";
       close (TESTFILE);
 
       $res = compiletest ($fnamebase, "Test availability of function $fname",
-			  "Function \"$fname\" is not available.", $res, 0);
-
-      # Generate a program to test for the type of this function.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      # print TESTFILE "#undef $fname\n";
-      print TESTFILE "extern $rettype (*(*foobarbaz) $args;\n";
-      print TESTFILE "extern __typeof__ (&$fname) foobarbaz;\n";
-      close (TESTFILE);
-
-      compiletest ($fnamebase, "Test for type of function $fname",
-		   "Function \"$fname\" has incorrect type.", $res, 0);
-    } elsif (/^optional-function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
-      my($rettype) = "$2$3";
-      my($fname) = "$4";
-      my($args) = "$5";
-      my($res) = $missing;
-
-      # Remember that this name is allowed.
-      push @allow, $fname;
-
-      # Generate a program to test for availability of this function.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      # print TESTFILE "#undef $fname\n";
-      print TESTFILE "$rettype (*foobarbaz) $args = $fname;\n";
-      close (TESTFILE);
-
-      $res = compiletest ($fnamebase, "Test availability of function $fname",
-			  "NOT AVAILABLE", $res, 1);
-
-      if ($res == 0 || $missing != 0) {
+			  ($optional
+			   ? "NOT AVAILABLE"
+			   : "Function \"$fname\" is not available."), $res,
+			  $optional);
+
+      if ($res == 0 || $missing != 0 || !$optional) {
 	# Generate a program to test for the type of this function.
 	open (TESTFILE, ">$fnamebase.c");
 	print TESTFILE "$prepend";
@@ -792,37 +657,6 @@
 	compiletest ($fnamebase, "Test for type of function $fname",
 		     "Function \"$fname\" has incorrect type.", $res, 0);
       }
-    } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
-      my($rettype) = "$2$3";
-      my($fname) = "$4";
-      my($args) = "$5";
-      my($res) = $missing;
-
-      # Remember that this name is allowed.
-      push @allow, $fname;
-
-      # Generate a program to test for availability of this function.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      # print TESTFILE "#undef $fname\n";
-      print TESTFILE "$rettype (*foobarbaz) $args = $fname;\n";
-      close (TESTFILE);
-
-      $res = compiletest ($fnamebase, "Test availability of function $fname",
-			  "Function \"$fname\" is not available.", $res, 0);
-
-      # Generate a program to test for the type of this function.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      # print TESTFILE "#undef $fname\n";
-      print TESTFILE "extern $rettype (*foobarbaz) $args;\n";
-      print TESTFILE "extern __typeof__ (&$fname) foobarbaz;\n";
-      close (TESTFILE);
-
-      compiletest ($fnamebase, "Test for type of function $fname",
-		   "Function \"$fname\" has incorrect type.", $res, 0);
     } elsif (/^variable *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) *(.*)/) {
       my($type) = "$2$3";
       my($vname) = "$4";
@@ -919,105 +753,6 @@
 
       $res = runtest ($fnamebase, "Testing for value of macro $macro",
 		      "Macro \"$macro\" has not the right value.", $res);
-    } elsif (/^optional-macro *([^	]*)/) {
-      my($macro) = "$1";
-
-      # Remember that this name is allowed.
-      push @allow, $macro;
-
-      # Generate a program to test for availability of this macro.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      print TESTFILE "#ifndef $macro\n";
-      print TESTFILE "# error \"Macro $macro not defined\"\n";
-      print TESTFILE "#endif\n";
-      close (TESTFILE);
-
-      compiletest ($fnamebase, "Test availability of macro $macro",
-		   "NOT PRESENT", $missing, 1);
-    } elsif (/^macro *([a-zA-Z0-9_]*) *([>=<!]+) ([A-Za-z0-9_]*)/) {
-      my($macro) = "$1";
-      my($op) = $2;
-      my($value) = $3;
-      my($res) = $missing;
-
-      # Remember that this name is allowed.
-      push @allow, $macro;
-
-      # Generate a program to test for availability of this macro.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      print TESTFILE "#ifndef $macro\n";
-      print TESTFILE "# error \"Macro $macro not defined\"\n";
-      print TESTFILE "#endif\n";
-      close (TESTFILE);
-
-      $res = compiletest ($fnamebase, "Test availability of macro $macro",
-			  "Macro \"$macro\" is not available.", $res, 0);
-
-      if ($value ne "") {
-	# Generate a program to test for the value of this constant.
-	open (TESTFILE, ">$fnamebase.c");
-	print TESTFILE "$prepend";
-	print TESTFILE "#include <$h>\n";
-	# Negate the value since 0 means ok
-	print TESTFILE "int main (void) { return !($macro $op $value); }\n";
-	close (TESTFILE);
-
-	$res = runtest ($fnamebase, "Testing for value of macro $macro",
-			"Macro \"$macro\" has not the right value.", $res);
-      }
-    } elsif (/^macro *([a-zA-Z0-9_]*) *([A-Za-z0-9_]*)/) {
-      my($macro) = "$1";
-      my($value) = $2;
-      my($res) = $missing;
-
-      # Remember that this name is allowed.
-      push @allow, $macro;
-
-      # Generate a program to test for availability of this macro.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      print TESTFILE "#ifndef $macro\n";
-      print TESTFILE "# error \"Macro $macro not defined\"\n";
-      print TESTFILE "#endif\n";
-      close (TESTFILE);
-
-      $res = compiletest ($fnamebase, "Test availability of macro $macro",
-			  "Macro \"$macro\" is not available.", $res, 0);
-
-      if ($value ne "") {
-	# Generate a program to test for the value of this constant.
-	open (TESTFILE, ">$fnamebase.c");
-	print TESTFILE "$prepend";
-	print TESTFILE "#include <$h>\n";
-	# Negate the value since 0 means ok
-	print TESTFILE "int main (void) { return !($macro == $value); }\n";
-	close (TESTFILE);
-
-	$res = runtest ($fnamebase, "Testing for value of macro $macro",
-			"Macro \"$macro\" has not the right value.", $res);
-      }
-    } elsif (/^macro *([^	]*)/) {
-      my($macro) = "$1";
-
-      # Remember that this name is allowed.
-      push @allow, $macro;
-
-      # Generate a program to test for availability of this macro.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      print TESTFILE "#ifndef $macro\n";
-      print TESTFILE "# error \"Macro $macro not defined\"\n";
-      print TESTFILE "#endif\n";
-      close (TESTFILE);
-
-      compiletest ($fnamebase, "Test availability of macro $macro",
-		   "Macro \"$macro\" is not available.", $missing, 0);
     } elsif (/^allow-header *(.*)/) {
       my($pattern) = $1;
       if ($seenheader{$pattern} != 1) {
@@ -1050,9 +785,7 @@
 
       if (/^element *({([^}]*)}|([^ ]*)) *({([^}]*)}|([^ ]*)) *([A-Za-z0-9_]*) *(.*)/) {
 	push @allow, $7;
-      } elsif (/^constant *([a-zA-Z0-9_]*) *([A-Za-z0-9_]*)?/) {
-	push @allow, $1;
-      } elsif (/^typed-constant *([a-zA-Z0-9_]*) *({([^}]*)}|([^ ]*)) *([A-Za-z0-9_]*)?/) {
+      } elsif (/^(macro|constant|macro-constant|macro-int-constant) +([a-zA-Z0-9_]*) *(?:{([^}]*)} *)?(?:([>=<!]+) ([A-Za-z0-9_-]*))?/) {
 	push @allow, $1;
       } elsif (/^(type|tag) *({([^}]*)|([a-zA-Z0-9_]*))/) {
 	my($type) = "$3$4";
@@ -1073,7 +806,7 @@
 	push @allow, $4;
       } elsif (/^macro-function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
 	push @allow, $4;
-      } elsif (/^macro *([^	]*)/) {
+      } elsif (/^symbol *([a-zA-Z0-9_]*) *([A-Za-z0-9_-]*)?/) {
 	push @allow, $1;
       } elsif (/^allow-header *(.*)/) {
 	if ($seenheader{$1} != 1) {

Modified: fsf/trunk/libc/conform/data/assert.h-data
==============================================================================
--- fsf/trunk/libc/conform/data/assert.h-data (original)
+++ fsf/trunk/libc/conform/data/assert.h-data Wed May  2 00:01:51 2012
@@ -4,4 +4,6 @@
 macro static_assert
 #endif
 
+#if !defined ISO && !defined ISO99 && !defined ISO11
 allow *_t
+#endif

Modified: fsf/trunk/libc/conform/data/cpio.h-data
==============================================================================
--- fsf/trunk/libc/conform/data/cpio.h-data (original)
+++ fsf/trunk/libc/conform/data/cpio.h-data Wed May  2 00:01:51 2012
@@ -1,24 +1,24 @@
 #if !defined ISO && !defined ISO99 && !defined ISO11
-constant C_IRUSR 0000400
-constant C_IWUSR 0000200
-constant C_IXUSR 0000100
-constant C_IRGRP 0000040
-constant C_IWGRP 0000020
-constant C_IXGRP 0000010
-constant C_IROTH 0000004
-constant C_IWOTH 0000002
-constant C_IXOTH 0000001
-constant C_ISUID 0004000
-constant C_ISGID 0002000
-constant C_ISVTX 0001000
-constant C_ISDIR 0040000
-constant C_ISFIFO 0010000
-constant C_ISREG 0100000
-constant C_ISBLK 0060000
-constant C_ISCHR 0020000
-constant C_ISCTG 0110000
-constant C_ISLNK 0120000
-constant C_ISSOCK 0140000
+constant C_IRUSR == 0000400
+constant C_IWUSR == 0000200
+constant C_IXUSR == 0000100
+constant C_IRGRP == 0000040
+constant C_IWGRP == 0000020
+constant C_IXGRP == 0000010
+constant C_IROTH == 0000004
+constant C_IWOTH == 0000002
+constant C_IXOTH == 0000001
+constant C_ISUID == 0004000
+constant C_ISGID == 0002000
+constant C_ISVTX == 0001000
+constant C_ISDIR == 0040000
+constant C_ISFIFO == 0010000
+constant C_ISREG == 0100000
+constant C_ISBLK == 0060000
+constant C_ISCHR == 0020000
+constant C_ISCTG == 0110000
+constant C_ISLNK == 0120000
+constant C_ISSOCK == 0140000
 
 macro-str MAGIC "070707"
 

Modified: fsf/trunk/libc/conform/data/ctype.h-data
==============================================================================
--- fsf/trunk/libc/conform/data/ctype.h-data (original)
+++ fsf/trunk/libc/conform/data/ctype.h-data Wed May  2 00:01:51 2012
@@ -11,6 +11,10 @@
 function int isxdigit (int)
 function int tolower (int)
 function int toupper (int)
+
+#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
+function int isblank (int)
+#endif
 
 #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008
 function int isascii (int)
@@ -39,9 +43,9 @@
 function int toupper_l (int, locale_t)
 # endif
 
-// The following is not entirely correct.  It should be is[a-z]* but the
-// replacement fnmatch implementation does not grok it.
-allow is*
-allow to*
+allow is[abcdefghijklmnopqrstuvwxyz]*
+allow to[abcdefghijklmnopqrstuvwxyz]*
 
+#if !defined ISO && !defined ISO99 && !defined ISO11
 allow *_t
+#endif

Modified: fsf/trunk/libc/conform/data/errno.h-data
==============================================================================
--- fsf/trunk/libc/conform/data/errno.h-data (original)
+++ fsf/trunk/libc/conform/data/errno.h-data Wed May  2 00:01:51 2012
@@ -1,90 +1,92 @@
-constant EDOM
-constant EILSEQ
-constant ERANGE
+macro-int-constant EDOM {int} > 0
+#if !defined ISO && !defined POSIX
+macro-int-constant EILSEQ {int} > 0
+#endif
+macro-int-constant ERANGE {int} > 0
 
 // variable int errno
 allow errno
 
 #if !defined ISO && !defined ISO99 && !defined ISO11
-constant E2BIG
-constant EACCES
-constant EADDRINUSE
-constant EADDRNOTAVAIL
-constant EAFNOSUPPORT
-constant EAGAIN
-constant EALREADY
-constant EBADF
-constant EBADMSG
-constant EBUSY
-constant ECANCELED
-constant ECHILD
-constant ECONNABORTED
-constant ECONNREFUSED
-constant ECONNRESET
-constant EDEADLK
-constant EDESTADDRREQ
-constant EDQUOT
-constant EEXIST
-constant EFAULT
-constant EFBIG
-constant EHOSTUNREACH
-constant EIDRM
-constant EINPROGRESS
-constant EINTR
-constant EINVAL
-constant EIO
-constant EISCONN
-constant EISDIR
-constant ELOOP
-constant EMFILE
-constant EMLINK
-constant EMSGSIZE
-constant EMULTIHOP
-constant ENAMETOOLONG
-constant ENETDOWN
-constant ENETUNREACH
-constant ENFILE
-constant ENOBUFS
-constant ENODATA
-constant ENODEV
-constant ENOENT
-constant ENOEXEC
-constant ENOLCK
-constant ENOLINK
-constant ENOMEM
-constant ENOMSG
-constant ENOPROTOOPT
-constant ENOSPC
-constant ENOSR
-constant ENOSTR
-constant ENOSYS
-constant ENOTCONN
-constant ENOTDIR
-constant ENOTEMPTY
-constant ENOTSOCK
-constant ENOTSUP
-constant ENOTTY
-constant ENXIO
-constant EOPNOTSUPP
-constant EOVERFLOW
-constant EPERM
-constant EPIPE
-constant EPROTO
-constant EPROTONOSUPPORT
-constant EPROTOTYPE
-constant EROFS
-constant ESPIPE
-constant ESRCH
-constant ESTALE
-constant ETIME
-constant ETIMEDOUT
-constant ETXTBSY
-constant EWOULDBLOCK
-constant EXDEV
+macro-int-constant E2BIG {int} > 0
+macro-int-constant EACCES {int} > 0
+macro-int-constant EADDRINUSE {int} > 0
+macro-int-constant EADDRNOTAVAIL {int} > 0
+macro-int-constant EAFNOSUPPORT {int} > 0
+macro-int-constant EAGAIN {int} > 0
+macro-int-constant EALREADY {int} > 0
+macro-int-constant EBADF {int} > 0
+macro-int-constant EBADMSG {int} > 0
+macro-int-constant EBUSY {int} > 0
+macro-int-constant ECANCELED {int} > 0
+macro-int-constant ECHILD {int} > 0
+macro-int-constant ECONNABORTED {int} > 0
+macro-int-constant ECONNREFUSED {int} > 0
+macro-int-constant ECONNRESET {int} > 0
+macro-int-constant EDEADLK {int} > 0
+macro-int-constant EDESTADDRREQ {int} > 0
+macro-int-constant EDQUOT {int} > 0
+macro-int-constant EEXIST {int} > 0
+macro-int-constant EFAULT {int} > 0
+macro-int-constant EFBIG {int} > 0
+macro-int-constant EHOSTUNREACH {int} > 0
+macro-int-constant EIDRM {int} > 0
+macro-int-constant EINPROGRESS {int} > 0
+macro-int-constant EINTR {int} > 0
+macro-int-constant EINVAL {int} > 0
+macro-int-constant EIO {int} > 0
+macro-int-constant EISCONN {int} > 0
+macro-int-constant EISDIR {int} > 0
+macro-int-constant ELOOP {int} > 0
+macro-int-constant EMFILE {int} > 0
+macro-int-constant EMLINK {int} > 0
+macro-int-constant EMSGSIZE {int} > 0
+macro-int-constant EMULTIHOP {int} > 0
+macro-int-constant ENAMETOOLONG {int} > 0
+macro-int-constant ENETDOWN {int} > 0
+macro-int-constant ENETUNREACH {int} > 0
+macro-int-constant ENFILE {int} > 0
+macro-int-constant ENOBUFS {int} > 0
+macro-int-constant ENODATA {int} > 0
+macro-int-constant ENODEV {int} > 0
+macro-int-constant ENOENT {int} > 0
+macro-int-constant ENOEXEC {int} > 0
+macro-int-constant ENOLCK {int} > 0
+macro-int-constant ENOLINK {int} > 0
+macro-int-constant ENOMEM {int} > 0
+macro-int-constant ENOMSG {int} > 0
+macro-int-constant ENOPROTOOPT {int} > 0
+macro-int-constant ENOSPC {int} > 0
+macro-int-constant ENOSR {int} > 0
+macro-int-constant ENOSTR {int} > 0
+macro-int-constant ENOSYS {int} > 0
+macro-int-constant ENOTCONN {int} > 0
+macro-int-constant ENOTDIR {int} > 0
+macro-int-constant ENOTEMPTY {int} > 0
+macro-int-constant ENOTSOCK {int} > 0
+macro-int-constant ENOTSUP {int} > 0
+macro-int-constant ENOTTY {int} > 0
+macro-int-constant ENXIO {int} > 0
+macro-int-constant EOPNOTSUPP {int} > 0
+macro-int-constant EOVERFLOW {int} > 0
+macro-int-constant EPERM {int} > 0
+macro-int-constant EPIPE {int} > 0
+macro-int-constant EPROTO {int} > 0
+macro-int-constant EPROTONOSUPPORT {int} > 0
+macro-int-constant EPROTOTYPE {int} > 0
+macro-int-constant EROFS {int} > 0
+macro-int-constant ESPIPE {int} > 0
+macro-int-constant ESRCH {int} > 0
+macro-int-constant ESTALE {int} > 0
+macro-int-constant ETIME {int} > 0
+macro-int-constant ETIMEDOUT {int} > 0
+macro-int-constant ETXTBSY {int} > 0
+macro-int-constant EWOULDBLOCK {int} > 0
+macro-int-constant EXDEV {int} > 0
 
 # if defined XOPEN2K8 || defined POSIX2008
-constant ENOTRECOVERABLE
-constant EOWNERDEAD
+macro-int-constant ENOTRECOVERABLE {int} > 0
+macro-int-constant EOWNERDEAD {int} > 0
 # endif
 
 allow E*

Modified: fsf/trunk/libc/conform/data/float.h-data
==============================================================================
--- fsf/trunk/libc/conform/data/float.h-data (original)
+++ fsf/trunk/libc/conform/data/float.h-data Wed May  2 00:01:51 2012
@@ -1,60 +1,62 @@
-macro FLT_RADIX
+macro-int-constant FLT_RADIX >= 2
 
-constant FLT_ROUNDS
+macro FLT_ROUNDS
 
-macro FLT_MANT_DIG
-macro DBL_MANT_DIG
-macro LDBL_MANT_DIG
+macro-int-constant FLT_MANT_DIG
+macro-int-constant DBL_MANT_DIG
+macro-int-constant LDBL_MANT_DIG
 
-constant FLT_DIG >= 6
-constant DBL_DIG >= 10
-constant LDBL_DIG >= 10
+macro-int-constant FLT_DIG >= 6
+macro-int-constant DBL_DIG >= 10
+macro-int-constant LDBL_DIG >= 10
 
-macro FLT_MIN_EXP
-macro DBL_MIN_EXP
-macro LDBL_MIN_EXP
+macro-int-constant FLT_MIN_EXP < 0
+macro-int-constant DBL_MIN_EXP < 0
+macro-int-constant LDBL_MIN_EXP < 0
 
-constant FLT_MIN_10_EXP <= -37
-constant DBL_MIN_10_EXP <= -37
-constant LDBL_MIN_10_EXP <= -37
+macro-int-constant FLT_MIN_10_EXP <= -37
+macro-int-constant DBL_MIN_10_EXP <= -37
+macro-int-constant LDBL_MIN_10_EXP <= -37
 
-macro FLT_MAX_EXP
-macro DBL_MAX_EXP
-macro LDBL_MAX_EXP
+macro-int-constant FLT_MAX_EXP
+macro-int-constant DBL_MAX_EXP
+macro-int-constant LDBL_MAX_EXP
 
-constant FLT_MAX_10_EXP >= 37
-constant DBL_MAX_10_EXP >= 37
-constant LDBL_MAX_10_EXP >= 37
+macro-int-constant FLT_MAX_10_EXP >= 37
+macro-int-constant DBL_MAX_10_EXP >= 37
+macro-int-constant LDBL_MAX_10_EXP >= 37
 
-constant FLT_MAX >= 1.0E37
-constant DBL_MAX >= 1.0E37
-constant LDBL_MAX >= 1.0E37
+macro-constant FLT_MAX >= 1.0E37
+macro-constant DBL_MAX >= 1.0E37
+macro-constant LDBL_MAX >= 1.0E37
 
-macro FLT_EPSILON
-macro DBL_EPSILON
-macro LDBL_EPSILON
+macro-constant FLT_EPSILON <= 1.0E-5
+macro-constant DBL_EPSILON <= 1.0E-9
+macro-constant LDBL_EPSILON <= 1.0E-9
 
-macro FLT_MIN
-macro DBL_MIN
-macro LDBL_MIN
+macro-constant FLT_MIN <= 1.0E-37
+macro-constant DBL_MIN <= 1.0E-37
+macro-constant LDBL_MIN <= 1.0E-37
 
 #if !defined ISO && !defined XPG3 && !defined XPG4 && !defined POSIX && !defined UNIX98
-constant DECIMAL_DIG >= 10
-constant FLT_EVAL_METHOD
+macro-int-constant DECIMAL_DIG >= 10
+macro-int-constant FLT_EVAL_METHOD
 #endif
 
 #if defined ISO11
-constant DBL_HAS_SUBNORM
-constant FLT_HAS_SUBNORM
-constant LDBL_HAS_SUBNORM
+macro-int-constant DBL_HAS_SUBNORM
+macro-int-constant FLT_HAS_SUBNORM
+macro-int-constant LDBL_HAS_SUBNORM
 
-constant DBL_DECIMAL_DIG >= 10
-constant FLT_DECIMAL_DIG >= 6
-constant LDBL_DECIMAL_DIG >= 10
+macro-int-constant DBL_DECIMAL_DIG >= 10
+macro-int-constant FLT_DECIMAL_DIG >= 6
+macro-int-constant LDBL_DECIMAL_DIG >= 10
 
-constant DBL_TRUE_MIN <= 1E-37
-constant FLT_TRUE_MIN <= 1E-37
-constant LDBL_TRUE_MIN <= 1E-37
+macro-constant DBL_TRUE_MIN <= 1E-37
+macro-constant FLT_TRUE_MIN <= 1E-37
+macro-constant LDBL_TRUE_MIN <= 1E-37
 #endif
 
+#if !defined ISO && !defined ISO99 && !defined ISO11
 allow *_t
+#endif

Modified: fsf/trunk/libc/conform/data/fmtmsg.h-data
==============================================================================
--- fsf/trunk/libc/conform/data/fmtmsg.h-data (original)
+++ fsf/trunk/libc/conform/data/fmtmsg.h-data Wed May  2 00:01:51 2012
@@ -44,12 +44,12 @@
 macro MM_CONSOLE
 constant MM_CONSOLE
 
-constant MM_NULLLBL 0
-constant MM_NULLSEV 0
-constant MM_NULLMC 0
-constant MM_NULLTXT 0
-constant MM_NULLACT 0
-constant MM_NULLTAG 0
+constant MM_NULLLBL == 0
+constant MM_NULLSEV == 0
+constant MM_NULLMC == 0
+constant MM_NULLTXT == 0
+constant MM_NULLACT == 0
+constant MM_NULLTAG == 0
 
 macro MM_OK
 macro MM_NOTOK

Modified: fsf/trunk/libc/conform/data/iso646.h-data
==============================================================================
--- fsf/trunk/libc/conform/data/iso646.h-data (original)
+++ fsf/trunk/libc/conform/data/iso646.h-data Wed May  2 00:01:51 2012
@@ -1,3 +1,4 @@
+#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4
 macro and
 macro and_eq
 macro bitand
@@ -11,3 +12,4 @@
 macro xor_eq
 
 allow *_t
+#endif

Modified: fsf/trunk/libc/conform/data/limits.h-data
==============================================================================
--- fsf/trunk/libc/conform/data/limits.h-data (original)
+++ fsf/trunk/libc/conform/data/limits.h-data Wed May  2 00:01:51 2012
@@ -1,28 +1,29 @@
-constant CHAR_BIT >= 8
-constant SCHAR_MIN <= -127
-constant SCHAR_MAX >= 127
-constant UCHAR_MAX >= 255
+macro-int-constant CHAR_BIT >= 8
+macro-int-constant SCHAR_MIN {promoted:signed char} <= -127
+macro-int-constant SCHAR_MAX {promoted:signed char} >= 127
+macro-int-constant UCHAR_MAX {promoted:unsigned char} >= 255
 #ifdef __CHAR_UNSIGNED__
-constant CHAR_MIN 0
-constant CHAR_MAX UCHAR_MAX
+macro-int-constant CHAR_MIN {promoted:char} == 0
+macro-int-constant CHAR_MAX {promoted:char} == UCHAR_MAX
 #else
-constant CHAR_MIN SCHAR_MIN
-constant CHAR_MAX SCHAR_MAX
+macro-int-constant CHAR_MIN {promoted:char} == SCHAR_MIN
+macro-int-constant CHAR_MAX {promoted:char} == SCHAR_MAX
 #endif
-constant MB_LEN_MAX >= 1
-constant SHRT_MIN <= -32767
-constant SHRT_MAX >= 32767
-constant USHRT_MAX >= 65535
-constant INT_MAX >= 2147483647
-constant INT_MIN <= 2147483647
-constant UINT_MAX >= 4294967295
-constant LONG_MAX >= 2147483647
-constant LONG_MIN <= 2147483647
-constant ULONG_MAX >= 4294967295
+macro-int-constant MB_LEN_MAX >= 1
+macro-int-constant SHRT_MIN {promoted:short int} <= -32767
+macro-int-constant SHRT_MAX {promoted:short int} >= 32767
+macro-int-constant USHRT_MAX {promoted:unsigned short int} >= 65535
+// The ranges for int and unsigned int are from POSIX.
+macro-int-constant INT_MAX {int} >= 2147483647
+macro-int-constant INT_MIN {int} <= -2147483647
+macro-int-constant UINT_MAX {unsigned int} >= 4294967295U
+macro-int-constant LONG_MAX {long int} >= 2147483647L
+macro-int-constant LONG_MIN {long int} <= -2147483647L
+macro-int-constant ULONG_MAX {unsigned long int} >= 4294967295UL
 #if defined ISO99 || defined ISO11 || defined XOPEN2K8 || defined POSIX2008
-constant LLONG_MIN <= -9223372036854775807ll
-constant LLONG_MAX >= 9223372036854775807ll
-constant ULLONG_MAX >= 18446744073709551615ull
+macro-int-constant LLONG_MIN {long long int} <= -9223372036854775807ll
+macro-int-constant LLONG_MAX {long long int} >= 9223372036854775807ll
+macro-int-constant ULLONG_MAX {unsigned long long int} >= 18446744073709551615ull
 #endif
 
 #if !defined ISO && !defined ISO99 && !defined ISO11
@@ -84,60 +85,60 @@
 
 constant _POSIX_CLOCKRES_MIN <= 20000000
 
-optional-constant _POSIX_AIO_LISTIO_MAX	2
-optional-constant _POSIX_AIO_MAX 1
-optional-constant _POSIX_ARG_MAX 4096
+optional-constant _POSIX_AIO_LISTIO_MAX == 2
+optional-constant _POSIX_AIO_MAX == 1
+optional-constant _POSIX_ARG_MAX == 4096
 #if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
-optional-constant _POSIX_CHILD_MAX 25
+optional-constant _POSIX_CHILD_MAX == 25
 #else
-optional-constant _POSIX_CHILD_MAX 6
+optional-constant _POSIX_CHILD_MAX == 6
 #endif
-optional-constant _POSIX_DELAYTIMER_MAX 32
-optional-constant _POSIX_LINK_MAX 8
-optional-constant _POSIX_LOGIN_NAME_MAX 9
-optional-constant _POSIX_MAX_CANON 255
-optional-constant _POSIX_MAX_INPUT 255
-optional-constant _POSIX_MQ_OPEN_MAX 8
-optional-constant _POSIX_MQ_PRIO_MAX 32
-optional-constant _POSIX_NAME_MAX 14
+optional-constant _POSIX_DELAYTIMER_MAX == 32
+optional-constant _POSIX_LINK_MAX == 8
+optional-constant _POSIX_LOGIN_NAME_MAX == 9
+optional-constant _POSIX_MAX_CANON == 255
+optional-constant _POSIX_MAX_INPUT == 255
+optional-constant _POSIX_MQ_OPEN_MAX == 8
+optional-constant _POSIX_MQ_PRIO_MAX == 32
+optional-constant _POSIX_NAME_MAX == 14
 #if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
-optional-constant _POSIX_NGROUPS_MAX 8
+optional-constant _POSIX_NGROUPS_MAX == 8
 #else
-optional-constant _POSIX_NGROUPS_MAX 0
+optional-constant _POSIX_NGROUPS_MAX == 0
 #endif
 #if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
-optional-constant _POSIX_OPEN_MAX 20
+optional-constant _POSIX_OPEN_MAX == 20
 #else
-optional-constant _POSIX_OPEN_MAX 16
+optional-constant _POSIX_OPEN_MAX == 16
 #endif
-optional-constant _POSIX_PATH_MAX 256
-optional-constant _POSIX_PIPE_BUF 512
-optional-constant _POSIX2_RE_DUP_MAX 255
-optional-constant _POSIX_RTSIG_MAX 8
-optional-constant _POSIX_SEM_NSEMS_MAX 256
-optional-constant _POSIX_SEM_VALUE_MAX 32767
-optional-constant _POSIX_SIGQUEUE_MAX 32
-optional-constant _POSIX_SSIZE_MAX 32767
-optional-constant _POSIX_STREAM_MAX 8
-optional-constant _POSIX_SS_REPL_MAX 4
-optional-constant _POSIX_SYMLINK_MAX 255
-optional-constant _POSIX_SYMLOOP_MAX 8
-optional-constant _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
-optional-constant _POSIX_THREAD_KEYS_MAX 128
-optional-constant _POSIX_THREAD_THREADS_MAX 64
-optional-constant _POSIX_TIMER_MAX 32
-optional-constant _POSIX_TTY_NAME_MAX 9
-optional-constant _POSIX_TZNAME_MAX 6
-optional-constant _POSIX2_BC_BASE_MAX 99
-optional-constant _POSIX2_BC_DIM_MAX 2048
-optional-constant _POSIX2_BC_SCALE_MAX 99
-optional-constant _POSIX2_BC_STRING_MAX 1000
-optional-constant _POSIX2_CHARCLASS_NAME_MAX 14
-optional-constant _POSIX2_COLL_WEIGHTS_MAX 2
-optional-constant _POSIX2_EXPR_NEST_MAX 32
-optional-constant _POSIX2_LINE_MAX 2048
-optional-constant _POSIX2_RE_DUP_MAX 255
-optional-constant _XOPEN_IOV_MAX 16
+optional-constant _POSIX_PATH_MAX == 256
+optional-constant _POSIX_PIPE_BUF == 512
+optional-constant _POSIX2_RE_DUP_MAX == 255
+optional-constant _POSIX_RTSIG_MAX == 8
+optional-constant _POSIX_SEM_NSEMS_MAX == 256
+optional-constant _POSIX_SEM_VALUE_MAX == 32767
+optional-constant _POSIX_SIGQUEUE_MAX == 32
+optional-constant _POSIX_SSIZE_MAX == 32767
+optional-constant _POSIX_STREAM_MAX == 8
+optional-constant _POSIX_SS_REPL_MAX == 4
+optional-constant _POSIX_SYMLINK_MAX == 255
+optional-constant _POSIX_SYMLOOP_MAX == 8
+optional-constant _POSIX_THREAD_DESTRUCTOR_ITERATIONS == 4
+optional-constant _POSIX_THREAD_KEYS_MAX == 128
+optional-constant _POSIX_THREAD_THREADS_MAX == 64
+optional-constant _POSIX_TIMER_MAX == 32
+optional-constant _POSIX_TTY_NAME_MAX == 9
+optional-constant _POSIX_TZNAME_MAX == 6
+optional-constant _POSIX2_BC_BASE_MAX == 99
+optional-constant _POSIX2_BC_DIM_MAX == 2048
+optional-constant _POSIX2_BC_SCALE_MAX == 99
+optional-constant _POSIX2_BC_STRING_MAX == 1000
+optional-constant _POSIX2_CHARCLASS_NAME_MAX == 14
+optional-constant _POSIX2_COLL_WEIGHTS_MAX == 2
+optional-constant _POSIX2_EXPR_NEST_MAX == 32
+optional-constant _POSIX2_LINE_MAX == 2048
+optional-constant _POSIX2_RE_DUP_MAX == 255
+optional-constant _XOPEN_IOV_MAX == 16
 
 #if !defined POSIX && !defined POSIX2008
 constant WORD_BIT >= 16

Modified: fsf/trunk/libc/conform/data/math.h-data
==============================================================================
--- fsf/trunk/libc/conform/data/math.h-data (original)
+++ fsf/trunk/libc/conform/data/math.h-data Wed May  2 00:01:51 2012
@@ -1,6 +1,7 @@
 constant HUGE_VAL
 
 #if !defined ISO && !defined POSIX
+# if !defined XPG3 && !defined XPG4 && !defined UNIX98
 macro fpclassify
 macro isfinite
 macro isinf
@@ -13,6 +14,10 @@
 macro islessequal
 macro islessgreater
 macro isunordered
+# endif
+# if defined XPG3 || defined XPG4 || defined UNIX98
+function double isnan (double)
+# endif
 
 # if !defined ISO99 && !defined ISO11 && !defined POSIX2008
 constant M_E
@@ -31,6 +36,7 @@
 
 constant MAXFLOAT
 # endif
+# if !defined XPG3 && !defined XPG4 && !defined UNIX98
 constant HUGE_VALF
 constant HUGE_VALL
 constant INFINITY
@@ -49,7 +55,6 @@
 constant FP_ILOGB0
 constant FP_ILOGBNAN
 
-# if !defined XPG3 && !defined XPG4 && !defined UNIX98
 macro MATH_ERRNO == 1
 macro MATH_ERREXCEPT == 2
 
@@ -62,13 +67,13 @@
 function double atan (double)
 function double atan2 (double, double)
 function double ceil (double)
-#if !defined ISO && !defined POSIX
+#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
 function double copysign (double, double)
 #endif
 function double cos (double)
 function double cosh (double)
 function double exp (double)
-#if !defined ISO && !defined POSIX
+#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
 function double exp2 (double)
 #endif
 function double fabs (double)
@@ -78,7 +83,7 @@
 function double ldexp (double, int)
 function double log (double)
 function double log10 (double)
-#if !defined ISO && !defined POSIX
+#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
 function double log2 (double)
 #endif
 function double modf (double, double*)
@@ -103,12 +108,15 @@
 function double jn (int, double)
 # endif
 function double lgamma (double)
+# if !defined XPG3 && !defined XPG4 && !defined UNIX98
 function double tgamma (double)
+# endif
 # if !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008
 function double y0 (double)
 function double y1 (double)
 function double yn (int, double)
 # endif
+# if !defined XPG3
 function double acosh (double)
 function double asinh (double)
 function double atanh (double)
@@ -118,10 +126,13 @@
 function double log1p (double)
 function double logb (double)
 function double nextafter (double, double)
+#  if !defined XPG4 && !defined UNIX98
 function double nexttoward (double, long double)
 function double nearbyint (double)
+#  endif
 function double remainder (double, double)
 function double rint (double)
+#  if !defined XPG4 && !defined UNIX98
 function double round (double)
 function double trunc (double)
 function long lrint (double)
@@ -129,9 +140,11 @@
 function long lround (double)
 function {long long} llround (double)
 function double remquo (double, double, int*)
-# if defined XPG3 && defined XPG4 && defined UNIX98 && defined XOPEN2K
+#  endif
+#  if defined XPG4 || defined UNIX98 || defined XOPEN2K
 function double scalb (double, double)
-# endif
+#  endif
+#  if !defined XPG4 && !defined UNIX98
 function double scalbn (double, int)
 function double scalbln (double, long)
 function double fdim (double, double)
@@ -139,6 +152,8 @@
 function double fmin (double, double)
 function double fma (double, double, double)
 function double nan (const char*)
+#  endif
+# endif
 
 # if !defined POSIX && !defined POSIX2008
 // variable signgam
@@ -146,7 +161,7 @@
 # endif
 #endif
 
-#if !defined ISO && !defined POSIX
+#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
 function float acosf (float)
 function float asinf (float)
 function float atanf (float)
@@ -174,9 +189,6 @@
 function float tanhf (float)
 function float erff (float)
 function float erfcf (float)
-#if defined XPG3 || defined XPG4 || defined UNIX98
-function float gammaf (float)
-#endif
 function float hypotf (float, float)
 #if !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008
 function float j0f (float)
@@ -210,9 +222,6 @@
 function long lroundf (float)
 function {long long} llroundf (float)
 function float remquof (float, float, int*)
-#if defined XPG3 && defined XPG4 && defined UNIX98 && defined XOPEN2K
-function float scalbf (float, float)
-#endif
 function float scalbnf (float, int)
 function float scalblnf (float, long)
 function float fdimf (float, float)
@@ -248,9 +257,6 @@
 function {long double} tanhl (long double)
 function {long double} erfl (long double)
 function {long double} erfcl (long double)
-#if defined XPG3 || defined XPG4 || defined UNIX98
-function {long double} gammal (long double)
-#endif
 function {long double} hypotl (long double, long double)
 #if !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008
 function {long double} j0l (long double)
@@ -284,9 +290,6 @@
 function long lroundl (long double)
 function {long long} llroundl (long double)
 function {long double} remquol (long double, long double, int*)
-#if defined XPG3 && defined XPG4 && defined UNIX98 && defined XOPEN2K
-function {long double} scalbl (long double, long double)
-#endif
 function {long double} scalbnl (long double, int)
 function {long double} scalblnl (long double, long)
 function {long double} fdiml (long double, long double)

Modified: fsf/trunk/libc/conform/data/netinet/in.h-data
==============================================================================
--- fsf/trunk/libc/conform/data/netinet/in.h-data (original)
+++ fsf/trunk/libc/conform/data/netinet/in.h-data Wed May  2 00:01:51 2012
@@ -51,7 +51,7 @@
 macro INADDR_ANY
 macro INADDR_BROADCAST
 
-constant INET_ADDRSTRLEN 16
+constant INET_ADDRSTRLEN == 16
 
 function uint32_t htonl (uint32_t)
 function uint16_t htons (uint16_t)
@@ -61,7 +61,7 @@
 allow-header inttypes.h
 allow-header sys/socket.h
 
-constant INET6_ADDRSTRLEN 46
+constant INET6_ADDRSTRLEN == 46
 
 macro IPV6_JOIN_GROUP
 macro IPV6_LEAVE_GROUP

Modified: fsf/trunk/libc/conform/data/signal.h-data
==============================================================================
--- fsf/trunk/libc/conform/data/signal.h-data (original)
+++ fsf/trunk/libc/conform/data/signal.h-data Wed May  2 00:01:51 2012
@@ -1,9 +1,9 @@
-typed-constant SIG_DFL {void(*)(int)}
-typed-constant SIG_ERR {void(*)(int)}
+constant SIG_DFL {void(*)(int)}
+constant SIG_ERR {void(*)(int)}
 #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008
-typed-constant SIG_HOLD {void(*)(int)}
-#endif
-typed-constant SIG_IGN {void(*)(int)}
+constant SIG_HOLD {void(*)(int)}
+#endif
+constant SIG_IGN {void(*)(int)}
 
 type sig_atomic_t
 #if !defined ISO && !defined ISO99 && !defined ISO11

Modified: fsf/trunk/libc/conform/data/stddef.h-data
==============================================================================
--- fsf/trunk/libc/conform/data/stddef.h-data (original)
+++ fsf/trunk/libc/conform/data/stddef.h-data Wed May  2 00:01:51 2012
@@ -1,4 +1,4 @@
-constant NULL
+macro-constant NULL == 0
 
 macro offsetof
 
@@ -6,4 +6,10 @@
 type wchar_t
 type size_t
 
+#if defined ISO11
+type max_align_t
+#endif
+
+#if !defined ISO && !defined ISO99 && !defined ISO11
 allow *_t
+#endif

Modified: fsf/trunk/libc/conform/data/stdint.h-data
==============================================================================
--- fsf/trunk/libc/conform/data/stdint.h-data (original)
+++ fsf/trunk/libc/conform/data/stdint.h-data Wed May  2 00:01:51 2012
@@ -1,3 +1,4 @@
+#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
 type int8_t
 type int16_t
 type int32_t
@@ -112,3 +113,4 @@
 // fnamtch implementation doesn't grok the right form.
 allow INT*
 allow UINT*
+#endif

Modified: fsf/trunk/libc/conform/data/stdlib.h-data
==============================================================================
--- fsf/trunk/libc/conform/data/stdlib.h-data (original)
+++ fsf/trunk/libc/conform/data/stdlib.h-data Wed May  2 00:01:51 2012
@@ -6,7 +6,7 @@
 element ldiv_t long rem
 
 macro EXIT_FAILURE
-macro EXIT_SUCCESS 0
+macro EXIT_SUCCESS == 0
 
 macro NULL
 constant RAND_MAX >= 32767

Modified: fsf/trunk/libc/conform/data/tar.h-data
==============================================================================
--- fsf/trunk/libc/conform/data/tar.h-data (original)
+++ fsf/trunk/libc/conform/data/tar.h-data Wed May  2 00:01:51 2012
@@ -1,8 +1,8 @@
 #if !defined ISO && !defined ISO99 && !defined ISO11
 macro-str TMAGIC "ustar"
-constant TMAGLEN 6
+constant TMAGLEN == 6
 macro-str TVERSION "00"
-constant TVERSLEN 2
+constant TVERSLEN == 2
 
 constant REGTYPE
 constant AREGTYPE
@@ -14,20 +14,20 @@
 constant FIFOTYPE
 constant CONTTYPE
 
-constant TSUID 04000
-constant TSGID 02000
+constant TSUID == 04000
+constant TSGID == 02000
 # if !defined POSIX && !defined POSIX2008
-constant TSVTX 01000
+constant TSVTX == 01000
 # endif
-constant TUREAD 00400
-constant TUWRITE 00200
-constant TUEXEC 00100
-constant TGREAD 00040
-constant TGWRITE 00020
-constant TGEXEC 00010
-constant TOREAD 00004
-constant TOWRITE 00002
-constant TOEXEC 00001
+constant TUREAD == 00400
+constant TUWRITE == 00200
+constant TUEXEC == 00100
+constant TGREAD == 00040
+constant TGWRITE == 00020
+constant TGEXEC == 00010
+constant TOREAD == 00004
+constant TOWRITE == 00002
+constant TOEXEC == 00001
 
 allow *_t
 #endif

Modified: fsf/trunk/libc/elf/Makefile
==============================================================================
--- fsf/trunk/libc/elf/Makefile (original)
+++ fsf/trunk/libc/elf/Makefile Wed May  2 00:01:51 2012
@@ -872,44 +872,63 @@
 
 $(objpfx)tst-pie1: $(objpfx)tst-piemod1.so
 
-check-textrel-CFLAGS = -O -Wall -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
-$(objpfx)check-textrel: check-textrel.c
-	$(native-compile)
-
-check-execstack-CFLAGS = -O -Wall -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -std=gnu99 \
-			 $(objpfx:%/=-I%)
-$(objpfx)check-execstack: check-execstack.c $(objpfx)check-execstack.h
-	$(native-compile)
-$(objpfx)check-execstack.h: $(first-word $(wildcard $(sysdirs:%=%/stackinfo.h)))
-	$(make-target-directory)
-	{ echo '#include <stackinfo.h>'; echo '@@@DEFAULT_STACK_PERMS@@@'; } | \
-	$(CC) $(CFLAGS) $(CPPFLAGS) -E -x c-header - | \
-	sed -n -e 's/^@@@\(.*\)@@@/#define DEFAULT_STACK_PERMS \1/p' > $@T
-	mv -f $@T $@
-generated += check-execstack.h
-
-check-localplt-CFLAGS = -O -Wall -D_GNU_SOURCE -std=gnu99
-$(objpfx)check-localplt: check-localplt.c
-	$(native-compile)
-
 ifeq (yes,$(build-shared))
 tests: $(objpfx)check-textrel.out $(objpfx)check-execstack.out
 
-all-built-dso = $(common-objpfx)libc.so \
-		$(filter-out $(common-objpfx)linkobj/libc.so, \
-			     $(sort $(wildcard $(common-objpfx)*/lib*.so \
-					       $(common-objpfx)iconvdata/*.so)))
-
-$(objpfx)check-textrel.out: $(objpfx)check-textrel $(all-built-dso)
-	$(dir $<)$(notdir $<) $(filter-out $<, $^) > $@
-generated += check-textrel check-textrel.out
-
-$(objpfx)check-execstack.out: $(objpfx)check-execstack $(all-built-dso)
-	$(dir $<)$(notdir $<) $(filter-out $<, $^) > $@
-generated += check-execstack check-execstack.out
+all-built-dso := $(common-objpfx)libc.so \
+		 $(filter-out $(common-objpfx)linkobj/libc.so, \
+			      $(sort $(wildcard $(addprefix $(common-objpfx), \
+							    */lib*.so \
+							    iconvdata/*.so))))
+
+$(all-built-dso:=.dyn): %.dyn: %
+	@rm -f $@T
+	LC_ALL=C $(READELF) -W -d $< > $@T
+	test -s $@T
+	mv -f $@T $@
+generated += $(all-built-dso:=.dyn)
+
+$(objpfx)check-textrel.out: $(..)scripts/check-textrel.awk \
+			    $(all-built-dso:=.dyn)
+	LC_ALL=C $(AWK) -f $^ > $@
+generated += check-textrel.out
+
+$(objpfx)execstack-default: $(first-word $(wildcard $(sysdirs:%=%/stackinfo.h)))
+	$(make-target-directory)
+	{ echo '#include <elf.h>'; \
+	  echo '#include <stackinfo.h>'; \
+	  echo '#if (DEFAULT_STACK_PERMS & PF_X) == 0'; \
+	  echo '@@@execstack-no@@@'; \
+	  echo '#else'; \
+	  echo '@@@execstack-yes@@@'; \
+	  echo '#endif'; } | \
+	$(CC) $(CFLAGS) $(CPPFLAGS) -E -x c-header - | \
+	sed -n -e 's/^@@@\(.*\)@@@/\1/p' > $@T
+	mv -f $@T $@
+generated += execstack-default
+
+$(all-built-dso:=.phdr): %.phdr: %
+	@rm -f $@T
+	LC_ALL=C $(READELF) -W -l $< > $@T
+	test -s $@T
+	mv -f $@T $@
+generated += $(all-built-dso:=.phdr)
+
+$(objpfx)check-execstack.out: $(..)scripts/check-execstack.awk \
+			      $(objpfx)execstack-default \
+			      $(all-built-dso:=.phdr)
+	LC_ALL=C $(AWK) -f $^ > $@
+generated += check-execstack.out
 
 $(objpfx)tst-dlmodcount: $(libdl)
 $(objpfx)tst-dlmodcount.out: $(test-modules)
+
+$(all-built-dso:=.jmprel): %.jmprel: % Makefile
+	@rm -f $@T
+	LC_ALL=C $(READELF) -W -S -d -r $< > $@T
+	test -s $@T
+	mv -f $@T $@
+generated += $(all-built-dso:=.jmprel)
 
 check-data := $(firstword $(wildcard \
 		$(foreach D,$(add-ons) scripts,\
@@ -922,20 +941,25 @@
 
 tests: $(objpfx)check-localplt.out
 
+localplt-built-dso := $(addprefix $(common-objpfx),\
+				  libc.so \
+				  math/libm.so \
+				  rt/librt.so \
+				  dlfcn/libdl.so \
+				  resolv/libresolv.so \
+				  crypt/libcrypt.so \
+		       )
 ifeq ($(have-thread-library),yes)
-thread-dso := $(filter-out %_nonshared.a, $(shared-thread-library))
-endif
-
-$(objpfx)check-localplt.out: $(objpfx)check-localplt \
-			     $(common-objpfx)libc.so \
-			     $(common-objpfx)math/libm.so $(thread-dso) \
-			     $(common-objpfx)rt/librt.so \
-			     $(common-objpfx)dlfcn/libdl.so \
-			     $(common-objpfx)resolv/libresolv.so \
-			     $(common-objpfx)crypt/libcrypt.so \
+localplt-built-dso += $(filter-out %_nonshared.a, $(shared-thread-library))
+endif
+
+$(objpfx)check-localplt.out: $(..)scripts/check-localplt.awk \
+			     $(..)scripts/localplt.awk \
+			     $(localplt-built-dso:=.jmprel) \
 			     $(check-data)
-	$(dir $<)$(notdir $<) $(filter-out $< $(check-data),$^) | \
-	  $(AWK) -f $(..)scripts/check-localplt.awk $(check-data) -
+	LC_ALL=C $(AWK) -f $(filter-out $< $(check-data),$^) | \
+	  LC_ALL=C $(AWK) -f $< $(check-data) - \
+	  > $@
 endif
 
 $(objpfx)tst-dlopenrpathmod.so: $(libdl)

Removed: fsf/trunk/libc/elf/check-execstack.c
==============================================================================
--- fsf/trunk/libc/elf/check-execstack.c (original)
+++ fsf/trunk/libc/elf/check-execstack.c (removed)
@@ -1,162 +1,0 @@
-/* Check for executable stacks in DSOs.
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contribute by Ulrich Drepper <drepper@xxxxxxxxxx>. 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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <byteswap.h>
-#include <elf.h>
-#include <endian.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include "check-execstack.h"
-
-
-#ifdef BITS
-
-# define AB(name) _AB (name, BITS)
-# define _AB(name, bits) __AB (name, bits)
-# define __AB(name, bits) name##bits
-# define E(name) _E (name, BITS)
-# define _E(name, bits) __E (name, bits)
-# define __E(name, bits) Elf##bits##_##name
-# define SWAP(val) \
-  ({ __typeof (val) __res;						      \
-     if (((ehdr.e_ident[EI_DATA] == ELFDATA2MSB				      \
-	   && BYTE_ORDER == LITTLE_ENDIAN)				      \
-	  || (ehdr.e_ident[EI_DATA] == ELFDATA2LSB			      \
-	      && BYTE_ORDER == BIG_ENDIAN))				      \
-	 && sizeof (val) != 1)						      \
-       {								      \
-	 if (sizeof (val) == 2)						      \
-	   __res = bswap_16 (val);					      \
-	 else if (sizeof (val) == 4)					      \
-	   __res = bswap_32 (val);					      \
-	 else								      \
-	   __res = bswap_64 (val);					      \
-       }								      \
-     else								      \
-       __res = (val);							      \
-     __res; })
-
-
-static int
-AB(handle_file) (const char *fname, int fd)
-{
-  E(Ehdr) ehdr;
-
-  if (pread (fd, &ehdr, sizeof (ehdr), 0) != sizeof (ehdr))
-    {
-    read_error:
-      printf ("%s: read error: %m\n", fname);
-      return 1;
-    }
-
-  const size_t phnum = SWAP (ehdr.e_phnum);
-  const size_t phentsize = SWAP (ehdr.e_phentsize);
-
-  /* Read the program header.  */
-  E(Phdr) *phdr = alloca (phentsize * phnum);
-  if (pread (fd, phdr, phentsize * phnum, SWAP (ehdr.e_phoff))
-      != phentsize * phnum)
-    goto read_error;
-
-  /* Search for the PT_GNU_STACK entry.  */
-  for (size_t cnt = 0; cnt < phnum; ++cnt)
-    if (SWAP (phdr[cnt].p_type) == PT_GNU_STACK)
-      {
-	unsigned int flags = SWAP(phdr[cnt].p_flags);
-	if (flags & PF_X)
-	  {
-	    printf ("%s: executable stack signaled\n", fname);
-	    return 1;
-	  }
-
-	return 0;
-      }
-
-  if (DEFAULT_STACK_PERMS & PF_X)
-    {
-      printf ("%s: no PT_GNU_STACK entry\n", fname);
-      return 1;
-    }
-
-  return 0;
-}
-
-# undef BITS
-#else
-
-# define BITS 32
-# include "check-execstack.c"
-
-# define BITS 64
-# include "check-execstack.c"
-
-
-static int
-handle_file (const char *fname)
-{
-  int fd = open (fname, O_RDONLY);
-  if (fd == -1)
-    {
-      printf ("cannot open %s: %m\n", fname);
-      return 1;
-    }
-
-  /* Read was is supposed to be the ELF header.  Read the initial
-     bytes to determine whether this is a 32 or 64 bit file.  */
-  char ident[EI_NIDENT];
-  if (read (fd, ident, EI_NIDENT) != EI_NIDENT)
-    {
-      printf ("%s: read error: %m\n", fname);
-      close (fd);
-      return 1;
-    }
-
-  if (memcmp (&ident[EI_MAG0], ELFMAG, SELFMAG) != 0)
-    {
-      printf ("%s: not an ELF file\n", fname);
-      close (fd);
-      return 1;
-    }
-
-  int result;
-  if (ident[EI_CLASS] == ELFCLASS64)
-    result = handle_file64 (fname, fd);
-  else
-    result = handle_file32 (fname, fd);
-
-  close (fd);
-
-  return result;
-}
-
-
-int
-main (int argc, char *argv[])
-{
-  int cnt;
-  int result = 0;
-
-  for (cnt = 1; cnt < argc; ++cnt)
-    result |= handle_file (argv[cnt]);
-  return result;
-}
-#endif

Removed: fsf/trunk/libc/elf/check-localplt.c
==============================================================================
--- fsf/trunk/libc/elf/check-localplt.c (original)
+++ fsf/trunk/libc/elf/check-localplt.c (removed)
@@ -1,298 +1,0 @@
-/* Show local PLT use in DSOs.
-   Copyright (C) 2006 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contribute by Ulrich Drepper <drepper@xxxxxxxxxx>. 2006.
-
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <byteswap.h>
-#include <elf.h>
-#include <endian.h>
-#include <fcntl.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-
-#ifdef BITS
-
-# define AB(name) _AB (name, BITS)
-# define _AB(name, bits) __AB (name, bits)
-# define __AB(name, bits) name##bits
-# define E(name) _E (name, BITS)
-# define _E(name, bits) __E (name, bits)
-# define __E(name, bits) Elf##bits##_##name
-# define EE(name) _EE (name, BITS)
-# define _EE(name, bits) __EE (name, bits)
-# define __EE(name, bits) ELF##bits##_##name
-# define SWAP(val) \
-  ({ __typeof (val) __res;						      \
-     if (((ehdr.e_ident[EI_DATA] == ELFDATA2MSB				      \
-	   && BYTE_ORDER == LITTLE_ENDIAN)				      \
-	  || (ehdr.e_ident[EI_DATA] == ELFDATA2LSB			      \
-	      && BYTE_ORDER == BIG_ENDIAN))				      \
-	 && sizeof (val) != 1)						      \
-       {								      \
-	 if (sizeof (val) == 2)						      \
-	   __res = bswap_16 (val);					      \
-	 else if (sizeof (val) == 4)					      \
-	   __res = bswap_32 (val);					      \
-	 else								      \
-	   __res = bswap_64 (val);					      \
-       }								      \
-     else								      \
-       __res = (val);							      \
-     __res; })
-
-
-static int
-AB(handle_file) (const char *fname, int fd)
-{
-  E(Ehdr) ehdr;
-
-  if (pread (fd, &ehdr, sizeof (ehdr), 0) != sizeof (ehdr))
-    {
-    read_error:
-      printf ("%s: read error: %m\n", fname);
-      return 1;
-    }
-
-  const size_t phnum = SWAP (ehdr.e_phnum);
-  const size_t phentsize = SWAP (ehdr.e_phentsize);
-
-  /* Read the program header.  */
-  E(Phdr) *phdr = alloca (phentsize * phnum);
-  if (pread (fd, phdr, phentsize * phnum, SWAP (ehdr.e_phoff))
-      != phentsize * phnum)
-    goto read_error;
-
-  /* Search for the PT_DYNAMIC entry.  */
-  size_t cnt;
-  E(Phdr) *dynphdr = NULL;
-  for (cnt = 0; cnt < phnum; ++cnt)
-    if (SWAP (phdr[cnt].p_type) == PT_DYNAMIC)
-      {
-	dynphdr = &phdr[cnt];
-	break;
-      }
-
-  if (dynphdr == NULL)
-    {
-      printf ("%s: no DYNAMIC segment found\n", fname);
-      return 1;
-    }
-
-  /* Read the dynamic segment.  */
-  size_t pmemsz = SWAP(dynphdr->p_memsz);
-  E(Dyn) *dyn = alloca (pmemsz);
-  if (pread64 (fd, dyn, pmemsz, SWAP(dynphdr->p_offset)) != pmemsz)
-    goto read_error;
-
-  /* Search for an DT_PLTREL, DT_JMPREL, DT_PLTRELSZ, DT_STRTAB,
-     DT_STRSZ, and DT_SYMTAB entries.  */
-  size_t pltrel_idx = SIZE_MAX;
-  size_t jmprel_idx = SIZE_MAX;
-  size_t pltrelsz_idx = SIZE_MAX;
-  size_t strtab_idx = SIZE_MAX;
-  size_t strsz_idx = SIZE_MAX;
-  size_t symtab_idx = SIZE_MAX;
-  for (cnt = 0; (cnt + 1) * sizeof (E(Dyn)) - 1 < pmemsz; ++cnt)
-    {
-      unsigned int tag = SWAP (dyn[cnt].d_tag);
-
-      if (tag == DT_NULL)
-	/* We reached the end.  */
-	break;
-
-      if (tag == DT_PLTREL)
-	pltrel_idx = cnt;
-      else if (tag == DT_JMPREL)
-	jmprel_idx = cnt;
-      else if (tag == DT_PLTRELSZ)
-	pltrelsz_idx = cnt;
-      else if (tag == DT_STRTAB)
-	strtab_idx = cnt;
-      else if (tag == DT_STRSZ)
-	strsz_idx = cnt;
-      else if (tag == DT_SYMTAB)
-	symtab_idx = cnt;
-    }
-
-  if (pltrel_idx == SIZE_MAX || jmprel_idx == SIZE_MAX
-      || pltrelsz_idx == SIZE_MAX || strtab_idx == SIZE_MAX
-      || strsz_idx == SIZE_MAX || symtab_idx == SIZE_MAX)
-    {
-      puts ("not all PLT information found");
-      return 1;
-    }
-
-  E(Xword) relsz = SWAP (dyn[pltrelsz_idx].d_un.d_val);
-
-  void *relmem = NULL;
-  char *strtab = NULL;
-  E(Xword) symtab_offset = 0;
-
-  /* Find the offset of DT_JMPREL and load the data.  */
-  for (cnt = 0; cnt < phnum; ++cnt)
-    if (SWAP (phdr[cnt].p_type) == PT_LOAD)
-      {
-	E(Addr) vaddr = SWAP (phdr[cnt].p_vaddr);
-	E(Xword) memsz = SWAP (phdr[cnt].p_memsz);
-
-	if (vaddr <= SWAP (dyn[jmprel_idx].d_un.d_val)
-	    && vaddr + memsz >= SWAP (dyn[jmprel_idx].d_un.d_val) + relsz)
-	  {
-	    relmem = alloca (SWAP (dyn[pltrelsz_idx].d_un.d_val));
-	    if (pread64 (fd, relmem, relsz,
-			 SWAP (phdr[cnt].p_offset)
-			 + SWAP (dyn[jmprel_idx].d_un.d_val) - vaddr)
-		!= relsz)
-	      {
-		puts ("cannot read JMPREL");
-		return 1;
-	      }
-	  }
-
-	if (vaddr <= SWAP (dyn[symtab_idx].d_un.d_val)
-	    && vaddr + memsz > SWAP (dyn[symtab_idx].d_un.d_val))
-	  symtab_offset = (SWAP (phdr[cnt].p_offset)
-			   + SWAP (dyn[symtab_idx].d_un.d_val) - vaddr);
-
-	if (vaddr <= SWAP (dyn[strtab_idx].d_un.d_val)
-	    && vaddr + memsz >= (SWAP (dyn[strtab_idx].d_un.d_val)
-				 + SWAP(dyn[strsz_idx].d_un.d_val)))
-	  {
-	    strtab = alloca (SWAP(dyn[strsz_idx].d_un.d_val));
-	    if (pread64 (fd, strtab, SWAP(dyn[strsz_idx].d_un.d_val),
-			 SWAP (phdr[cnt].p_offset)
-			 + SWAP (dyn[strtab_idx].d_un.d_val) - vaddr)
-		!= SWAP(dyn[strsz_idx].d_un.d_val))
-	      {
-		puts ("cannot read STRTAB");
-		return 1;
-	      }
-	  }
-      }
-
-  if (relmem == NULL || strtab == NULL || symtab_offset == 0)
-    {
-      puts ("couldn't load PLT data");
-      return 1;
-    }
-
-  if (SWAP (dyn[pltrel_idx].d_un.d_val) == DT_RELA)
-    for (E(Rela) *rela = relmem; (char *) rela - (char *) relmem < relsz;
-	 ++rela)
-      {
-	E(Sym) sym;
-
-	if (pread64 (fd, &sym, sizeof (sym),
-		     symtab_offset
-		     + EE(R_SYM) (SWAP (rela->r_info)) * sizeof (sym))
-	    != sizeof (sym))
-	  {
-	    puts ("cannot read symbol");
-	    return 1;
-	  }
-
-	if (sym.st_value != 0)
-	  /* This symbol is locally defined.  */
-	  printf ("%s: %s\n", basename (fname), strtab + SWAP (sym.st_name));
-      }
-  else
-    for (E(Rel) *rel = relmem; (char *) rel - (char *) relmem < relsz; ++rel)
-      {
-	E(Sym) sym;
-
-	if (pread64 (fd, &sym, sizeof (sym),
-		     symtab_offset
-		     + EE(R_SYM) (SWAP (rel->r_info)) * sizeof (sym))
-	    != sizeof (sym))
-	  {
-	    puts ("cannot read symbol");
-	    return 1;
-	  }
-
-	if (sym.st_value != 0)
-	  /* This symbol is locally defined.  */
-	  printf ("%s: %s\n", basename (fname), strtab + SWAP (sym.st_name));
-      }
-
-  return 0;
-}
-
-# undef BITS
-#else
-
-# define BITS 32
-# include "check-localplt.c"
-
-# define BITS 64
-# include "check-localplt.c"
-
-
-static int
-handle_file (const char *fname)
-{
-  int fd = open (fname, O_RDONLY);
-  if (fd == -1)
-    {
-      printf ("cannot open %s: %m\n", fname);
-      return 1;
-    }
-
-  /* Read was is supposed to be the ELF header.  Read the initial
-     bytes to determine whether this is a 32 or 64 bit file.  */
-  char ident[EI_NIDENT];
-  if (read (fd, ident, EI_NIDENT) != EI_NIDENT)
-    {
-      printf ("%s: read error: %m\n", fname);
-      close (fd);
-      return 1;
-    }
-

[... 1825 lines stripped ...]
_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits