This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33871] [4.3 Regression] typeinfo name referenced in ... defined in discarded section
- From: "geoffk at geoffk dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Nov 2007 03:33:16 -0000
- Subject: [Bug c++/33871] [4.3 Regression] typeinfo name referenced in ... defined in discarded section
- References: <bug-33871-5606@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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