NEWS: Mention x86-64 ld.so use of Intel MPX instructions.
Fix powerpc-nofpu __fe_enabled_env and __fe_nonieee_env (bug 17261).

On powerpc, floating-point environment macros are defined as pointers
to constants in the library that contain the bit-patterns of the
desired environment, instead of being magic constants cast to pointer
type.

For soft-float, the bit-patterns used for fenv_t are not laid out the
same as for hard-float.  (e500 has a third layout used; that's not an
ABI issue because these values are only meaningful within a single
process, all of whose glibc libraries must come from the same build of
glibc.)  While the __fe_dfl_env value for soft-float was appropriate
for the soft-float fenv_t representation, the other two constants had
the same bit-patterns as for hard-float.  Those bit patterns had the
effect of having exceptions already raised, causing
math/test-fenv-return to fail; this patch fixes the patterns used.
(__fe_nonieee_env also had exceptions unmasked, though they should be
masked to match hard-float semantics.  Since there is no separate
non-IEEE mode for soft-float, it's most appropriate for
__fe_nonieee_env to be the same as __fe_dfl_env; this patch makes it
an alias.)

Tested for powerpc-nofpu.

	[BZ #17261]
	* sysdeps/powerpc/nofpu/fenv_const.c (__fe_enabled_env): Change
	value to 0.
	(__fe_nonieee_env): Define as an alias for __fe_dfl_env.
detect broken linker handling of __ehdr_start

Older versions of ld on ia64 support __ehdr_start, but generate relocs
when they shouldn't.  This causes the ld.so to not run because it tries
to resolve the __ehdr_start symbol (but it's not exported).
Replace cpuid asm statement with __cpuid_count

The compiler doesn't know that the cpuid asm statement in intel_check_word
will trash RBX.  We are lucky that it doesn't cause any problems since
RBX is also used by compiler for other purposes so that RBX is saved and
restored.  This patch replaces it with __cpuid_count.

	[BZ #17259]
	* sysdeps/x86_64/cacheinfo.c (intel_check_word): Replace cpuid
	asm statement with __cpuid_count.
Disable x87 inline functions for x86_64 and SSE [BZ #17262]

Since:

commit 409e00bd69b8d8dd74d7327085351d26769ea6fc
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jan 29 07:51:41 2014 -0800

    Disable x87 inline functions for SSE2 math

    When i386 and x86-64 mathinline.h was merged into a single mathinline.h,
    "gcc -m32" enables x87 inline functions on x86-64 even when -mfpmath=sse
    and SSE2 is enabled.  It is a regression on x86-64.  We should check
    __SSE2_MATH__ instead of __x86_64__ when disabling x87 inline functions.

gcc-3.2 is unable to correctly compile x86_64 routines for llrint
since it gets redefined.  This is because gcc 3.2 does not set
__SSE2_MATH__ for x86_64, thus exposing the duplicate definition.

The correct fix ought to be to check for both __SSE2_MATH__ and
__x86_64__ and enable those bits only when neither are defined.

Tested fix with the reproducer for
409e00bd69b8d8dd74d7327085351d26769ea6fc as well as with gcc-3.2.
Fix comment error that Jakub pointed out but I forgot to fix
Fix powerpc32 __get_clockfreq for non-power4 (bug 17263).

In my powerpc32 testing I've observed misc/test-gettimebasefreq
failing.

This is a glibc build (soft-float, though that's not relevant here)
without any --with-cpu and without any special configuration of the
default CPU for GCC either.  In particular, it's one not using
sysdeps/powerpc/powerpc32/power4/hp-timing.h (although in fact the
processor I'm using for testing is POWER4-based), so hp_timing_t is
32-bit not 64-bit.  But the VDSO call being used by
INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK is generating a 64-bit result
(high part in r3, low part in r4).  The code extracting that result,
however, expects a result of the type hp_timing_t as passed to
INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK, meaning that only r3 (= 0) is
used and the value in r4 is ignored.  This patch fixes this by always
using uint64_t as the type in INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK -
reflecting the actual ABI (unconditional in the kernel) of that VDSO
call.  This is the minimal change for this issue - no check for
overflow, no change of the type of the timebase_freq variable or the
return type of __get_clockfreq to something other than hp_timing_t
(such a change would simply move the implicit conversions to the over
callers of that function), no change to hp_timing_t itself.

Tested for powerpc32 soft float.

	[BZ #17263]
	* sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c: Include
	<stdint.h>.
	(__get_clockfreq): Use uint64_t instead of hp_timing_t in
	INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK call.
Mention fixes for BZs 16194 and 16275 in NEWS
Remove unnecessary uses of NOT_IN_libc

If a IS_IN_* macro is defined, then NOT_IN_libc is always defined,
except obviously for IS_IN_libc.  There's no need to check for both.
Verified on x86_64 and i686 that the source is unchanged.

       * include/libc-symbols.h: Remove unnecessary check for
       NOT_IN_libc.
       * nptl/pthreadP.h: Likewise.
       * sysdeps/aarch64/setjmp.S: Likewise.
       * sysdeps/alpha/setjmp.S: Likewise.
       * sysdeps/arm/sysdep.h: Likewise.
       * sysdeps/i386/setjmp.S: Likewise.
       * sysdeps/m68k/setjmp.c: Likewise.
       * sysdeps/posix/getcwd.c: Likewise.
       * sysdeps/powerpc/powerpc32/setjmp-common.S: Likewise.
       * sysdeps/powerpc/powerpc64/setjmp-common.S: Likewise.
       * sysdeps/s390/s390-32/setjmp.S: Likewise.
       * sysdeps/s390/s390-64/setjmp.S: Likewise.
       * sysdeps/sh/sh3/setjmp.S: Likewise.
       * sysdeps/sh/sh4/setjmp.S: Likewise.
       * sysdeps/unix/alpha/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/ia64/setjmp.S: Likewise.
       * sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
       * sysdeps/x86_64/setjmp.S: Likewise.
Remove redundant CPPFLAGS for some programs

These programs get the NOT_IN_libc twice, once through the 'other'
target and another explicitly.  Remove the explicitly added CPFLAG.

	* catgets/Makefile (CPPFLAGS-gencat): Remove.
	* iconv/Makefile (CPPFLAGS-iconv_prog): Likewise.
	(CPPFLAGS-iconvconfig): Likewise.
	* timezone/Makefile (CPPFLAGS-zic): Likewise.
Remove NOT_IN_libc definition for pthread_atfork

pthread_atfork is already built in an extra-libs context, which gives
it NOT_IN_libc in its CPPFLAGS.  Adding the same definition to CFLAGS
is pointless.

Verified that the code is unchanged on x86_64.
Add new macro IN_MODULE to identify module in which source is built

The current scheme to identify which module a translation unit is
built in depends on defining multiple macros IS_IN_* and also defining
NOT_IN_libc if we're building a non-libc module.  In addition, there
is an IN_LIB macro that does effectively the same thing, but for
different modules (notably the systemtap probes).  This macro scheme
unifies both ideas to use just one macro IN_MODULE and assign it a
value depending on the module it is being built into.  If the module
is not defined, it defaults to MODULE_libc.

Patches that follow will remove uses of IS_IN_* variables with the
IS_IN() macro.  libc-symbols.h has been converted already to give an
example of how such a transition will look.

Verified that there are no relevant source changes.  One source change
that will crop up repeatedly is that of nscd_stat, since it uses the
build timestamp as a constant in its logic.

	* Makeconfig (in-module): Get value of libof set for the
	translation unit.
	(module-def): Set IN_MODULE based on value of libof-*.
	(CPPFLAGS): Add $(module-def) to CPPFLAGS.
	* Makerules: Don't suffix routine names for nonlib.
	* include/libc-modules.h: New file.
	* include/libc-symbols.h: Include libc-modules.h
	(IS_IN): New macro to replace IS_IN_* macros.
	* crypt/Makefile: Set libof-* for each routine.
	* debug/Makefile: Likewise.
	* dlfcn/Makefile: Likewise.
	* elf/Makefile: Likewise.
	* elf/rtld-Rules: Likewise.
	* extra-modules.mk: Likewise.
	* hesiod/Makefile: Likewise.
	* iconv/Makefile: Likewise.
	* iconvdata/Makefile: Likewise.
	* libidn/Makefile: Likewise.
	* locale/Makefile: Likewise.
	* login/Makefile: Likewise.
	* mach/Machrules: Likewise.
	* malloc/Makefile: Likewise.
	* math/Makefile: Likewise.
	* nis/Makefile: Likewise.
	* nptl/Makefile: Likewise.
	* nptl_db/Makefile: Likewise.
	* nss/Makefile: Likewise.
	* resolv/Makefile: Likewise.
	* rt/Makefile: Likewise.
	* stdlib/Makefile: Likewise.
	* sunrpc/Makefile: Likewise.
	* sysdeps/gnu/Makefile: Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile: Likewise.
	* sysdeps/unix/sysv/linux/Makefile: Likewise.
	* sysdeps/s390/s390-64/Makefile: Likewise.
	* nscd/Makefile: Set libof-* for each routine.  Set CFLAGS and
	CPPFLAGS for nscd instead of nonlib.
Fix -Wundef warning in SHLIB_COMPAT

Replace the IS_IN_##lib with IS_IN(lib).  Verified that the generated
code remains the same.

	* include/shlib-compat.h (_SHLIB_COMPAT): Use IS_IN.
Auto-generate libc-modules.h

Remove libc-modules.h from the tree and auto-generate it from
soversions.i and a new file build.list.  Macros generated from
soversions.i have lower values starting from 1, while those from
build.list start from a special value MODULE_OTHER_BEGIN, which has a
high enough value (1000).  This allows us to conveniently
differentiate between the versioned libraries and other built modules,
which is needed in errno.h and netdb.h to decide whether to use an
internal symbol or an external one.

Verified that generated code remains unchanged on x86_64.

	* Makeconfig (MIN-CPPFLAGS): CPPFLAGS without libc-symbols.h
	and IN_MODULE definitions.
	(%.v.i): Use it.
	(before-compile): Add libc-modules.h.
	($(common-objpfx)libc-modules.h,
	$(common-objpfx)libc-modules.stmp): New targets.
	(common-generated): Add libc-modules.h and libc-modules.stmp.
	* build.list: New file.
	* include/libc-modules.h: Remove file.
	* scripts/gen-libc-modules.awk: New script to generate
	libc-modules.h.
	* sysdeps/unix/Makefile ($(common-objpfx)sysd-syscalls):
	Depend on libc-modules.stmp.
Use MODULE_NAME in stap-probe instead of IN_LIB

Verified that the generated code is unchanged on x86_64.

	* scripts/gen-libc-modules.awk (END): Generate defines for
	MODULE_NAME.
	* include/stap-probe.h (LIBC_PROBE_1): Use MODULE_NAME instead
	of IN_LIB.
	(STAP_PROBE_ASM): Likewise.
Remove IN_LIB

Replace with IS_IN and IS_IN_LIB macros instead.  This change results
in a change in generated code, because it fixes a subtle bug.  The bug
was introduced when systemtap probes were added to lowlevellock.h,
which resulted in stap-probe.h being included in a number of places.
stap-probe.h always defines IN_LIB, which breaks a check in errno.h
and netdb.h since they rely on that macro to decide whether to
implement an internal version of a declaration or an external one.

The components that see a code change due to this are:

iconv_prog
libmemusage.so
libpcprofile.so
libSegFault.so
libutil.so.1
locale
localedef
nscd

All other built components (i.e. libc, libpthread, etc.) remain
unchanged by this on x86_64.

	* elf/Makefile (CPPFLAGS-.os): Remove IN_LIB.
	* elf/rtld-Rules (rtld-CPPFLAGS): Likewise.
	* extra-lib.mk (CPPFLAGS-$(lib)): Likewise.
	* include/libc-symbols.h (IS_IN_LIB): New macro.
	* include/errno.h: Use IS_IN_LIB instead of IN_LIB.
	* include/netdb.h: Likewise.
	* include/stap-probe.h: Remove all uses of IN_LIB.
Define IN_MODULE for translation units that define NOT_IN_libc

Make sure that all instances where NOT_IN_libc is defined also defines
IN_MODULE to facilitate removal NOT_IN_libc in future passes.

Verified that the generated code is unchanged on x86_64.

	* elf/Makefile (libof-sotruss-lib): Set as extramodules.
	(libof-interp): Likewise.
Remove IS_IN_libc

Replace it with IS_IN_MODULE (libc) and remove the one place that it
is defined in.  The generated code remains unchanged on x86_64.

	* include/shlib-compat.h [!NOT_IN_libc]: Remove.
	* nss/nss_files/files-parse.c (IS_IN_libc): Replace with
	IS_IN (libc).
Remove IS_IN_ldconfig

Replace with IS_IN().  No change in generated code.

	* elf/Makefile (CFLAGS-ldconfig.c): Remove definition of
	IS_IN_ldconfig.
	* sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c: Use IS_IN.
	* sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h: Likewise.
Remove IS_IN_nscd

Replace with IS_IN_MODULE (nscd).  Generated code unchanged on x86_64.

	* include/ifaddrs.h: Use IS_IN.
	* inet/check_pf.c: Likewise.
	* sysdeps/unix/sysv/linux/check_pf.c: Likewise.
	* nscd/Makefile (CPPFLAGS-nscd): Remove IS_IN_nscd.