Commit Graph

4063 Commits

Author SHA1 Message Date
Joseph Myers
5d7b57cad5 Update ARM HWCAP data.
This patch updates the ARM HWCAP data (both bits/hwcap.h and
dl-procinfo.[ch]) to match Linux 3.13.

	* sysdeps/unix/sysv/linux/arm/bits/hwcap.h (HWCAP_ARM_VFPD32): New
	macro.
	(HWCAP_ARM_LPAE): Likewise.
	(HWCAP_ARM_EVTSTRM): Likewise.
	* sysdeps/unix/sysv/linux/arm/dl-procinfo.c (_dl_arm_cap_flags):
	Add vpfd32, lpae and evtstrm.
	* sysdeps/unix/sysv/linux/arm/dl-procinfo.h (_DL_HWCAP_COUNT):
	Increase to 22.
2014-02-20 03:29:34 +00:00
David Holsgrove
ef114eafbf [MicroBlaze]: Move MicroBlaze from ports to sysdeps.
2014-02-17  David Holsgrove <david.holsgrove@xilinx.com>

        * sysdeps/microblaze: Move directory from ports/sysdeps/microblaze.
        * sysdeps/unix/sysv/linux/microblaze: Move directory from
          ports/sysdeps/unix/sysv/linux/microblaze.
        * README: Add missing listing for microblaze*-*-linux-gnu.

Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
2014-02-17 11:08:21 +10:00
Mike Frysinger
c70a4b1db0 ia64: relocate out of ports/ subdir 2014-02-16 01:12:38 -05:00
Joseph Myers
498afc54df Combine __USE_BSD and __USE_SVID into __USE_MISC.
This patch cleans up following the obsoletion of _BSD_SOURCE and
_SVID_SOURCE by combining __USE_BSD and __USE_SVID into __USE_MISC.

The only non-mechanical part of this patch is the changes to
features.h; everything else is simple substitution of __USE_MISC for
the old macros.  Thus, this patch leaves obviously redundant
conditionals such as "defined __USE_MISC || defined __USE_MISC", and
does not update #endif comments where they referred to BSD or SVID in
words instead of the literal macro name.  This is intended to
facilitate patch review by separating the less mechanical changes from
these purely mechanical changes into a separate patch.  (I do intend
to integrate all the changes from
<https://sourceware.org/ml/libc-alpha/2013-12/msg00226.html>, which I
believe includes all the trailing comment updates, in subsequent
patches.)

Tested x86_64.

	* include/features.h (__USE_BSD): Remove macro definitions.
	(__USE_SVID): Likewise.
	(_BSD_SOURCE): Likewise.
	(_SVID_SOURCE): Likewise.
	[!defined _BSD_SOURCE && !defined _SVID_SOURCE]: Remove condition
	from definition of _DEFAULT_SOURCE.
	[_BSD_SOURCE || _SVID_SOURCE]: Change condition to
	[_DEFAULT_SOURCE].
	* bits/fcntl.h [__USE_BSD]: Change condition to [__USE_MISC].
	* bits/mman.h [__USE_BSD]: Likewise.
	* bits/termios.h [__USE_BSD]: Likewise.
	* bits/waitstatus.h [__USE_BSD]: Likewise.
	* ctype/ctype.h [__USE_SVID]: Likewise.
	* dirent/dirent.h [__USE_BSD]: Likewise.
	* grp/grp.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* inet/netinet/igmp.h [__USE_BSD]: Likewise.
	* io/fcntl.h [__USE_BSD]: Likewise.
	* io/ftw.h [__USE_BSD]: Likewise.
	* io/sys/stat.h [__USE_BSD]: Likewise.
	* libio/bits/stdio-ldbl.h [__USE_BSD]: Likewise.
	* libio/bits/stdio2.h [__USE_BSD]: Likewise.
	* libio/stdio.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* math/math.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* misc/bits/syslog-ldbl.h [__USE_BSD]: Likewise.
	* misc/bits/syslog.h [__USE_BSD]: Likewise.
	* misc/search.h [__USE_SVID]: Likewise.
	* misc/sys/mman.h [__USE_BSD]: Likewise.
	* misc/sys/syslog.h [__USE_BSD]: Likewise.
	* misc/sys/uio.h [__USE_BSD]: Likewise.
	* posix/bits/unistd.h [__USE_BSD]: Likewise.
	* posix/glob.h [__USE_BSD]: Likewise.
	* posix/regex.h [__USE_BSD]: Likewise.
	* posix/sys/types.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* posix/sys/utsname.h [__USE_SVID]: Likewise.
	* posix/sys/wait.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* posix/unistd.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* pwd/pwd.h [__USE_SVID]: Likewise.
	* resolv/netdb.h [__USE_BSD]: Likewise.
	* setjmp/setjmp.h [__USE_BSD]: Likewise.
	* signal/signal.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* socket/sys/socket.h [__USE_BSD]: Likewise.
	* stdlib/fmtmsg.h [__USE_SVID]: Likewise.
	* stdlib/stdlib.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* string/bits/string2.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* string/bits/string3.h [__USE_BSD]: Likewise.
	* string/endian.h [__USE_BSD]: Likewise.
	* string/string.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* string/strings.h [__USE_BSD]: Likewise.
	* sysdeps/generic/netinet/ip.h [__USE_BSD]: Likewise.
	* sysdeps/gnu/netinet/ip_icmp.h [__USE_BSD]: Likewise.
	* sysdeps/mach/hurd/bits/fcntl.h [__USE_BSD]: Likewise.
	* sysdeps/mach/hurd/bits/stat.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/mman.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/bits/mman-linux.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/bits/sys_errlist.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/bits/termios.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/netinet/if_ether.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/netinet/if_fddi.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/netinet/if_tr.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/x86/bits/string.h [__USE_BSD]: Likewise.
	* sysvipc/sys/ipc.h [__USE_SVID]: Likewise.
	* termios/termios.h [__USE_BSD]: Likewise.
	* time/sys/time.h [__USE_BSD]: Likewise.
	* time/time.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.

	* sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_BSD]: Change
	condition to [__USE_MISC].
2014-02-12 23:41:01 +00:00
Richard Henderson
68b7efaadb Relocate alpha from ports to libc
Also fixed the following whitespace nits to satisfy the push:

sysdeps/alpha/alphaev6/memset.S:142: space before tab in indent.
sysdeps/alpha/configure:1: new blank line at EOF.
sysdeps/alpha/fpu/e_sqrt.c:126: space before tab in indent.
sysdeps/alpha/preconfigure:1: new blank line at EOF.
sysdeps/unix/sysv/linux/alpha/syscalls.list:1: new blank line at EOF.
2014-02-12 07:00:06 -08:00
Marcus Shawcroft
75eff3fe90 Relocate AArch64 from ports to libc.
This patch moves the AArch64 port to the main sysdeps hierarchy.  The
move is essentially:

  git mv ports/sysdeps/aarch64 sysdeps/aarch64
  git mv ports/sysdeps/unix/sysv/linux/aarch64 sysdeps/unix/sysv/linux/aarch64

The README is updated and I've updated ChangeLog.aarch64 along the
lines of the ARM move.  The AArch64 build has been tested to confirm
that there were no changes in objdump -dr output or the shared
objects.
2014-02-11 11:36:00 +00:00
Joseph Myers
2ad7600be7 Move mips from ports to libc.
I've moved the MIPS port from ports to the main sysdeps hierarchy.
Beyond the README update, the move of the files was simply

git mv ports/sysdeps/mips sysdeps/mips
git mv ports/sysdeps/unix/mips sysdeps/unix/mips
git mv ports/sysdeps/unix/sysv/linux/mips sysdeps/unix/sysv/linux/mips

and in addition to the ChangeLog entries here, I put a note at the top
of ports/ChangeLog.mips similar to those in other files.

Tested that disassembly of installed shared libraries for mips is the
same before and after this patch (except for ld.so where paths in
assertions are involved, as for arm).

	* sysdeps/mips: Move directory from ports/sysdeps/mips.
	* sysdeps/unix/mips: Move directory from ports/sysdeps/unix/mips.
	* sysdeps/unix/sysv/linux/mips: Move directory from
	ports/sysdeps/unix/sysv/linux/mips.
	* README: Update listing for mips-*-linux-gnu and
	mips64-*-linux-gnu.

	* sysdeps/mips: Move directory to ../sysdeps/mips.
	* sysdeps/unix/mips: Move directory to ../sysdeps/unix/mips.
	* sysdeps/unix/sysv/linux/mips: Move directory to
	../sysdeps/unix/sysv/linux/mips.
2014-02-10 23:30:21 +00:00
Andreas Schwab
3d15ff74fa Whitespace fixes 2014-02-10 20:24:03 +01:00
Andreas Schwab
73588a7223 Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
Chris Metcalf
4372980f58 Move tilegx, tilepro, and linux-generic from ports to libc.
I've moved the TILE-Gx and TILEPro ports to the main sysdeps hierarchy,
along with the linux-generic ports infrastructure.  Beyond the README
update, the move was just

    git mv ports/sysdeps/tile sysdeps/tile
    git mv ports/sysdeps/unix/sysv/linux/tile \
      sysdeps/unix/sysv/linux/tile
    git mv ports/sysdeps/unix/sysv/linux/generic \
      sysdeps/unix/sysv/linux/generic

I updated the relevant ChangeLogs along the lines of the ARM move
in commit c6bfe5c4d7 and tested the 64-bit tilegx build to confirm that
there were no changes in "objdump -dr" output in the shared objects.
2014-02-10 11:04:39 -05:00
Ondřej Bílka
a1ffb40e32 Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
Mike Frysinger
d674667cba shm_open: sync with logic in sem_open
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-02-08 08:17:16 -05:00
Mike Frysinger
7c70f2272e linux: bits/in.h: sync with latest kernel headers
This pulls in the latest defines for {g,s}etsockopt.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-02-08 06:49:56 -05:00
Mike Frysinger
8da79b60ae linux_fsinfo.h: sync with current linux/magic.h
Import the current list of defines available in the kernel headers.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-02-08 06:39:10 -05:00
Joseph Myers
4ac049e1c9 Fix whitespace in ARM files to allow move. 2014-02-08 01:52:38 +00:00
Joseph Myers
c6bfe5c4d7 Move arm from ports to libc.
I've moved the ARM port from ports to the main sysdeps hierarchy.
Beyond the README update, the move of the files was simply

git mv ports/sysdeps/arm sysdeps/arm
git mv ports/sysdeps/unix/arm sysdeps/unix/arm
git mv ports/sysdeps/unix/sysv/linux/arm sysdeps/unix/sysv/linux/arm

and in addition to the ChangeLog entries here, I put a note at the top
of ports/ChangeLog.arm similar to that at the top of
ChangeLog.powerpc.  There is deliberately no NEWS change, as I think
it makes the most sense to put in a general note above all ports
having moved if we can achieve that for 2.20.

Tested that disassembly of installed shared libraries for arm is the
same before and after this patch, except for data (not instructions)
in ld.so (there are assertions in sysdeps/arm/dl-machine.h, and the
path by which that file is found, and so by which it appears in the
assertion message, changes as a result of the move).

	* sysdeps/arm: Move directory from ports/sysdeps/arm.
	* sysdeps/unix/arm: Move directory from ports/sysdeps/unix/arm.
	* sysdeps/unix/sysv/linux/arm: Move directory from
	ports/sysdeps/unix/sysv/linux/arm.
	* README: Update listing for arm-*-linux-gnueabi.

ports/ChangeLog.arm:
	* sysdeps/arm: Move directory to ../sysdeps/arm.
	* sysdeps/unix/arm: Move directory to ../sysdeps.arm.
	* sysdeps/unix/sysv/linux/arm: Move directory to
	../sysdeps/unix/sysv/linux/arm.
2014-02-08 01:49:39 +00:00
Allan McRae
bf06bcee84 Revert "Patch [1/4] async-signal safe TLS."
This reverts commit 69a17d9d24.
2014-02-06 08:46:20 +10:00
Carlos O'Donell
27e839f6f0 Fix comment in kernel-features.h.
Use "was" not "were."
2014-02-05 10:33:42 -05:00
Carlos O'Donell
f877c4f2bf Fix tst-setgetname for Linux kernels < 2.6.33.
Support for /proc/self/task/$tid/comm as added in Linux 2.6.33,
therefore since the test tst-setgetname relies on this functionality
to operate we must skip the test in kernels < 2.6.33. We wrap the
checks with __ASSUME_PROC_PID_TASK_COMM such that in the future when
we move arch_minimum_kernel to 2.6.33 we can remove this code.
2014-02-05 10:13:11 -05:00
Adhemerval Zanella
c01603f763 PowerPC: powerpc64le abilist for 2.17
This patch is the abifiles for powerpc64le based on GLIBC 2.17.
2014-02-04 09:49:34 -02:00
Kaz Kojima
0bad441c77 Restore ucontext ABI for soft-float sh4. 2014-01-24 12:56:12 +09:00
Kaz Kojima
7007c661ad Adjust SH specific fpu_control.h and ucontext.h files. 2014-01-23 14:22:58 +09:00
Andreas Krebbel
0f0c35e46e S/390: Merge 32 and 64 bit ucontext.h. 2014-01-22 18:44:35 +01:00
Adhemerval Zanella
d98720e07f PowerPC: Fix gettimeofday ifunc selection
The IFUNC selector for gettimeofday runs before _libc_vdso_platform_setup where
__vdso_gettimeofday is set. The selector then sets __gettimeofday (the internal
version used within GLIBC) to use the system call version instead of the vDSO one.
This patch changes the check if vDSO is available to get its value directly
instead of rely on __vdso_gettimeofday.

This patch changes it by getting the vDSO value directly.

It fixes BZ#16431.
2014-01-20 12:29:51 -06:00
Adhemerval Zanella
736c304a1a PowerPC: Fix ftime gettimeofday internal call returning bogus data
This patches fixes BZ#16430 by setting a different symbol for internal
GLIBC calls that points to ifunc resolvers. For PPC32, if the symbol
is defined as hidden (which is the case for gettimeofday and time) the
compiler will create local branches (symbol@local) and linker will not
create PLT calls (required for IFUNC). This will leads to internal symbol
calling the IFUNC resolver instead of the resolved symbol.
For PPC64 this behavior does not occur because a call to a function in
another translation unit might use a different toc pointer thus requiring
a PLT call.
2014-01-16 06:53:18 -06:00
Andreas Krebbel
05d138ef07 S/390: Make ucontext_t extendible. 2014-01-07 09:42:23 +01:00
Andreas Krebbel
93a45ff1ca S/390: Make jmp_buf extendible. 2014-01-07 09:36:31 +01:00
Mike Frysinger
9341dde4d5 ptrace.h: add __ prefix to ptrace_peeksiginfo_args
All the other ptrace structures in this file have a __ prefix except this
new one.  This in turn causes build problems for most packages that try to
use ptrace such as strace:

gcc -DHAVE_CONFIG_H -I. -I../..  -I../../linux/x86_64 -I../../linux \
	-I./linux  -Wall -Wwrite-strings -g -O2 -MT process.o -MD -MP \
	-MF .deps/process.Tpo -c -o process.o ../../process.c
In file included from ../../process.c:63:0:
/usr/include/linux/ptrace.h:58:8: error: redefinition of 'struct ptrace_peeksiginfo_args'
 struct ptrace_peeksiginfo_args {
        ^
In file included from ../../defs.h:159:0,
                 from ../../process.c:37:
/usr/include/sys/ptrace.h:191:8: note: originally defined here
 struct ptrace_peeksiginfo_args
        ^

Since this struct was introduced in glibc-2.18, there shouldn't be any
real regressions with adding the __ prefix.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-01-06 08:07:33 -05:00
Mike Frysinger
20f4a8d993 tst-fanotify: switch to AC_DEFINE
Reported-by: Joseph S. Myers <joseph@codesourcery.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-01-04 08:34:01 -05:00
Allan McRae
d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Mike Frysinger
c8590f9d9e tst-fanotify: check for linux/fanotify.h existence
We support older kernels that lack this header, so check for it
before we try to use it.

Reported-by: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-12-31 03:16:42 -05:00
Joseph Myers
ef7344f09c Flatten sysdeps/unix/bsd/bsd4.4 into sysdeps/unix/bsd.
As discussed in
<https://sourceware.org/ml/libc-alpha/2012-04/msg00840.html> and
<https://sourceware.org/ml/libc-alpha/2012-04/msg00989.html>, it seems
appropriate to flatten sysdeps/unix/bsd/bsd4.4 into sysdeps/unix/bsd.

The bulk of the patch is just moving files.  The only other changes
are: update paths in sysdeps/mach/hurd/Implies and
sysdeps/unix/sysv/linux/wait3.c; merge the two syscalls.list files,
with the removal of syscalls that were in
sysdeps/unix/bsd/syscalls.list but overridden in the bsd4.4 directory
by .c files there.

Tested x86_64.  The installed shared libraries are identical before
and after the patch except for libc.so where the move of wait3.c
(included by sysdeps/unix/sysv/linux/wait3.c) affects debug info, but
the disassembly is unchanged.

	* sysdeps/mach/hurd/Implies: Change unix/bsd/bsd4.4 to unix/bsd.
	* sysdeps/unix/bsd/syscalls.list (chflags): Add entry from
	sysdeps/unix/bsd/bsd4.4/syscalls.list.
	(fchflags): Likewise.
	(revoke): Likewise.
	(setlogin): Likewise.
	(sigaltstack): Likewise.
	(wait4): Likewise.
	(sigblock): Remove.
	(sigsetmask): Likewise.
	(wait3): Likewise.
	(waitpid): Likewise.
	* sysdeps/unix/bsd/bsd4.4/syscalls.list: Remove file.
	* sysdeps/unix/sysv/linux/wait3.c: Update directory of included
	file.
	* sysdeps/unix/bsd/bsd4.4/Makefile: Move to ...
	* sysdeps/unix/bsd/Makefile: ... here.
	* sysdeps/unix/bsd/bsd4.4/Versions: Move to ...
	* sysdeps/unix/bsd/Versions: ... here.
	* sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h: Move to ...
	* sysdeps/unix/bsd/bits/sockaddr.h: ... here.
	* sysdeps/unix/bsd/bsd4.4/cmsg_nxthdr.c: Move to ...
	* sysdeps/unix/bsd/cmsg_nxthdr.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/sigblock.c: Move to ...
	* sysdeps/unix/bsd/sigblock.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/sigsetmask.c: Move to ...
	* sysdeps/unix/bsd/sigsetmask.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/sigvec.c: Move to ...
	* sysdeps/unix/bsd/sigvec.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/tcdrain.c: Move to ...
	* sysdeps/unix/bsd/tcdrain.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/tcgetattr.c: Move to ...
	* sysdeps/unix/bsd/tcgetattr.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/tcsetattr.c: Move to ...
	* sysdeps/unix/bsd/tcsetattr.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/wait.c: Move to ...
	* sysdeps/unix/bsd/wait.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/wait3.c: Move to ...
	* sysdeps/unix/bsd/wait3.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/waitpid.c: Move to ...
	* sysdeps/unix/bsd/waitpid.c: ... here.
2013-12-22 14:49:48 +00:00
Paul Pluzhnikov
69a17d9d24 Patch [1/4] async-signal safe TLS.
2013-12-18  Andrew Hunter  <ahh@google.com>

	* sysdeps/generic/ldsodefs.h (_dl_mask_all_signals): New prototype.
	(_dl_unmask_signals): Likewise.
	* sysdeps/mach/hurd/dl-sysdep.h (_dl_mask_all_signals): New stub.
	(_dl_unmask_all_signals): Likewise.
	* sysdeps/unix/sysv/linux/dl-sysdep.h (_dl_mask_all_signals): New prototype.
	(_dl_unmask_all_signals): Likewise.
	* sysdeps/unix/sysv/linux/dl-sysdep.c (_dl_mask_all_signals): New function.
	(_dl_unmask_signals): Likewise.
2013-12-18 15:07:11 -08:00
Joseph Myers
2377648767 Update powerpc-nofpu localplt.data for fegetround hidden_proto / hidden_def.
My recent changes that added libm_hidden_proto / libm_hidden_def for
fegetround had the side effect of removing the need for a
localplt.data entry for fegetround for powerpc-nofpu.  This patch
removes that entry.  Tested powerpc-nofpu.

	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/localplt.data:
	Don't expect fegetround reference in libm.so.
2013-12-18 15:17:39 +00:00
Joseph Myers
25de95bfd1 Remove unused files from sysdeps/unix/bsd/bsd4.4/bits/. 2013-12-17 18:53:32 +00:00
Joseph Myers
2fc6557eb8 Remove various unused files from sysdeps/unix/bsd/. 2013-12-17 18:12:52 +00:00
Adhemerval Zanella
69bbc63d88 PowerPC: Adjust multiarch Implies for PowerPC64
This patch adds Implies files on multiarch folder for POWER chips so
multirach is enabled when building with --with-cpu and powerN
option.
2013-12-13 14:58:02 -05:00
Adhemerval Zanella
5e6a4d4b9e PowerPC: Adjust multiarch Implies for PowerPC64
This patch adds Implies files on multiarch folder for POWER chips so
multirach is enabled when building with --with-cpu and powerN
option.
2013-12-13 14:29:27 -05:00
Kaz Kojima
ddfab6dc65 Use $$ver instead of $ver. 2013-12-13 08:45:01 +09:00
Adhemerval Zanella
ccdc8438dc PowerPC: Adjust multiarch Implies for PowerPC32
This patch adds Implies files on multiarch folder for POWER chips so
multirach is enabled when building with --with-cpu and powerN option.
2013-12-06 05:47:05 -06:00
Adhemerval Zanella
9cbb3aabb5 PowerPC: change sysdeps fpu folder
This patch makes the fpu/multiarch folder appears in front of the
powerpc/fpu folder.
2013-12-06 05:47:02 -06:00
Adhemerval Zanella
4c628e0026 PowerPC: initial support for multilib for PowerPC32
This patch add a empty Makefile, the C IFUNC helper macros, and a empty
available IFUNC implementation enumeration.
2013-12-06 05:46:59 -06:00
Kaz Kojima
8517800fab Add SH implementation of sotruss-lib.c and c++-types.data. 2013-12-06 08:22:22 +09:00
Adhemerval Zanella
eb5ad6b9bc PowerPC: Add systemtap static probe points in setjmp/longjmp
This patch add static probes for setjmp/longjmp in the way gdb expects,fixing
the gdb.base/longjmp.exp gdb testcases.

It changes the symbol_name and use macros to to avoid change the probe names
and ending up adding more logic on GDB (since with the expected name
GDB work seamlessly).
2013-12-05 07:44:07 -06:00
Ulrich Weigand
5b118558f9 PowerPC64 ELFv2 ABI 6/6: Bump ld.so soname version number
To avoid having a ELFv2 binary accidentally picking up an old ABI ld.so,
this patch bumps the soname to ld64.so.2.

In theory (or for testing purposes) this will also allow co-installing
ld.so versions for both ABIs on the same system.  Note that the kernel
will already be able to load executables of both ABIs.  However, there
is currently no plan to use that theoretical possibility in a any
supported distribution environment ...

Note that in order to check which ABI to use, we need to invoke the
compiler to check the _CALL_ELF macro; this is done in a new configure
check in sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac,
replacing the hard-coded value of default-abi in the Makefile.
2013-12-04 07:44:39 -06:00
Ulrich Weigand
8b8a692cfd PowerPC64 ELFv2 ABI 4/6: Stack frame layout changes
This updates glibc for the changes in the ELFv2 relating to the
stack frame layout.  These are described in more detail here:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01146.html

Specifically, the "compiler and linker doublewords" were removed,
which has the effect that the save slot for the TOC register is
now at offset 24 rather than 40 to the stack pointer.

In addition, a function may now no longer necessarily assume that
its caller has set up a 64-byte register save area its use.

To address the first change, the patch goes through all assembler
files and replaces immediate offsets in instructions accessing the
ABI-defined stack slots by symbolic offsets.  Those already were
defined in ucontext_i.sym and used in some of the context routines,
but that doesn't really seem like the right place for those defines.

The patch instead defines those symbolic offsets in sysdeps.h,
in two variants for the old and new ABI, and uses them systematically
in all assembler files, not just the context routines.

The second change only affected a few assembler files that used
the save area to temporarily store some registers.  In those
cases where this happens within a leaf function, this patch
changes the code to store those registers to the "red zone"
below the stack pointer.  Otherwise, the functions already allocate
a stack frame, and the patch changes them to add extra space in
these frames as temporary space for the ELFv2 ABI.
2013-12-04 07:41:39 -06:00
Ulrich Weigand
696caf1d00 PowerPC64 ELFv2 ABI 2/6: Remove function descriptors
This patch adds support for the ELFv2 ABI feature to remove function
descriptors.  See this GCC patch for in-depth discussion:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01141.html

This mostly involves two types of changes: updating assembler source
files to the new logic, and updating the dynamic loader.

After the refactoring in the previous patch, most of the assembler source
changes can be handled simply by providing ELFv2 versions of the
macros in sysdep.h.   One somewhat non-obvious change is in __GI__setjmp:
this used to "fall through" to the immediately following __setjmp ENTRY
point.  This is no longer safe in the ELFv2 since ENTRY defines both
a global and a local entry point, and you cannot simply fall through
to a global entry point as it requires r12 to be set up.

Also, makecontext needs to be updated to set up registers according to
the new ABI for calling into the context's start routine.

The dynamic linker changes mostly consist of removing special code
to handle function descriptors.  We also need to support the new PLT
and glink format used by the the ELFv2 linker, see:
https://sourceware.org/ml/binutils/2013-10/msg00376.html

In addition, the dynamic linker now verifies that the dynamic libraries
it loads match its own ABI.

The hack in VDSO_IFUNC_RET to "synthesize" a function descriptor
for vDSO routines is also no longer necessary for ELFv2.
2013-12-04 07:41:38 -06:00
Ulrich Weigand
d31beafa8e PowerPC64 ELFv2 ABI 1/6: Code refactoring
This is the first patch to support the new ELFv2 ABI in glibc.

As preparation, this patch simply refactors some of the powerpc64 assembler
code to move all code related to creating function descriptors (.opd section)
or using function descriptors (function pointer call) into a central place
in sysdep.h.

Note that most locations creating .opd entries were already using macros
in sysdep.h, this patch simply extends this to the remaining places.

No relevant change in generated code expected.
2013-12-04 07:41:38 -06:00
Ulrich Weigand
5162e7dd96 PowerPC64: Fix incorrect CFI in *context routines
The context established by "makecontext" has a link register pointing
back to an error path within the makecontext routine.  This is currently
covered by the CFI FDE for makecontext itself, which is simply wrong
for the stack frame *inside* the context.  When trying to unwind (e.g.
doing a backtrace) in a routine inside a context created by makecontext,
this can lead to uninitialized stack slots being accessed, causing the
unwinder to crash in the worst case.

Similarly, during parts of the "setcontext" routine, when the stack
pointer has already been switched to point to the new context, the
address range is still covered by the CFI FDE for setcontext.  When
trying to unwind in that situation (e.g. backtrace from an async
signal handler for profiling), it is again possible that the unwinder
crashes.

Theses are all problems in existing code, but the changes in stack
frame layout appear to make the "worst case" much more likely in
the ELFv2 ABI context.  This causes regressions e.g. in the libgo
testsuite on ELFv2.

This patch fixes this by ending the makecontext/setcontext FDEs
before those problematic parts of the assembler, similar to what
is already done on other platforms.   This fixes the libgo
regression on ELFv2.
2013-12-04 07:41:37 -06:00
Ondřej Bílka
b20de2c3d9 Properly handle shm_open validation. Fixes bug 16274. 2013-12-03 20:16:33 +01:00
Joseph Myers
91a1f3fea0 Add powerpc-nofpu/e500 support functions for atomic compound assignment and FLT_ROUNDS. 2013-11-28 18:01:41 +00:00
Adhemerval Zanella
bd12ab55c0 PowerPC: Fix __fe_nomask_env missing symbol
This patch fix the missing symbol __fe_nomask_env from commit
41e8926aa4 for GLIBC_2.1.
2013-11-26 07:25:08 -06:00
Ondřej Bílka
d1d9eaf478 Use __glibc_reserved instead __unused. 2013-11-26 12:32:28 +01:00
Carlos O'Donell
a7624ed987 Fix typo in sys/ptrace.h.
The event code is PTRACE_EVENT_SECCOMP, not PTRAVE_EVENT_SECCOMP.
This patch fixes the V->C typo. There are no ABI issues since the
number remains the same for the code. Code using the old wrong
name will need to be updated.
2013-11-25 14:57:42 -05:00
Adhemerval Zanella
7ab44563a9 PowerPC: Fix __fe_mask_env export
Change SHLIB_COMPAT calls to GLIBC_2_19 for __fe_nomask_env symbol.
2013-11-13 12:58:56 -06:00
H.J. Lu
17c1d9f03e Set arch_minimum_kernel to 3.4.0 for x32
x32 ABI support was added in Linux kernel 3.4.0.
2013-11-13 05:43:58 -08:00
Adhemerval Zanella
7a2ad8cf39 PowerPC: Fix __fe_mask_env export
This patch does not export __fe_mask_env anymore, only providing a
compatibility symbol. It fixes BZ#14143.
2013-11-13 06:45:19 -06:00
Adhemerval Zanella
76a9b99861 PowerPC: Fix vDSO missing ODP entries
This patch fixes the vDSO symbol used directed in IFUNC resolver where
they do not have an associated ODP entry leading to undefined behavior
in some cases. It adds an artificial OPD static entry to such cases
and set its TOC to non 0 to avoid triggering lazy resolutions.
2013-11-08 05:04:25 -06:00
Ondřej Bílka
5d30d85329 Restrict shm_open and shm_unlink to SHMDIR. Fixes bugs 14752 and 15763. 2013-10-31 13:59:01 +01:00
Mike Frysinger
cb8a6dbd17 rename configure.in to configure.ac
Autoconf has been deprecating configure.in for quite a long time.
Rename all our configure.in and preconfigure.in files to .ac.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-10-30 17:32:08 +10:00
Joseph Myers
3c8325fb47 Add e500 port. 2013-10-18 21:04:22 +00:00
Joseph Myers
29d73d867e Move powerpc ports pieces to libc. 2013-10-04 16:02:33 +00:00
Joseph Myers
e246b34759 e500 port: adjust sysdeps/unix/sysv/linux/configure.in case. 2013-10-04 15:57:50 +00:00
Joseph Myers
cd78f7e767 e500 port: getcontext / setcontext / swapcontext. 2013-10-04 15:55:15 +00:00
Alan Modra
f7c399cff5 PowerPC SIGSTKSZ
http://sourceware.org/ml/libc-alpha/2013-08/msg00093.html

This copies the sparc version of sigstack.h, which gives powerpc
 #define MINSIGSTKSZ     4096
 #define SIGSTKSZ        16384

Before the VSX changes, struct rt_sigframe size was 1920 plus 128 for
__SIGNAL_FRAMESIZE giving ppc64 exactly the default MINSIGSTKSZ of
2048.

After VSX, ucontext increased by 256 bytes.  Oops, we're over
MINSIGSTKSZ, so powerpc has been using the wrong value for quite a
while.  Add another ucontext for TM and rt_sigframe is now at 3872,
giving actual MINSIGSTKSZ of 4000.

The glibc testcase that I was looking at was tst-cancel21, which
allocates 2*SIGSTKSZ (not because the test is trying to be
conservative, but because the test actually has nested signal stack
frames).  We blew the allocation by 48 bytes when using current
mainline gcc to compile glibc (le ppc64).

The required stack depth in _dl_lookup_symbol_x from the top of the
next signal frame was 10944 bytes.  I guess you'd want to add 288 to
that, implying an actual SIGSTKSZ of 11232.

	* sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h: New file.
2013-10-04 10:39:11 +09:30
Alan Modra
0b2c2ace36 PowerPC makecontext
http://sourceware.org/ml/libc-alpha/2013-08/msg00092.html

Use conditional form of branch and link to avoid destroying the cpu
link stack used to predict blr return addresses.

	* sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S: Use
	conditional form of branch and link when obtaining pc.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S: Likewise.
2013-10-04 10:38:59 +09:30
Alan Modra
02f04a6c7f PowerPC LE _dl_hwcap access
http://sourceware.org/ml/libc-alpha/2013-08/msg00091.html

More LE support, correcting word accesses to _dl_hwcap.

	* sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S: Use
	HIWORD/LOWORD.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S: Ditto.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S: Ditto.
2013-10-04 10:38:46 +09:30
Mike Frysinger
47f28d0a66 tst-fanotify: fix style
Reported-by: Andreas Jaeger <aj@suse.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-09-28 23:53:50 -04:00
Patrick 'P. J.' McDermott
0a834ddecb don't use Bash-specific ${parameter/pattern/string} expansion
sysdeps/unix/make-syscalls.sh and sysdeps/unix/Makefile use GNU Bash's
${parameter/pattern/string} parameter expansion.  Non-Bash shells (e.g.
dash or BusyBox ash when built with CONFIG_ASH_BASH_COMPAT disabled)
don't support this expansion syntax.  So glibc will fail to build when
$(SHELL) expands to a path that isn't provided by Bash.

An example build failure:

    for dir in [...]; do \
      test -f $dir/syscalls.list && \
      { sysdirs='[...]' \
        asm_CPP='gcc -c    -I[...]   -D_LIBC_REENTRANT -include include/libc-symbols.h       -DASSEMBLER  -g -Wa,--noexecstack   -E -x assembler-with-cpp' \
        /bin/sh sysdeps/unix/make-syscalls.sh $dir || exit 1; }; \
      test $dir = sysdeps/unix && break; \
    done > [build-dir]/sysd-syscallsT
    sysdeps/unix/make-syscalls.sh: line 273: syntax error: bad substitution

This patch simply replaces the three instances of the Bash-only syntax
in these files with an echo and sed command substitution.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-09-28 23:03:09 -04:00
Andreas Schwab
ffdd31816a Add O_TMPFILE to <fcntl.h> 2013-09-11 11:52:46 +02:00
Carlos O'Donell
6c82a2f8d7 Coordinate IPv6 definitions for Linux and glibc
This change synchronizes the glibc headers with the Linux kernel
headers and arranges to coordinate the definition of structures
already defined the Linux kernel UAPI headers.

It is now safe to include glibc's netinet/in.h or Linux's linux/in6.h
in any order in a userspace application and you will get the same
ABI. The ABI is guaranteed by UAPI and glibc.
2013-09-06 01:02:30 -04:00
Mike Frysinger
bb8ea71379 tst-fanotify: skip when we get back EPERM
Since fanotify_init requires CAP_SYS_ADMIN in order to work (which usually
means running as root), we need to handle that error case too.

Reported-by: Andreas Jaeger <aj@suse.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-09-05 03:04:01 -04:00
Mike Frysinger
ac44401205 tst-fanotify: new simple test
Basic test for the fanotify functions.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-09-02 23:22:23 -04:00
Ondřej Bílka
382466e04e Fix typos. 2013-08-30 18:08:59 +02:00
Ondřej Bílka
d4e16af1ae Remove aix specific files. 2013-08-29 18:11:45 +02:00
Thomas Schwinge
d821f07c9e Support ELFOSABI_GNU on all GNU systems. 2013-08-29 12:22:18 +02:00
Thomas Schwinge
c54290cf08 Use ELFOSABI_GNU instead of ELFOSABI_LINUX. 2013-08-29 12:22:17 +02:00
Ondřej Bílka
6f65e66895 Fix typos. 2013-08-29 09:11:45 +02:00
Roland McGrath
5d1f0a09f3 True stub __ifreq. 2013-08-27 10:42:52 -07:00
Roland McGrath
6fcf28b352 Clean up __libc_sa_len helper. 2013-08-27 10:34:16 -07:00
Roland McGrath
e041fb8b65 Replace generic bits/socket.h with 4.4 file. 2013-08-27 10:33:15 -07:00
Roland McGrath
8cc3269f95 Flesh out 4.4 bits/socket.h with SOCK_CLOEXEC, SOCK_NONBLOCK. 2013-08-27 10:32:30 -07:00
Ondřej Bílka
c0c3f78afb Fix typos. 2013-08-21 19:48:48 +02:00
Adhemerval Zanella
d400dcac5e PowerPC: fix backtrace to handle signal trampolines
This patch fixes backtrace for PPC32 and PPC64 to correctly handle
signal trampolines. The 'debug/tst-backtrace6.c' also check for
SA_SIGINFO handling, where is triggers another vDSO symbols for PPC32.
2013-08-20 15:05:49 -05:00
Joseph Myers
0716c4fc9f Include <string.h> in sysdeps/unix/sysv/linux/mmap64.c. 2013-08-20 19:38:23 +00:00
Joseph Myers
42c8fdd8f1 Use __getpagesize and __ffs in MMAP2_PAGE_SHIFT == -1 case of mmap64. 2013-08-20 16:43:59 +00:00
Andreas Krebbel
4e39af6eca * sysdeps/unix/sysv/linux/s390/sys/procfs.h (struct elf_prstatus):
Align 32 bit compat elf_greg to 8 bytes.
2013-08-20 14:13:59 +02:00
Florian Weimer
91ce40854d CVE-2013-4237, BZ #14699: Buffer overflow in readdir_r
* sysdeps/posix/dirstream.h (struct __dirstream): Add errcode
	member.
	* sysdeps/posix/opendir.c (__alloc_dir): Initialize errcode
	member.
	* sysdeps/posix/rewinddir.c (rewinddir): Reset errcode member.
	* sysdeps/posix/readdir_r.c (__READDIR_R): Enforce NAME_MAX limit.
	Return delayed error code.  Remove GETDENTS_64BIT_ALIGNED
	conditional.
	* sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Do not define
	GETDENTS_64BIT_ALIGNED.
	* sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise.
	* manual/filesys.texi (Reading/Closing Directory): Document
	ENAMETOOLONG return value of readdir_r.  Recommend readdir more
	strongly.
	* manual/conf.texi (Limits for Files): Add portability note to
	NAME_MAX, PATH_MAX.
	(Pathconf): Add portability note for _PC_NAME_MAX, _PC_PATH_MAX.
2013-08-16 09:40:34 +02:00
Adhemerval Zanella
7b1f8b581f PowerPC: use _dl_static_init to set GLRO(gl_pagesize)
This patch fixes dlfcn/tststatic5 for PowerPC where pagesize
variable was not properly initialized in certain cases. This patch
is based on other architecture code.
2013-07-23 07:39:57 -05:00
Carlos O'Donell
e4608715e6 CVE-2013-2207, BZ #15755: Disable pt_chown.
The helper binary pt_chown tricked into granting access to another
user's pseudo-terminal.

Pre-conditions for the attack:

 * Attacker with local user account
 * Kernel with FUSE support
 * "user_allow_other" in /etc/fuse.conf
 * Victim with allocated slave in /dev/pts

Using the setuid installed pt_chown and a weak check on whether a file
descriptor is a tty, an attacker could fake a pty check using FUSE and
trick pt_chown to grant ownership of a pty descriptor that the current
user does not own.  It cannot access /dev/pts/ptmx however.

In most modern distributions pt_chown is not needed because devpts
is enabled by default. The fix for this CVE is to disable building
and using pt_chown by default. We still provide a configure option
to enable hte use of pt_chown but distributions do so at their own
risk.
2013-07-21 15:39:55 -04:00
Carlos O'Donell
d7e06450b9 BZ #15711: Avoid circular dependency for syscall.h
The generated header is compiled with `-ffreestanding' to avoid any
circular dependencies against the installed implementation headers.
Such a dependency would require the implementation header to be
installed before the generated header could be built (See bug 15711).
In current practice the generated header dependencies do not include
any of the implementation headers removed by the use of `-ffreestanding'.

---

2013-07-15  Carlos O'Donell  <carlos@redhat.com>

	[BZ #15711]
	* sysdeps/unix/sysv/linux/Makefile ($(objpfx)bits/syscall%h):
	Avoid system header dependency with -ffreestanding.
	($(objpfx)bits/syscall%d): Likewise.
2013-07-16 17:55:43 -04:00
Andreas Jaeger
521c6785e1 Sync sys/ptrace with Linux 3.10 2013-07-04 09:49:14 +02:00
Ryan S. Arnold
1ae8bfe07c Add GLRO(dl_hwcap2) for new AT_HWCAP2 auxv_t a_type. 2013-06-28 16:50:48 -05:00
Joseph Myers
8fbec01098 Consistently use page_shift in sysdeps/unix/sysv/linux/mmap64.c. 2013-06-28 21:45:11 +00:00
Ryan S. Arnold
2f063a6e84 PowerPC: Enable POWER8 platform sans hwcap bits. 2013-06-24 15:33:32 -05:00
Joseph Myers
d8412221e6 Include <string.h> in sysdeps/unix/sysv/linux/libc_fatal.c. 2013-06-22 19:30:10 +00:00
Siddhesh Poyarekar
61dd6208fb New API to set default thread attributes
This patch introduces two new convenience functions to set the default
thread attributes used for creating threads.  This allows a programmer
to set the default thread attributes just once in a process and then
run pthread_create without additional attributes.
2013-06-15 12:24:15 +05:30
Siddhesh Poyarekar
58206c6863 Improve precision of clock() function on Linux
Resolves #12515.

Use CLOCK_PROCESS_CPUTIME_ID instead of times to get better precision
in the value returned by clock.
2013-06-13 09:54:35 +05:30
Siddhesh Poyarekar
89fb683558 Fix symbol definitions for __clock_* functions
__clock_gettime and other __clock_* functions could result in an extra
PLT reference within libc.so if it actually gets used.  None of the
code currently uses them, which is why this probably went unnoticed.
2013-06-11 11:11:11 +05:30
Joseph Myers
60d2f8f3c7 Use (void) in no-arguments function definitions. 2013-06-08 00:22:23 +00:00