summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.context/usymbols.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.context/usymbols.c')
-rw-r--r--testsuite/systemtap.context/usymbols.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/testsuite/systemtap.context/usymbols.c b/testsuite/systemtap.context/usymbols.c
index f8ee05b5..7c590724 100644
--- a/testsuite/systemtap.context/usymbols.c
+++ b/testsuite/systemtap.context/usymbols.c
@@ -8,34 +8,32 @@
*
* Uses signal to tranfer user space addresses into the kernel where a
* probe on sigaction will extract them and produce the symbols. To
- * poke into the executable we get the sa_handler, to poke into glibc
- * we get the sa_restorer fields in the stap script.
+ * poke into the executable we get the sa_handler from the main executable,
+ * and then the library through calling signal.
*
- * XXX - Seems sa_restorer isn't set on all architectures. should use
- * our own shared library and set signal handler from there. Also
- * need to handle @plt symbols (setting a handler in the main
- * executable that is in a shared library will have the @plt address,
- * not the address inside the shared library).
+ * FIXME. We call into the library to get the right symbol. If we
+ * register the handler from the main executable. We need to handle
+ * @plt symbols (setting a handler in the main executable that is in a
+ * shared library will have the @plt address, not the address inside
+ * the shared library).
*/
#include <signal.h>
typedef void (*sighandler_t)(int);
+// function from our library
+int lib_main (void);
+
void
-handler (int signum)
+main_handler (int signum)
{
/* dummy handler, just used for the address... */
}
-sighandler_t
-libc_handler (void *func)
-{
- return (sighandler_t) func;
-}
-
int
main (int argc, char *argv[], char *envp[])
{
// Use SIGFPE since we never expect that to be triggered.
- signal(SIGFPE, handler);
+ signal(SIGFPE, main_handler);
+ lib_main();
}