------- Comment #39 from geoffk at geoffk dot org 2007-11-05 03:33 ------- Subject: Re: [4.3 Regression] typeinfo name referenced in ... defined in discarded section
On 04/11/2007, at 7:01 PM, hjl at lucon dot org wrote: >> - Won't this cause the global variable to be discarded if anyone >> defines a different global variable which also references the same >> string? > > The comdat group should have both global variables defined. I'm talking about static char * some_variable = "hi there"; and in some other file static char * some_variable = "hi there"; the compiler does not know that there are two files containing 'some_variable', and they have to be different variables (someone might change one of them and the other should not change if that happens), but the two "hi there" strings should be shared. How should the compiler represent this in ELF? ------- Comment #40 from geoffk at geoffk dot org 2007-11-05 03:33 ------- Created an attachment (id=14485) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14485&action=view) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33871