freebsd-dev/libexec/rtld-elf
Andrew Turner 0685d955d6 Align the stack in _rtld_bind_start. Normally this is called with the
correct stack alignment, however when we have a leaf function that uses
thread local storage it calls __aeabi_read_tp to get the thread pointer.
Neither GCC or clang see this as a function call so will align the stack
to a 4-byte boundary. This may be a problem as _rtld_bind expects to be
on an 8-byte boundary.

The solution is to store a copy of the stack pointer and force the
alignment before calling _rtld_bind.

This fixes a problem with armeb where applications would crash in odd ways.
It should also remove the need for a local patch to clang to force the
stack alignment to an 8-byte boundary, even for leaf functions. Further
testing will be needed before reverting this local change to clang as we
may rely on it in other places.

Reviewed by:	jmg@
2014-07-06 10:24:06 +00:00
..
amd64 Add dwarf annotations to the amd64 _rtld_bind_start to allow debuggers 2014-04-14 22:44:50 +00:00
arm Align the stack in _rtld_bind_start. Normally this is called with the 2014-07-06 10:24:06 +00:00
i386
ia64 Fix r264346 for ia64. We need to allocate memory for the function 2014-07-02 22:04:12 +00:00
mips
powerpc Revert r253748,253749 2013-07-28 18:44:17 +00:00
powerpc64 Revert r253748,253749 2013-07-28 18:44:17 +00:00
sparc64
tests Test RTLD's new LD_LIBRARY_PATH_FDS variable. 2014-06-20 17:14:59 +00:00
debug.c
debug.h
libmap.c Fix LD_LIBMAP. 2014-05-18 17:14:08 +00:00
libmap.h Make the directory mapping functionality, which was previously only 2013-09-21 21:03:52 +00:00
Makefile Test RTLD's new LD_LIBRARY_PATH_FDS variable. 2014-06-20 17:14:59 +00:00
malloc.c Before calling mmap() on a shared library's text and data sections, rtld 2014-04-11 16:55:25 +00:00
map_object.c Before calling mmap() on a shared library's text and data sections, rtld 2014-04-11 16:55:25 +00:00
rtld_lock.c Right now, the rtld prefork hook locks the rtld bind lock in the read 2014-05-24 10:23:06 +00:00
rtld_lock.h
rtld_printf.c Add the LD_LIBRARY_PATH_FDS environmental variable. 2014-06-20 17:08:32 +00:00
rtld_printf.h Add the LD_LIBRARY_PATH_FDS environmental variable. 2014-06-20 17:08:32 +00:00
rtld_tls.h
rtld.1 mdoc: remove superfluous paragraph macros. 2014-06-23 18:40:21 +00:00
rtld.c Fix r264346 for ia64. We need to allocate memory for the function 2014-07-02 22:04:12 +00:00
rtld.h Before calling mmap() on a shared library's text and data sections, rtld 2014-04-11 16:55:25 +00:00
Symbol.map - Export the function added in r265456 rather than the non-existent 2014-05-07 17:21:22 +00:00
xmalloc.c Increase alignment to size of pointer if the alignment is too small. 2014-02-22 11:06:48 +00:00