From 917fd0616395f800489f223140967cb61a5a5765 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 15 Sep 2000 17:35:04 +0000 Subject: Update. 2000-09-15 Ulrich Drepper * elf/Makefile (distribute): Add nextmod1.c and nextmod2.c. (tests): Add next. (modules-names): Add nextmod1 and nextmod2. Add rules to build and run next. * elf/next.c: New file. * elf/nextmod1.c: New file. * elf/nextmod2.c: New file. 2000-09-14 Jakub Jelinek * elf/dl-lookup.c (_dl_lookup_symbol_skip): Fix a typo. --- elf/next.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 elf/next.c (limited to 'elf/next.c') diff --git a/elf/next.c b/elf/next.c new file mode 100644 index 0000000000..a7ca2bdbc2 --- /dev/null +++ b/elf/next.c @@ -0,0 +1,44 @@ +#include + + +extern int successful_rtld_next_test (void); +extern void *failing_rtld_next_use (void); + + +int +do_test (void) +{ + int result; + void *addr; + + /* First try call a function which uses RTLD_NEXT and calls that + function. */ + result = successful_rtld_next_test (); + if (result == 42) + { + puts ("RTLD_NEXT seems to work for existing functions"); + result = 0; + } + else + { + printf ("Heh? `successful_rtld_next_test' returned %d\n", result); + result = 1; + } + + /* Next try a function which tries to get a function with RTLD_NEXT + but that fails. This dlsym() call should return a NULL pointer + and do nothing else. */ + addr = failing_rtld_next_use (); + if (addr == NULL) + puts ("dlsym returned NULL for non-existing function. Good"); + else + { + puts ("dlsym found something !?"); + result = 1; + } + + return result; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" -- cgit v1.2.3