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

Joerg Sonnenberger
2014-06-04T23:08:52Z

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