[Bug target/40905] GCC creates invalid executable with auto-imported DLL and __attribute__((cold))
ktietz at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Sep 4 13:27:00 GMT 2009
------- Comment #5 from ktietz at gcc dot gnu dot org 2009-09-04 13:27 -------
(In reply to comment #4)
> (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
>
Right, this is a linker issue (or runtime issue of pseudo-relocation). But
newer mingw32's runtime uses new code for v1 relocations, too. So for it, this
issue should be solved, too.
So can we close this bug?
Cheers,
Kai
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40905
More information about the Gcc-bugs
mailing list