shared libs and dynamic_cast bug in OpenServer?
Robert Lipe
robertl@dgii.com
Sat Oct 24 20:29:00 GMT 1998
Note: your script files contained carriage returns which makes the shells
unhappy.
> I am using egcs-1.1b on OpenServer 5.0.4 and to run the example simple type:
>
> build.sh
>
> It build program A and build B and C shared libs.
>
> Simply type:
>
> A
>
> You must get B=xxxxx valid memory address, but dynamic cast fail returning
> 0.
>
>
> However, if dlopen is executed with RTLD_GLOBAL flags, it work ok. This is
> not a bad behaviour? I guess this depend of rtti not put in shared libraries
> if not in a executable program.
I've confirmed the behaviour you described does happen with EGCS 1.0.2
on Linux and with EGCS 1.1b on OpenServer.
The good news is that with the most recent builds I did on 10/22 this
seems to work on both targets.
$ cat e2
CC="/play/negcs/gcc/xgcc -B/play/negcs/gcc/ -L/play/negcs/gcc/ "
# CC="/play/egcs-release/negcs/gcc/xgcc -B/play/egcs-release/negcs/gcc/ -L/play/egcs-release/negcs/gcc/ "
$CC -fPIC -Wl,-Bexport -o A A.cpp
$CC -fPIC -G -o C.so C.cpp
$CC -fPIC -G -o D.so D.cpp
(robertl) rjlhome:/tmp/am
$ sh e2
(robertl) rjlhome:/tmp/am
$ ./A
B=804fd94
(robertl) rjlhome:/tmp/am
$ uname -v
5.0.5
So, whatever the problem was, it seems to be gone now.
RJL
More information about the Gcc-bugs
mailing list