[LLVMdev] -fvisibility=hidden, and typeinfo, and type-erasure

Joerg Sonnenberger joerg at britannica.bec.de
Wed Jun 4 16:08:52 PDT 2014


On Wed, Jun 04, 2014 at 06:32:35PM -0400, Rafael EspĂ­ndola wrote:
> I think the difference is actually in the c++ library. It looks like
> libstdc++ changed to always use strcmp of the typeinfo names:
> 
> https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=149964
> 
> Should we do the same with libc++?

No. It pessimizes correctly behaving code to work around code that
violates the ELF ABI. Consider an application that loads plugins with
RTLD_LOCAL. Two plugins implement a (hidden) type called "Plugin". The
GCC change now makes this completely separate types identical for all
RTTI purposes. That makes no sense at all.

Joerg



More information about the llvm-dev mailing list