N800: broken kernel signal handler restorer
Hi,
N800, 2.6.18-omap1, built by Nokia. Briefly, the kernel-installed signal handler restorer code does not work with that kernel.
If using sigaction(2) to install signal handler, uClibc and I guess glibc install their own sa_restorer(). However, if to install the signal handler without providing userspace sa_restorer() then the kernel's signal handler restorer code should be used. Below is the test program that fails on N800 if RELY_ON_USERSPACE_SA_RESTORER is undefined. In contrast, that program works fine on other ARM platforms with different kernels here, including a 2.4.x uclinux.
On N800, without RELY_ON_USERSPACE_SA_RESTORER, the signal handler is requested to return to 0xffff0500 (that was the value in lr on entry to signal handler). However, when signal handler finishes and jumps there, the SIGILL on 0xffff0508 follows.
Any ideas, is this problem specific to nokia kernel or omap kernels in general or am I just doing something wrong? Thanks in advance.
Olav
------------------- testcode ----------------------- /*
I compiled it with: CFLAGS := -Wall -Os -static