This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++] import/export of vtables with inline key fuctions


It is never ok to import/export vtables with inline key functions, doing so causes multiple definitions to occur if we try on machines without weak.

unit 1:
struct foo
{
  virtual ~foo();
};

inline foo::~foo() { }

unit 2:
struct foo
{
  virtual ~foo();
};

inline foo::~foo() { }

int main () { }

is the testcase, and -fno-weak is how it is compiled. We presently get:

0000002c t _ZN3fooD0Ev
00000000 t _ZN3fooD1Ev
00000010 R _ZTI3foo
00000018 r _ZTS3foo
00000000 R _ZTV3foo

which is wrong. On some machines, those without weak, this is terribly broken currently. Darwin would be one such instance. This used to work, but has been broken, though, when exactly I can't say, new abi would be my guess.

Jim Dein is working on a multi-translation unit dejagnu test framework setup. When it is completed, we can just add the above testcase.

Attachment: keyinline.diffs.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]