This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: reload .so without restarting process
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Hatt Tom <net dot study dot sea at gmail dot com>
- Cc: Sam Varshavchik <mrsam at courier-mta dot com>, gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Thu, 5 Dec 2013 02:14:33 +0000
- Subject: Re: reload .so without restarting process
- Authentication-results: sourceware.org; auth=none
- References: <CAHvbk5NkESYiD=adbi35saSDkFBv7CzstRQyLieQC3c1852zHQ at mail dot gmail dot com> <cone dot 1385908076 dot 862933 dot 19303 dot 1000 at monster dot email-scan dot com> <CAHvbk5PhE86RoxLxXtENwSTgAOxZXjzqh_z2gN_GTctDvHy_Sw at mail dot gmail dot com> <cone dot 1385955381 dot 779839 dot 10275 dot 1000 at monster dot email-scan dot com> <CAHvbk5OVSk60DsJhXuR6MfW9WOPXfn9MFLo2sHE-Ar7=P+gRxw at mail dot gmail dot com> <20131202062442 dot GA29869 at opentech dot at> <CAHvbk5PQnhBQT=ubtbBqoMwnCuK5PnLDaFSmPf9f++4K5AKAOQ at mail dot gmail dot com> <cone dot 1385985344 dot 398176 dot 13181 dot 1000 at monster dot email-scan dot com> <CAHvbk5N2Na5j4LCkimBHJSS-P=2FGgdANFvchcXA+jP7SQLV6g at mail dot gmail dot com> <cone dot 1386036320 dot 381412 dot 20574 dot 1000 at monster dot email-scan dot com> <CAHvbk5MQRB8cYhHbuk_t_-yFdtcgFFWk5OWfnLuNktaAwnzZZA at mail dot gmail dot com> <cone dot 1386040640 dot 73101 dot 20574 dot 1000 at monster dot email-scan dot com> <CAHvbk5OGxZ-Ptdd6mZ3r-ep8d8axKpX5S6e_+LZf=N-yk2bqfA at mail dot gmail dot com>
On 5 December 2013 02:02, Hatt Tom wrote:
>
> So if I link that .so against my executable by "g++ -l " command
> ,then I can not dlclose it fully in process at all ?
Right. Why is that a problem? Why do you think you need to dlclose it?
> Tp dlclose it fully , I must not link it by compiler ,but manually
> use dlopen and dlsym to resolve the external symbols .
>
> But if so ,how to make the compiler not to compalain "not reference
> to symbol xxx" at compiling stage ?
That means your program depends on symbols in the library directly, so
you should link to it directly, and then you can't dlclose it. But
that should not be a problem.
What are you trying to do? Why can't you just let the linker do its
job normally?