public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/39578]  New: Linkage broken for dllimport vtables
@ 2009-03-29 15:28 tdragon at tdragon dot net
  2009-03-29 17:47 ` [Bug target/39578] " dave dot korn dot cygwin at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: tdragon at tdragon dot net @ 2009-03-29 15:28 UTC (permalink / raw)
  To: gcc-bugs

The linkage for the vtable for any class marked dllimport is generated as a
standard external link rather than a dllimport "__imp_" link. This results in
linker diagnostics such as:

Info: resolving vtable for TestObject by linking to __imp___ZTV10TestObject
(auto-import)
d:/jsupport/mingw/bin/../lib/gcc/mingw32/4.3.3-dw2/../../../../mingw32/bin/ld.exe:
warning: auto-importing has been activated without --enable-auto-import
specified on the command line.
This should work unless it involves constant data structures referencing
symbols from auto-imported DLLs.

The following simple testcase demonstrates this.

----- vttest.cpp -----
struct __attribute__((dllimport)) TestObject
{
        virtual void VirtFunc();
};
int main()
{
        TestObject obj;
        obj.VirtFunc();
        return 0;
}

----- vttestdll.cpp -----
struct __attribute__((dllexport)) TestObject
{
        virtual void VirtFunc() {}
};

> g++ -shared -o vttest.dll -Wl,--out-implib,libvttest.dll.a vttestdll.cpp
Creating library file: libvttest.a
> g++ -o vttest.exe vttest.cpp libvttest.dll.a
Info: resolving vtable for TestObject by linking to __imp___ZTV10TestObject
(auto-import)
d:/jsupport/mingw/bin/../lib/gcc/mingw32/4.3.3-dw2/../../../../mingw32/bin/ld.exe:
warning: auto-importing has been activated without --enable-auto-import
specified on the command line.
This should work unless it involves constant data structures referencing
symbols from auto-imported DLLs.


-- 
           Summary: Linkage broken for dllimport vtables
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tdragon at tdragon dot net
 GCC build triplet: mingw32
  GCC host triplet: mingw32
GCC target triplet: mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39578


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-12-18  0:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-39578-4@http.gcc.gnu.org/bugzilla/>
2013-12-17 20:09 ` [Bug target/39578] Linkage broken for dllimport vtables ktietz at gcc dot gnu.org
2013-12-18  0:50 ` tdragon at tdragon dot net
2009-03-29 15:28 [Bug target/39578] New: " tdragon at tdragon dot net
2009-03-29 17:47 ` [Bug target/39578] " dave dot korn dot cygwin at gmail dot com
2009-04-16 20:34 ` pinskia at gcc dot gnu dot org
2009-09-12  9:54 ` ktietz at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).