tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: dlopen interception on libasan



On Nov 30,  7:34am, skrll%netbsd.org@localhost (Nick Hudson) wrote:
-- Subject: Re: dlopen interception on libasan

| Are you sure about RTLD_DEFAULT?
| 
| zoom$ cat foo.c
| #include <dlfcn.h>
| 
| void *
| foo_rtld_default(void)
| {
|          return dlsym(RTLD_DEFAULT, "dlopen");
| }
| 
| void *
| foo_rtld_next(void)
| {
|          return dlsym(RTLD_NEXT, "dlopen");
| }
| zoom$ cat main.c
| #include <stdio.h>
| 
| void *foo_rtld_default();
| void *foo_rtld_next();
| 
| int
| main()
| {
|          printf("dlopen using default %p\n", foo_rtld_default());
|          printf("dlopen using next    %p\n", foo_rtld_next());
| }

You did not define dlopen() in your own shared object; libasan needs to
do that to override the default definition. This is not the right test.

christos


Home | Main Index | Thread Index | Old Index