mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
2.5-18.1
This commit is contained in:
30
elf/unload6.c
Normal file
30
elf/unload6.c
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
void *h = dlopen ("unload6mod1.so", RTLD_LAZY);
|
||||
if (h == NULL)
|
||||
{
|
||||
puts ("dlopen unload6mod1.so failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int (*fn) (int);
|
||||
fn = dlsym (h, "foo");
|
||||
if (fn == NULL)
|
||||
{
|
||||
puts ("dlsym failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int val = fn (16);
|
||||
if (val != 24)
|
||||
{
|
||||
printf ("foo returned %d != 24\n", val);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user