If a class has virtual. functions, it should have type info. Do nm -C libname.so
and watch for "vtable for", "typeinfo for", and "typeinfo name for". Example:
00000000 b .bss
00000000 d .data
00000000 r .eh_frame
00000000 r .rdata$_ZTI3Foo
00000000 r .rdata$_ZTS3Foo
00000000 r .rdata$_ZTV3Foo
00000000 r .rdata$zzz
00000000 t .text
00000000 T Foo::foo()
00000000 R typeinfo for Foo
00000000 R typeinfo name for Foo
00000000 R vtable for Foo
U vtable for __cxxabiv1::__class_type_info
If you have vtable
but not typeinfo
, this is compiled with -fno-rtti
. Example:
00000000 b .bss
00000000 d .data
00000000 r .eh_frame
00000000 r .rdata$_ZTV3Foo
00000000 r .rdata$zzz
00000000 t .text
00000000 T Foo::foo()
00000000 R vtable for Foo
If you don't have any virtual functions, you cannot tell (and should not care).