Ensure that all objects in ARM EABI glibc have the proper EABI build
attributes to indicate that 8-byte stack alignment is required and
preserved. (GNU ld does not currently give errors for mixing code
requiring 8-byte alignment - such as anything built with GCC - and
code not marked as preserving it, because of the prevalence of
assembly code without proper markers to indicate that alignment is
preserved. The ARM RealView linker does give such errors.)
The bulk of the markers are accomplished by the change to sysdep.h,
but a few .S files do not include sysdep.h. In the case of
internal_accept4.S, no code is generated because EABI does not have
socketcall, but for completeness a dummy file with the right
attributes is used to override the default version in libc.
* sysdeps/arm/sysdep.h: (Tag_ABI_align8_preserved,
Tag_ABI_align8_needed): Attributes added.
* sysdeps/arm/elf/start.S: Likewise.
* sysdeps/arm/eabi/abi-note.S: New file.
* sysdeps/unix/sysv/linux/arm/eabi/internal_accept4.S: New
file.
* setjmp and longjmp were using the obsolete fstmiax and fldmiax
instructions.
* Because of a confusion with two different sets of names for the same
registers (r0...r3 and a1...a4), if VFP was present then the
subsequent check for iWMMXt support would use a register that had
been clobbered by saving/restoring the VFP registers. (The bit
being checked was clobbered by a reserved bit of FPSCR that it
always 0 on present hardware, and no present hardware has both VFP
and iWMMXt, so this did not cause visible problems.)
2009-10-22 Andrew Stubbs <ams@codesourcery.com>
Julian Brown <julian@codesourcery.com>
* sysdeps/arm/eabi/setjmp.S (__sigsetjmp): Replace deprecated
instruction fstmiax with vstmia.
Correct register conflict and comment.
* sysdeps/arm/eabi/__longjmp.S (__longjmp): Use vldmia not fldmiax.
Don't clobber r1/a2 register before testing IWMMXT hwcap.
* sysdeps/arm/eabi/aeabi_lcsts.c (__aeabi_stdin, __aeabi_stdout,
__aeabi_stderr): New variables.
(setup_aeabi_stdio): New function. Add it to .preinit_array.
* sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
(libgcc_s_handle): New variable.
(pthread_cancel_init): Depend in libgcc_s_handle for decision to
load DSO. Assign last.
(__unwind_freeres): New function.
* sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c:
Likewise.
Joseph Myers <joseph@codesourcery.com>
* sysdeps/arm/dl-machine.h (elf_machine_dynamic): Ditto.
(elf_machine_load_address): Clear T bit of PLT entry contents.
(RTLD_START): Mark function symbols as such. Tweak pc-relative
addressing to avoid depending on pc read pipeline offset.
* sysdeps/arm/machine-gmon.h (MCOUNT): Add Thumb-2 implementation.
* sysdeps/arm/tls-macros.h: Add alignment for Thumb-2.
(ARM_PC_OFFSET): Define.
(TLS_IE): Define differently for Thumb-2.
(TLS_LE, TLS_LD, TLS_GD): Use ARM_PC_OFFSET.
* sysdeps/arm/elf/start.S: Switch to thumb mode for Thumb-2.
* sysdeps/unix/sysv/linux/arm/eabi/sysdep.h (INTERNAL_SYSCALL_RAW):
Add Thumb implementation.
* sysdeps/unix/sysv/linux/arm/eabi/nptl/aio_misc.h: New.
* sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c: Enforce
alignment for Thumb-2. Adjust offset from PC for Thumb-2.
* sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c: Ditto.
* sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h (atomic_full_barrier,
__arch_compare_and_exchange_val_32_acq): Add Thumb-2 implementation.
* data/localplt-arm-linux-gnueabi.data: New.
* sysdeps/arm/bsd-_setjmp.S: Use HIDDEN_JUMPTARGET to call
__sigsetjmp.
* sysdeps/arm/bsd-setjmp.S: Likewise.
* sysdeps/arm/eabi/aeabi_localeconv.c: Use __localeconv.
* sysdeps/arm/eabi/find_exidx.c (__gnu_Unwind_Find_exidx): Use
__dl_iterate_phdr.
* sysdeps/arm/eabi/setjmp.S: Add hidden_def (__sigsetjmp).
* sysdeps/arm/memmove.S: Use HIDDEN_JUMPTARGET to call memcpy from
within libc.
* sysdeps/arm/setjmp.S: Add hidden_def (__sigsetjmp).
* sysdeps/unix/sysv/linux/arm/clone.S: Use HIDDEN_JUMPTARGET to
call _exit.
* sysdeps/unix/sysv/linux/arm/ioperm.c (init_iosys): Use __sysctl,
__readlink and fgets_unlocked.
(_ioperm): Use __open and __close.
* sysdeps/arm/eabi/fgetexcptflg.c: New.
* sysdeps/arm/eabi/fsetexcptflg.c (__fesetexceptflag): Operate on
set exception flags, not on mask of enabled exceptions.
type and __THROW marker of splice, vmsplice, and tee.
* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Correct return value
type and __THROW marker of splice, vmsplice, and tee.
lll_futex_wake not lll_private_futex_wake.
* sysdeps/unix/sysv/linux/arm/bits/fcntl.h (O_CLOEXEC): Define.
* sysdeps/unix/sysv/linux/arm/eabi/sysdep.h: Include <tls.h>
* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c
(__lll_lock_wait_private, __lll_lock_wait): New.
(__lll_timedlock_wait): Don't include in libc.so; Take private
argument. Use atomic_compare_and_exchange_bool_acq.
* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h: Renamed all
lll_mutex_* resp. lll_robust_mutex_* macros to lll_*
resp. lll_robust_*. Renamed all LLL_MUTEX_LOCK_* macros to
LLL_LOCK_*. Include <kernel-features.h>.
(LLL_LOCK_INITIALIZER): Remove duplicate definition.
(__lll_private_flag): Define.
(lll_futex_timed_wait): Pass private flag to syscall.
(lll_futex_wake): Likewise.
(lll_private_futex_wait, lll_private_futex_timed_wait,
lll_private_futex_wake): Remove.
(lll_robust_dead, lll_futex_requeue): Take private arguments.
(lll_futex_wake_unlock): Pass private flag to syscall.
(__lll_robust_trylock): Convert to macro.
(__lll_robust_lock_wait): Add private argument.
(__lll_lock_wait_private, __lll_lock_wait): Declare.
(__lll_lock): Convert to macro. Take private argument.
(__lll_cond_lock): Likewise.
(lll_lock, lll_cond_lock): Take private arguments.
(__lll_robust_lock): Take private argument.
(__lll_timedlock_wait, __lll_robust_timedlock_wait): Take private
arguments.
(__lll_timedlock, __lll_robust_timedlock): Convert to macros.
Take private arguments.
(lll_timedlock, lll_robust_timedlock): Take private arguments.
(__lll_unlock, __lll_robust_unlock): Convert to macros. Take
private arguments.
(lll_unlock, lll_robust_unlock): Take private arguments.
(__lll_mutex_unlock_force, lll_mutex_unlock_force, lll_lock_t,
lll_trylock, lll_lock, lll_unlock, lll_islocked): Remove.
(lll_wait_tid): Pass LLL_SHARED to lll_futex_wait.
(__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
__lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
lll_cond_wake, lll_cond_broadcast): Remove.
* sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c
(clear_once_control, __pthread_once): Use lll_futex_wake not
lll_private_futex_wake.