The following testcase compiled with -O -fPIC results in a non-PLT call to A::check. On x86_64 that means an R_X86_64_PC32 reloc, which the linker later correctly complains about if we are building a shared library. Curiously, if either or both of the typedefs are removed, you get the code I'd expect. typedef struct { int check (); } A; typedef struct { A a; int validate (); private: int check (); } B; int B::check () { return a.check (); } int B::validate () { return check (); } int doit () { B b; return b.validate (); }
Lets see oh one of the old of known bugs 7221 :). *** This bug has been marked as a duplicate of 7221 ***