1 /* test to build and run so that we know if we have dladdr
4 /* bloody FSF dlcfn.h won't give us dladdr without this */
11 #include <sys/param.h>
16 #if defined(__NetBSD_Version__) && __NetBSD_Version__ < 700000001
17 /* dladdr(3) is broken on some NetBSD versions before 7.0 */
20 void * handle
= dlopen((void*)0, RTLD_GLOBAL
| RTLD_NOW
);
21 void * addr
= dlsym(handle
, "printf");
22 Dl_info
* info
= (Dl_info
*) malloc(sizeof(Dl_info
));
23 if (dladdr(addr
, info
) == 0) {