mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
5c80f57cfc
* elf/neededobj1.c: Likewise. * elf/neededobj2.c: Likewise. * elf/neededobj3.c: Likewise. * elf/neededobj4.c: Likewise. * elf/nextmod1.c: Likewise. * elf/nextmod2.c: Likewise.
21 lines
313 B
C
21 lines
313 B
C
#include <dlfcn.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
extern int call_me (void);
|
|
|
|
int
|
|
call_me (void)
|
|
{
|
|
int (*fp) (void);
|
|
|
|
fp = dlsym (RTLD_DEFAULT, "foo");
|
|
if (fp == NULL)
|
|
{
|
|
printf ("cannot get address of foo in global scope: %s\n", dlerror ());
|
|
exit (1);
|
|
}
|
|
|
|
return fp () - 42;
|
|
}
|