mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2025-01-22 08:10:30 +01:00
[ARM] This patch fix some testsuite issues on ARM:
- Gtest-bt: like on x86/-64, the stack size passed to sigaltstack() is too small for ARM thus causing segmentation fault due to stack overflow. - Gtest-dyn1: code size definition of dynamic function (template()) on testcase is too big for ARM architecture so memcpy() reads invalid memory causing random crashes (segmentation fault). A better solution would be to compile the function in a separate binary, mmap() it and memcpy() from it instead, so maximum size is known for sure. - check-name-space.in: fix some "bashisms", it causes the script to fail to run on N8XX's busybox shell. Signed-off-by: Anderson Lizardo <anderson.lizardo@indt.org.br> Signed-off-by: Bruna Moreira <bruna.moreira@indt.org.br>
This commit is contained in:
parent
bb9d3dc689
commit
6f282a00f5
3 changed files with 15 additions and 11 deletions
|
@ -38,8 +38,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <libunwind.h>
|
#include <libunwind.h>
|
||||||
|
|
||||||
#if UNW_TARGET_X86 || UNW_TARGET_X86_64
|
#if UNW_TARGET_X86 || UNW_TARGET_X86_64 || UNW_TARGET_ARM
|
||||||
# define STACK_SIZE (128*1024) /* On x86/-64, SIGSTKSZ is too small */
|
# define STACK_SIZE (128*1024) /* On x86/-64 and ARM, SIGSTKSZ is too small */
|
||||||
#else
|
#else
|
||||||
# define STACK_SIZE SIGSTKSZ
|
# define STACK_SIZE SIGSTKSZ
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -34,7 +34,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
|
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
|
#if UNW_TARGET_ARM
|
||||||
|
#define MAX_FUNC_SIZE 96 /* FIXME: arch/compiler dependent */
|
||||||
|
#else
|
||||||
#define MAX_FUNC_SIZE 2048 /* max. size of cloned function */
|
#define MAX_FUNC_SIZE 2048 /* max. size of cloned function */
|
||||||
|
#endif
|
||||||
|
|
||||||
#define panic(args...) \
|
#define panic(args...) \
|
||||||
{ fprintf (stderr, args); exit (-1); }
|
{ fprintf (stderr, args); exit (-1); }
|
||||||
|
|
|
@ -13,7 +13,7 @@ num_errors=0
|
||||||
LIBUNWIND=../src/.libs/libunwind.so
|
LIBUNWIND=../src/.libs/libunwind.so
|
||||||
LIBUNWIND_GENERIC=../src/.libs/libunwind-${plat}.so
|
LIBUNWIND_GENERIC=../src/.libs/libunwind-${plat}.so
|
||||||
|
|
||||||
function fetch_symtab {
|
fetch_symtab () {
|
||||||
filename=$1
|
filename=$1
|
||||||
|
|
||||||
if [ ! -r $filename ]; then
|
if [ ! -r $filename ]; then
|
||||||
|
@ -38,12 +38,12 @@ function fetch_symtab {
|
||||||
IFS="$saved_IFS"
|
IFS="$saved_IFS"
|
||||||
}
|
}
|
||||||
|
|
||||||
function ignore {
|
ignore () {
|
||||||
sym=$1
|
sym=$1
|
||||||
symtab=`echo "$symtab" | grep -v " ${sym}\$"`
|
symtab=`echo "$symtab" | grep -v " ${sym}\$"`
|
||||||
}
|
}
|
||||||
|
|
||||||
function match {
|
match () {
|
||||||
sym=$1
|
sym=$1
|
||||||
if `echo "$symtab" | grep -q " ${sym}\$"`; then
|
if `echo "$symtab" | grep -q " ${sym}\$"`; then
|
||||||
symtab=`echo "$symtab" | grep -v " ${sym}\$"`
|
symtab=`echo "$symtab" | grep -v " ${sym}\$"`
|
||||||
|
@ -57,7 +57,7 @@ function match {
|
||||||
# Filter out miscellaneous symbols that get defined by the
|
# Filter out miscellaneous symbols that get defined by the
|
||||||
# linker for each shared object.
|
# linker for each shared object.
|
||||||
#
|
#
|
||||||
function filter_misc {
|
filter_misc () {
|
||||||
ignore _DYNAMIC
|
ignore _DYNAMIC
|
||||||
ignore _GLOBAL_OFFSET_TABLE_
|
ignore _GLOBAL_OFFSET_TABLE_
|
||||||
ignore __bss_start
|
ignore __bss_start
|
||||||
|
@ -71,7 +71,7 @@ function filter_misc {
|
||||||
ignore ICRT.INTERNAL # ICC 8.x defines this
|
ignore ICRT.INTERNAL # ICC 8.x defines this
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_local_unw_abi {
|
check_local_unw_abi () {
|
||||||
match _UL${plat}_create_addr_space
|
match _UL${plat}_create_addr_space
|
||||||
match _UL${plat}_destroy_addr_space
|
match _UL${plat}_destroy_addr_space
|
||||||
match _UL${plat}_get_fpreg
|
match _UL${plat}_get_fpreg
|
||||||
|
@ -129,7 +129,7 @@ function check_local_unw_abi {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_generic_unw_abi {
|
check_generic_unw_abi () {
|
||||||
match _U${plat}_create_addr_space
|
match _U${plat}_create_addr_space
|
||||||
match _U${plat}_destroy_addr_space
|
match _U${plat}_destroy_addr_space
|
||||||
match _U${plat}_flush_cache
|
match _U${plat}_flush_cache
|
||||||
|
@ -186,7 +186,7 @@ function check_generic_unw_abi {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_cxx_abi {
|
check_cxx_abi () {
|
||||||
match _Unwind_Backtrace
|
match _Unwind_Backtrace
|
||||||
match _Unwind_DeleteException
|
match _Unwind_DeleteException
|
||||||
match _Unwind_FindEnclosingFunction
|
match _Unwind_FindEnclosingFunction
|
||||||
|
@ -230,7 +230,7 @@ function check_cxx_abi {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_empty {
|
check_empty () {
|
||||||
if [ -n "$symtab" ]; then
|
if [ -n "$symtab" ]; then
|
||||||
echo -e " ERROR: Extraneous symbols:\n$symtab"
|
echo -e " ERROR: Extraneous symbols:\n$symtab"
|
||||||
num_errors=`expr $num_errors + 1`
|
num_errors=`expr $num_errors + 1`
|
||||||
|
@ -252,7 +252,7 @@ check_empty
|
||||||
|
|
||||||
if [ $num_errors -gt 0 ]; then
|
if [ $num_errors -gt 0 ]; then
|
||||||
echo "FAILURE: Detected $num_errors errors"
|
echo "FAILURE: Detected $num_errors errors"
|
||||||
exit -1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $verbose; then
|
if $verbose; then
|
||||||
|
|
Loading…
Reference in a new issue