From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27953 invoked by alias); 30 Jul 2009 08:00:47 -0000 Received: (qmail 27799 invoked by uid 48); 30 Jul 2009 08:00:21 -0000 Date: Thu, 30 Jul 2009 08:00:00 -0000 Message-ID: <20090730080021.27798.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/40905] GCC creates invalid executable with auto-imported DLL and __attribute__((cold)) In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "dannysmith at users dot sourceforge dot net" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-07/txt/msg02419.txt.bz2 ------- Comment #4 from dannysmith at users dot sourceforge dot net 2009-07-30 08:00 ------- (In reply to comment #2) > > Is it possible that it triggers the exception trying to write in text.unlikely > which is READONLY? > Exactly. This is a linker, not a compiler issue. If you are using a relatively recent binutils and mingw run time, the addition of the switch -Wl,--enable-runtime-pseudo-reloc-v2 should get around the READONLY problem. Otherwise, you could always just add __declspec (dllimport) to extern int foo[2]; and so retain portability with the rest of the PE-COFF world. Danny -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40905