* elf.c (bfd_section_from_shdr): Remove extraneous breaks.
[binutils.git] / ld / testsuite / ld-elf / dl1main.c
blobf277bf59a6f3fe61ef53b72dd39a04fcf44da541
1 #include <stdio.h>
2 #include <dlfcn.h>
4 int bar = -20;
6 int
7 main (void)
9 int ret = 0;
10 void *handle;
11 void (*fcn) (void);
13 handle = dlopen("./tmpdir/libdl1.so", RTLD_GLOBAL|RTLD_LAZY);
14 if (!handle)
16 printf("dlopen libfoo.so: %s\n", dlerror ());
17 return 1;
20 fcn = (void (*)(void)) dlsym(handle, "foo");
21 if (!fcn)
23 printf("dlsym foo: %s\n", dlerror ());
24 ret += 1;
26 else
28 (*fcn) ();
31 dlclose (handle);
32 return ret;