Re: reload .so without restarting process

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

 



thanks for reply!

 I have used dlsym() to reload function A address ,  function B is
called from A , if I have modified function B ,do I need to use
dlsym() to reload B's address ?

I think it does not need ,as the dynamic linker will do this when
linking function A . Am I right ?




2013/12/2 Sam Varshavchik <mrsam@xxxxxxxxxxxxxxx>:
> Hatt Tom writes:
>
>> Thanks !
>>  I have tried this method ,but the problem is the main process still
>> use old functions , though I have dlclose that .so and then load the
>> newer one .
>>
>>
>> what is the reason ?How could I fix this ?
>
>
> In order for you to be able to dlclose a .so, it must've been initially
> opened with dlopen.
>
> You cannot dlclose a .so that you've linked your executable to, in the usual
> fashion.
>
> If you want to be able to reload a .so, you must manually open it with
> dlopen(), and then use dlsym() to look up the functions' addresses in the
> .so.
>
> After you dlclose() the .so, and dlopen() it back again you must then use
> dlsym() again to look up all the functions' addresses. Even functions that
> have not been changed, in the new version of your .so, might now be loaded
> at a completely different address.
>
>
>
>>
>>
>> 2013/12/1 Sam Varshavchik <mrsam@xxxxxxxxxxxxxxx>:
>> > Hatt Tom writes:
>> >
>> >> hi:
>> >>
>> >> Is it possible to reload .so file withour restarting thr process ?
>> >>
>> >> As I need to update some functions in my .so  ,  and it is not
>> >> pleasure to interrupt the main process . is there way to achive this?
>> >
>> >
>> > Only if you, yourself has manually loaded the .so with dlopen(). Then,
>> > you
>> > just dlclose() and dlopen() it again.
>> >
>> > man dlopen
>> >
>> >
>>
>>
>>
>> --
>> Best Regards!



-- 
Best Regards!





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux