Commit Graph

515 Commits

Author SHA1 Message Date
Mike Frysinger
98b78b4b72 ia64: longjmp_chk: support signal stacks [BZ #16372]
The sp check has to be moved up to the start of the func since it now
makes a system call and that'll clobber a lot of registers.

URL: https://sourceware.org/bugzilla/show_bug.cgi?id=16372
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-12-30 23:12:16 -05:00
Mike Frysinger
e646a161ce ia64: setjmp/longjmp: stop saving/restoring fpsr [BZ #16379]
The new tst-setjmp-fp test has been failing on IA64 because the setjmp
and longjmp helpers take care of saving/restoring the fpsr register.
Per the C standards, this is incorrect, so disable that logic.

URL: https://sourceware.org/bugzilla/show_bug.cgi?id=16379
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-12-30 10:02:49 -05:00
Mike Frysinger
d97ae285e8 ia64: setjmp: use HIDDEN_JUMPTARGET
Rather than opencode the __GI_xxx logic, use proper hidden helpers.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-12-30 05:35:39 -05:00
Mike Frysinger
88dd1da188 ia64: syscall: add some helpful documentation
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-12-29 16:29:27 -05:00
Mike Frysinger
aa8e370425 ia64: implement futex requeue pi support
Used the s390 code as a guideline until all tests pass.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-12-25 04:40:22 -05:00
Mike Frysinger
5243e58568 ia64: add lll_futex_timed_wait_bitset
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-12-25 04:37:30 -05:00
Mike Frysinger
fe1a83aa1c ia64: ioperm: clean up long dead code
This file has a few #if 0 code paths which cause a build time warning:
ports/sysdeps/unix/sysv/linux/ia64/ioperm.c:66:7: warning:
	variable 'prot' set but not used [-Wunused-but-set-variable]

Rather than add more #if 0 around that variable, just delete the code
altogether.  Not like it's going to ever be implemented.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-12-24 05:34:52 -05:00
Mike Frysinger
41b1792698 ia64: implement sotruss support
Tested with:
	$ cat test.c
	main(){close(0x1024, 2, 3);}
	$ gcc test.c
	$ sotruss -e ./a.out
		a.out -> libc.so.6.1    : __libc_start_main(0x4000000000000950, 0x1, 0x60000fffffb56bc8)
		a.out -> libc.so.6.1    : close(0x1024, 0x2, 0x3)
		a.out -> libc.so.6.1    : close - 0xffffffffffffffff

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-12-24 04:05:46 -05:00
Mike Frysinger
cd702fc455 ia64: link.h: adjust whitespace
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-12-24 04:05:46 -05:00
Marcus Shawcroft
9dbebe1a67 [AArch64] Save and restore q0-q7 on entry to dynamic linker.
[BZ #15128] Ensure all argument passing registers are saved and
restored on entry to dynamic linker.
2013-12-18 12:07:05 +00:00
Marcus Shawcroft
0f197fe5b6 [AArch64] Implement FUTEX_*_REQUEUE_PI 2013-12-17 17:57:34 +00:00
Marcus Shawcroft
e4a110f59e [AArch64] libm-test-ulps regenerated from scratch. 2013-12-17 13:03:01 +00:00
Marcus Shawcroft
653fac831d [AArch64] Back out sqrt() addition to libm-test-ulps. 2013-12-17 12:28:10 +00:00
Marcus Shawcroft
39e1f44ff4 [AArch64] Regenerate libm-test-ulps. 2013-12-11 16:19:34 +00:00
Andreas Schwab
eca60f6ed3 m68k: use math_force_eval in nextafterl 2013-12-10 00:16:12 +01:00
Andreas Schwab
e1c5c75ea2 m68k: add support for PI futexes 2013-12-10 00:16:01 +01:00
Andreas Schwab
2ea2960024 m68k: don't assume PI futexes before 3.10 2013-12-10 00:15:41 +01:00
Andreas Schwab
5fc273b084 ChangeLog fix 2013-12-10 00:15:38 +01:00
Richard Henderson
7380e0e469 alpha: Convert <bits/mman.h> to <bits/mman-linux.h> 2013-12-07 06:19:35 +10:00
Joseph Myers
6905a19f7a Update MIPS dl-lookup.c from generic version. 2013-12-03 22:56:05 +00:00
Joseph Myers
3c1c46a64a Fix dbl-64 e_sqrt.c for non-default rounding modes (bug 16271). 2013-11-28 16:50:38 +00:00
Aurelien Jarno
24d8773d06 MIPS: Fix RLIM64_INFINITY constant for O32 and N32 ABIs
Fix the RLIM64_INFINITY constant for O32 and N32 ABIs to match the
kernel one. Change the getrlimit64/setrlimit64 into old compat symbols,
and provide the Linux generic getrlimit64/setrlimit64 functions as
GLIBC_2_19 version.
2013-11-27 17:38:16 +01:00
Aurelien Jarno
9480dfe2a3 MIPS: Add wrappers to get/setrlimit64 to fix RLIM64_INFINITY constant
RLIM64_INFINITY was supposed to be a glibc convention rather than
anything seen by the kernel, but it ended being passed to the kernel
through the prlimit64 syscall.  On O32 and N32 ABIs, we therefore
end-up with different values on the userland and kernel side:

* On the kernel side, the value is defined for all architectures as
  include/uapi/linux/resource.h:

  #define RLIM64_INFINITY           (~0ULL)

* On the GNU libc side, the value is defined in
  ports/sysdeps/unix/sysv/linux/mips/bits/resource.h:

  For the O32 and N32 ABI:
  #  define RLIM64_INFINITY 0x7fffffffffffffffULL

  and for the N64 ABI:
  #  define RLIM64_INFINITY 0xffffffffffffffffUL

This was not a problem until the prlimit64 syscall was wired in the
2.6.36 kernel. Given the GLIBC uses the prlimit64 syscall to implement
getrlimit64 and setrlimit64, pam_limits.so is setting the limits to
a very big value instead of infinity. As a normal user process can
later only decrease the value and not increase it, it will later get
and EPERM error when trying to set the value to infinity with setrlimit.

The GLIBC has this constant for more than 7 years, and as it is defined
in a header file, it means a lot of binaries are in the wild. This patch
fixes that by adding a wrapper to fix the value passed to or received
from the kernel, before or after calling the prlimit64 syscall.
2013-11-27 17:36:51 +01:00
Will Newton
7520ff8c74 aarch64: Enable ifunc support.
Add support for handling the R_AARCH64_IRELATIVE relocation and
STT_GNU_IFUNC symbols to the aarch64 port.

ports/ChangeLog.aarch64:

2013-11-26  Will Newton  <will.newton@linaro.org>

	* sysdeps/aarch64/dl-irel.h: Include ldsodefs.h.
	(ELF_MACHINE_IRELA): Define.  (elf_ifunc_invoke): Pass
	hwcap to ifunc resolver function.  (elf_irela): New function.
	* sysdeps/aarch64/dl-machine.h: Include dl-irel.h.
	(elf_machine_rela) Handle STT_GNU_IFUNC symbols and
	R_AARCH64_IRELATIVE relocations.  (elf_machine_lazy_rel):
	Handle R_AARCH64_IRELATIVE relocations.
2013-11-26 16:18:04 +00:00
Ondřej Bílka
d1d9eaf478 Use __glibc_reserved instead __unused. 2013-11-26 12:32:28 +01:00
Roland McGrath
068dcfd675 ARM: Fix memcpy computed-jump calculations for ARM_ALWAYS_BX case. 2013-11-22 11:39:20 -08:00
Guy Martin
daf75146de Don't use broken DL_AUTO_FUNCTION_ADDRESS()
On hppa and ia64, the macro DL_AUTO_FUNCTION_ADDRESS() uses the
variable fptr[2] in it's own scope.

The content of fptr[] is thus undefined right after the macro exits.
Newer gcc's (>= 4.7) reuse the stack space of this variable triggering
a segmentation fault in dl-init.c:69.

To fix this we rewrite the macros to make the call directly to init
and fini without needing to pass back a constructed function pointer.
2013-11-21 15:52:31 -05:00
Chung-Lin Tang
7cf8ac4c31 linux-generic: fix alignment of struct stat/statfs for nios2
The hard alignment of 8 was appropriate for most platforms for
which 8-byte values are 8-byte aligned, but this is not true
for the nios2 platform, so only align to the alignment of the
8-byte type on the platform.

Remove the explicit alignment of struct statfs as it's redundant.
2013-11-20 16:12:18 -05:00
Richard Henderson
027e32bd42 alpha: Fix signal thunk unwind info 2013-11-16 06:34:39 +10: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
de5d4f4c8a Move entries to correct port ChangeLog files. 2013-10-18 21:28:57 +00:00
Yuri Chornoivan
5560275828 Fix typos. 2013-10-12 14:47:50 +02:00
Andreas Schwab
7d0c5ed0fe Fix typo in last change 2013-10-08 21:25:12 +02:00
Andreas Schwab
ed4c993944 m68k: use PIC for Scrt1.o 2013-10-08 21:02:23 +02:00
Joseph Myers
29d73d867e Move powerpc ports pieces to libc. 2013-10-04 16:02:33 +00:00
Joseph Myers
cd78f7e767 e500 port: getcontext / setcontext / swapcontext. 2013-10-04 15:55:15 +00:00
Will Newton
41bc5e0935 ARM: Allow building __sigsetjmp as Thumb.
Convert __sigsetjmp code to allow building as Thumb.

ports/ChangeLog.arm:

2013-10-04  Will Newton  <will.newton@linaro.org>

	* sysdeps/arm/setjmp.S (NO_THUMB): Remove define.
	(__sigsetjmp): Use Thumb supported instructions.
2013-10-04 10:54:58 +01:00
Will Newton
6d9b9a67af ARM: Allow building __longjmp as Thumb.
Convert __longjmp code to allow building as Thumb.

ports/ChangeLog.arm:

2013-10-04  Will Newton  <will.newton@linaro.org>

	* sysdeps/arm/__longjmp.S (NO_THUMB): Remove define.
	(__longjmp): Use Thumb supported instructions.
	* sysdeps/unix/sysv/linux/arm/____longjmp_chk.S (NO_THUMB):
	Remove define.
2013-10-04 10:53:43 +01:00
Alan Modra
f5a0a42a03 fix changelog date 2013-10-04 10:57:05 +09:30
Alan Modra
1b6adf888d PowerPC floating point little-endian [1 of 15]
http://sourceware.org/ml/libc-alpha/2013-08/msg00081.html

This is the first of a series of patches to ban ieee854_long_double
and the ieee854_long_double macros when using IBM long double.  union
ieee854_long_double just isn't correct for IBM long double, especially
when little-endian, and pretending it is OK has allowed a number of
bugs to remain undetected in sysdeps/ieee754/ldbl-128ibm/.

This changes the few places in generic code that use it.

	* stdio-common/printf_size.c (__printf_size): Don't use
	union ieee854_long_double in fpnum union.
	* stdio-common/printf_fphex.c (__printf_fphex): Likewise.  Use
	signbit macro to retrieve sign from long double.
	* stdio-common/printf_fp.c (___printf_fp): Use signbit macro to
	retrieve sign from long double.
	* sysdeps/ieee754/ldbl-128ibm/printf_fphex.c: Adjust for fpnum change.
	* sysdeps/ieee754/ldbl-128/printf_fphex.c: Likewise.
	* sysdeps/ieee754/ldbl-96/printf_fphex.c: Likewise.
	* sysdeps/x86_64/fpu/printf_fphex.c: Likewise.
	* math/test-misc.c (main): Don't use union ieee854_long_double.
ports/
	* sysdeps/ia64/fpu/printf_fphex.c: Adjust for fpnum change.
2013-10-04 10:31:41 +09:30
Steve Ellcey
bc543b02c7 2013-09-26 Steve Ellcey <sellcey@mips.com>
[BZ #15632]
	* sysdeps/mips/mips32/fpu/e_sqrt.c: New.
	* sysdeps/mips/mips32/fpu/e_sqrtf.c: New.
	* sysdeps/mips/mips64/n32/fpu/e_sqrt.c: New.
	* sysdeps/mips/mips64/n32/fpu/e_sqrtf.c: New.
	* sysdeps/mips/mips64/n64/fpu/e_sqrt.c: New.
	* sysdeps/mips/mips64/n64/fpu/e_sqrtf.c: New.
2013-10-03 12:56:34 -07:00
Steve Ellcey
c4264185ab 2013-09-26 Steve Ellcey <sellcey@mips.com>
[BZ #15632]
	* sysdeps/mips/mips32/fpu/e_sqrt.c: New.
	* sysdeps/mips/mips32/fpu/e_sqrtf.c: New.
	* sysdeps/mips/mips64/n32/fpu/e_sqrt.c: New.
	* sysdeps/mips/mips64/n32/fpu/e_sqrtf.c: New.
	* sysdeps/mips/mips64/n64/fpu/e_sqrt.c: New.
	* sysdeps/mips/mips64/n64/fpu/e_sqrtf.c: New.
2013-10-03 12:55:36 -07:00
Will Newton
b7f2d27dbd ARM: Add pointer encryption support.
Add support for pointer encryption in glibc internal structures in C
and assembler code. Pointer encryption is a glibc security feature
described here:

https://sourceware.org/glibc/wiki/PointerEncryption

The ARM implementation uses global variables instead of thread pointer
relative accesses to get the value of the pointer encryption guard
because accessing the thread pointer can be very expensive on older
ARM cores.

ports/ChangeLog.arm:

2013-10-03  Will Newton  <will.newton@linaro.org>

	* sysdeps/arm/__longjmp.S (__longjmp): Demangle fp, sp
	and lr when restoring register values.
	* sysdeps/arm/include/bits/setjmp.h (JMP_BUF_REGLIST): Remove
	sp and lr from list and replace fp with a4.
	* sysdeps/arm/jmpbuf-unwind.h (_jmpbuf_sp): New function.
	(_JMPBUF_UNWINDS_ADJ): Call _jmpbuf_sp.
	* sysdeps/arm/setjmp.S (__sigsetjmp): Mangle fp, sp and lr
	before storing register values.
	* sysdeps/arm/sysdep.h (LDST_GLOBAL): New macro.
	* sysdeps/unix/sysv/linux/arm/sysdep.h (PTR_MANGLE): New macro.
	(PTR_DEMANGLE): Likewise. (PTR_MANGLE2): Likewise.
	(PTR_DEMANGLE2): Likewise.
2013-10-03 11:35:50 +01:00
Richard Henderson
b8123ef5b1 alpha: Improve conditions under which PTR_MANGLE is defined
After 0b1f8e3564, we now have
a __pointer_chk_guard_local for the static libc.
2013-10-01 12:27:02 -07:00
Andrew Pinski
995a05b173 [AArch64] Fix BE access to errno. 2013-09-30 10:58:26 +01:00
Marcus Shawcroft
8f5a90c270 [AArch64] Support __mcount profiling. 2013-09-24 13:03:02 +01:00
Marcus Shawcroft
cfa4df9500 [AArch64] Adding sigcontextinfo.h 2013-09-24 12:59:06 +01:00
Will Newton
82c93a0ffe ports/sysdeps/arm/nptl/tls.h: Remove TLS_INIT_TP_EXPENSIVE.
This define was removed from the rest of the tree eight years ago.

ports/ChangeLog.arm:

2013-09-24  Will Newton  <will.newton@linaro.org>

	* ports/sysdeps/arm/nptl/tls.h (TLS_INIT_TP_EXPENSIVE): Remove
	macro.
2013-09-24 09:29:04 +01:00
Steve Ellcey
c79fb0ed65 2013-09-23 Steve Ellcey <sellcey@mips.com>
* sysdeps/mips/math_private.h (libc_feholdexcept_mips): New function.
	(libc_feholdexcept): New macro.
	(libc_feholdexceptf): New macro.
	(libc_feholdexceptl): New macro.
	(libc_fesetround_mips): New function.
	(libc_fesetround): New macro.
	(libc_fesetroundf): New macro.
	(libc_fesetroundl): New macro.
	(libc_feholdexcept_setround_mips): New function.
	(libc_feholdexcept_setround): New macro.
	(libc_feholdexcept_setroundf): New macro.
	(libc_feholdexcept_setroundl): New macro.
	(libc_fesetenv_mips): New function.
	(libc_fesetenv): New macro.
	(libc_fesetenvf): New macro.
	(libc_fesetenvl): New macro.
	(libc_feupdateenv_mips): New function.
	(libc_feupdateenv): New macro.
	(libc_feupdateenvf): New macro.
	(libc_feupdateenvl): New macro.
2013-09-23 09:58:30 -07:00
Maciej W. Rozycki
d93fa6592b MIPS: bits/atomic.h: Fix comment typo 2013-09-23 17:45:34 +01:00