This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: dlopen ? is it possible to use with stdc++ or a gcc bug ?
- To: lfarkas at mindmaker dot hu
- Subject: Re: dlopen ? is it possible to use with stdc++ or a gcc bug ?
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 18 Oct 2000 05:49:33 -0200
- Cc: gcc-bugs at gcc dot gnu dot org, drepper at cygnus dot com
- Organization: GCC Team, Red Hat
- References: <39EC69D9.32491D37@mindmaker.hu>
On Oct 17, 2000, Levente Farkas <lfarkas@mindmaker.hu> wrote:
> Segmentation fault (core dumped)
> not even print any error messages by the dlerror, just simple core dump.
No dlerror messages because dlopen is successful. You also have to
check whether dlsym returned NULL. I bet it did.
Note that you didn't get the `betoltve' message because it was still
in the stdout buffer by the time the program crashed, when you called
the NULL function. If you fflush(stdout) after fputs, or just add
`\n' to the message, you'll get the message.
> the strange thing if I change the test lib not to use the stdc++ library
> (replace iostream/cout with stdio/printf and g++ with gcc) everything
> works fine.
Presumably, in this case you're compiling plain code, in which case
the name of the function `test1' doesn't get mangled, so dlsym
actually finds it.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me