mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-20 07:43:36 +08:00
8dfb7cbf84
* testsuite/ld-elf/pr21964-1a.c (foo): Renamed to ... (foo1): This. * testsuite/ld-elf/pr21964-1b.c: Rewrite. * testsuite/ld-elf/pr21964-1c.c: New file. * testsuite/ld-elf/pr21964-2c.c: Likewise. * testsuite/ld-elf/pr21964-2a.c (foo): Renamed to ... (foo1): This. * testsuite/ld-elf/pr21964-2b.c: Rewrite. * testsuite/ld-elf/shared.exp: Update PR ld/21964 tests.
33 lines
425 B
C
33 lines
425 B
C
#include <dlfcn.h>
|
|
#include <stdio.h>
|
|
|
|
extern int foo1 (void);
|
|
|
|
int main()
|
|
{
|
|
void *dl;
|
|
void *sym;
|
|
int (*func) (void);
|
|
|
|
if (foo1 () != 0)
|
|
return 1;
|
|
|
|
dl = dlopen("pr21964-2b.so", RTLD_LAZY);
|
|
if (!dl)
|
|
return 2;
|
|
|
|
sym = dlsym(dl, "__start___verbose");
|
|
if (!sym)
|
|
return 3;
|
|
|
|
func = dlsym(dl, "foo2");
|
|
if (!func)
|
|
return 4;
|
|
if (func () == 0)
|
|
printf ("PASS\n");
|
|
|
|
dlclose(dl);
|
|
|
|
return 0;
|
|
}
|