This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/4993: dynamic_cast incorrectly returns 0
- From: nathan at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, hubbard at ilm dot com, jyost at ilm dot com, kainz at ilm dot com, nathan at gcc dot gnu dot org
- Date: 7 Dec 2001 21:50:05 -0000
- Subject: Re: libstdc++/4993: dynamic_cast incorrectly returns 0
Synopsis: dynamic_cast incorrectly returns 0
State-Changed-From-To: analyzed->closed
State-Changed-By: nathan
State-Changed-When: Fri Dec 7 13:50:04 2001
State-Changed-Why:
User error. Not only must you specify RTDL_GLOBAL when
loading the dso, you must export symbols from the main
program. Do this by giving the -E (--export-dynamic)
flag to the linker. (Remember to say -Wl,-E, as
otherwise you'll get confused like I did for 30 seconds
until you realise a naked -E means something else).
Refer the ld's man page for the meaning of -E. I will
prepare a FAQ patch describing this. I've also
attached a sample program (taken from your bug report)
which now prints the expected result.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4993&database=gcc