LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to get address of vmas of dynamic libs (not using /proc) (https://www.linuxquestions.org/questions/linux-general-1/how-to-get-address-of-vmas-of-dynamic-libs-not-using-proc-727076/)

fettigepommes 05-19-2009 11:02 AM

How to get address of vmas of dynamic libs (not using /proc)
 
Hello world!

I would like to obtain the address of the dynamic linker during runtime. I could use the /proc/<pid>/maps together with a regex. For example:

b7f89000-b7fa3000 r-xp 00000000 08:04 4554816 /lib/ld-2.7.so

I am want address b7f89000.


But I would like to find a better solution, I looked at dlopen etc. but could not figure it out. Is it possible with dlopen/dlsym ?

I tried to get a pointer to the task_struct structure to iterate over all vmas but I did not find a way to do this either.

Thank you for any help!

syg00 05-20-2009 04:07 AM

Why do we continue to get people who refuse to use /proc ?
It's a request to expose data from kernel structures - what better solution do you want ?.


All times are GMT -5. The time now is 04:08 PM.