summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruna Moreira <bruna.moreira@openbossa.org>2008-04-21 13:39:11 -0600
committerDavid Mosberger-Tang <davidm@koala.mostang.com>2008-04-21 13:39:11 -0600
commit6f282a00f55d0bc11f131da5d3591a1a4030a9f9 (patch)
tree22365fe60872925d41a57da49748f92ac630de80
parentbb9d3dc6893536132929add38dc52cbf2dbb201c (diff)
downloadlibunwind-6f282a00f55d0bc11f131da5d3591a1a4030a9f9.tar.gz
[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>
-rw-r--r--tests/Gtest-bt.c4
-rw-r--r--tests/Gtest-dyn1.c4
-rw-r--r--tests/check-namespace.sh.in18
3 files changed, 15 insertions, 11 deletions
diff --git a/tests/Gtest-bt.c b/tests/Gtest-bt.c
index 1256512a..8211f732 100644
--- a/tests/Gtest-bt.c
+++ b/tests/Gtest-bt.c
@@ -38,8 +38,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include <unistd.h>
#include <libunwind.h>
-#if UNW_TARGET_X86 || UNW_TARGET_X86_64
-# define STACK_SIZE (128*1024) /* On x86/-64, SIGSTKSZ is too small */
+#if UNW_TARGET_X86 || UNW_TARGET_X86_64 || UNW_TARGET_ARM
+# define STACK_SIZE (128*1024) /* On x86/-64 and ARM, SIGSTKSZ is too small */
#else
# define STACK_SIZE SIGSTKSZ
#endif
diff --git a/tests/Gtest-dyn1.c b/tests/Gtest-dyn1.c
index 2faa1f7a..039c086d 100644
--- a/tests/Gtest-dyn1.c
+++ b/tests/Gtest-dyn1.c
@@ -34,7 +34,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#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 */
+#endif
#define panic(args...) \
{ fprintf (stderr, args); exit (-1); }
diff --git a/tests/check-namespace.sh.in b/tests/check-namespace.sh.in
index 253f7092..d6f51223 100644
--- a/tests/check-namespace.sh.in
+++ b/tests/check-namespace.sh.in
@@ -13,7 +13,7 @@ num_errors=0
LIBUNWIND=../src/.libs/libunwind.so
LIBUNWIND_GENERIC=../src/.libs/libunwind-${plat}.so
-function fetch_symtab {
+fetch_symtab () {
filename=$1
if [ ! -r $filename ]; then
@@ -38,12 +38,12 @@ function fetch_symtab {
IFS="$saved_IFS"
}
-function ignore {
+ignore () {
sym=$1
symtab=`echo "$symtab" | grep -v " ${sym}\$"`
}
-function match {
+match () {
sym=$1
if `echo "$symtab" | grep -q " ${sym}\$"`; then
symtab=`echo "$symtab" | grep -v " ${sym}\$"`
@@ -57,7 +57,7 @@ function match {
# Filter out miscellaneous symbols that get defined by the
# linker for each shared object.
#
-function filter_misc {
+filter_misc () {
ignore _DYNAMIC
ignore _GLOBAL_OFFSET_TABLE_
ignore __bss_start
@@ -71,7 +71,7 @@ function filter_misc {
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}_destroy_addr_space
match _UL${plat}_get_fpreg
@@ -129,7 +129,7 @@ function check_local_unw_abi {
esac
}
-function check_generic_unw_abi {
+check_generic_unw_abi () {
match _U${plat}_create_addr_space
match _U${plat}_destroy_addr_space
match _U${plat}_flush_cache
@@ -186,7 +186,7 @@ function check_generic_unw_abi {
esac
}
-function check_cxx_abi {
+check_cxx_abi () {
match _Unwind_Backtrace
match _Unwind_DeleteException
match _Unwind_FindEnclosingFunction
@@ -230,7 +230,7 @@ function check_cxx_abi {
esac
}
-function check_empty {
+check_empty () {
if [ -n "$symtab" ]; then
echo -e " ERROR: Extraneous symbols:\n$symtab"
num_errors=`expr $num_errors + 1`
@@ -252,7 +252,7 @@ check_empty
if [ $num_errors -gt 0 ]; then
echo "FAILURE: Detected $num_errors errors"
- exit -1
+ exit 1
fi
if $verbose; then