This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dlopen issue


On Thu, Jan 12, 2012 at 11:16 AM, naveen yadav <yad.naveen@gmail.com> wrote:
> Dear All,
>
> I have precompiled source code. I want to know which are library are
> open using dlopen.
> I try to put printf in
> vi ../dlfcn/dlopen.c
>
> Glibc compile well, but no print is coming when dlopen is called.
> Is this not the correct way ? If yes how can we get this info .
>
> void *
> dlopen (const char *file, int mode)
> {
>
> ?printf("\n %s\n",file);
> ?return __dlopen (file, mode, RETURN_ADDRESS (0));
> }

Why not use strace and see what files are being opened by the program?
strace -v <path> will show something like (some output was stripped):
...
open("/lib/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
...
open("/lib/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
...
open("/lib/libcap.so.2", O_RDONLY|O_CLOEXEC) = 3
...

Maciek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]