Defined virtual functions cause type_info dependence

  abi, c++, gcc, linker

I have the following file

struct Foo
  virtual int do_something() const = 0;

struct Bar : public Foo
  virtual int do_something() const override
  { return 1; }

Bar bar;

When I try to build a shared object out of it like so:

g++ -shared -fPIC -o

nm outputs the lines:

U [email protected]@CXXABI_1.3
U [email protected]@CXXABI_1.3

But why? Shouldn’t this only be the case if one of the virtual functions was not either pure or did not have a definition? I know I can circumvent this by compiling with fno-rtti but I’m trying to understand this behaviour.

Source: Windows Questions C++