[Bug target/51900] [4.6/4.7 Regression] const variable initialization always zero

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jan 20 07:52:00 GMT 2012


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-01-20 07:33:36 UTC ---
Dunno about PE-COFF, but at least in ELF merging of .data (or .rodata) and
common symbols works by keeping the non-common symbol and it is the behavior
that GCC expects with -fcommon. If the PE-COFF linker handles it the same, then
if you can't use default_binds_local_p, you should at least copy over the
common symbol handling from it.
int i = 5;
in one file and
int i;
in another one with -fcommon just provides the int i = 5; definition and
int i; in two files provides int i = 0; definition.



More information about the Gcc-bugs mailing list