public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42870]  New: [4.5 regression] __attribute__ ((dllexport)) produces broken linkage
@ 2010-01-26 10:29 jojelino at gmail dot com
  2010-01-26 10:41 ` [Bug c++/42870] " jojelino at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: jojelino at gmail dot com @ 2010-01-26 10:29 UTC (permalink / raw)
  To: gcc-bugs

testcase
test.cpp
#ifdef FOOBAR
#define ATTRIBUTE __attribute__ ((dllexport))
#else
#define ATTRIBUTE __attribute__ ((visibility ("default")))
#endif
 class ATTRIBUTE Sa {
        public:
 Sa()
 {}
 ~Sa();
};
ATTRIBUTE Sa::~Sa()
{return;}

 bool DllMain(void *a,void*b,int)
 {
Sa s;
return true;
}

--
test2.cpp
class __attribute__((dllimport)) Sa {
 public:
 Sa()
 {}
__attribute__((dllimport)) ~Sa();
};

Sa a;
 bool DllMain(void *a,void*b,int)
 {
Sa s;
return true;
}


the following are directives that gcc emit when given attribute is
__attribute__ ((dllexport))
surely it must emit _ZN2SaD1Ev symbol or linker cannot find this symbol.

        .section .drectve
        .ascii " -export:_ZN2SaD2Ev"
        .ascii " -export:_ZN2SaC1Ev"
        .ascii " -export:_ZN2SaC2Ev"

for now i workaround this using __attribute__ ((visibility ("default")))


-- 
           Summary: [4.5 regression] __attribute__ ((dllexport)) produces
                    broken linkage
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jojelino at gmail dot com
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin


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


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

end of thread, other threads:[~2010-02-23 17:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-26 10:29 [Bug c++/42870] New: [4.5 regression] __attribute__ ((dllexport)) produces broken linkage jojelino at gmail dot com
2010-01-26 10:41 ` [Bug c++/42870] " jojelino at gmail dot com
2010-01-26 12:05 ` rguenth at gcc dot gnu dot org
2010-01-26 22:02 ` jojelino at gmail dot com
2010-01-28  2:48 ` d dot g dot gorbachev at gmail dot com
2010-02-02 13:41 ` rguenth at gcc dot gnu dot org
2010-02-03 22:02 ` jason at gcc dot gnu dot org
2010-02-05 14:06 ` davek at gcc dot gnu dot org
2010-02-05 22:17 ` jason at gcc dot gnu dot org
2010-02-05 22:39 ` jason at gcc dot gnu dot org
2010-02-05 22:40 ` davek at gcc dot gnu dot org
2010-02-23 17:05 ` hjl 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).