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 02:47:12 -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 #35 from geoffk at geoffk dot org 2007-11-05 02:47 -------
Subject: Re: [4.3 Regression] typeinfo name referenced in ... defined in
discarded section
On 04/11/2007, at 4:22 PM, hjl at lucon dot org wrote:
> ------- Comment #33 from hjl at lucon dot org 2007-11-05 00:22
> -------
> (In reply to comment #32)
>>
>> What if you want to reference this string from somewhere that should
>> never be discarded, like a global variable?
>>
>
> Since the string is local, that global variable is defined in
> the same file as the string. You should put the global variable
> in a section which belongs to the same comdat group as the local
> string.
- What if the global variable references two or more strings?
- Won't this cause the global variable to be discarded if anyone
defines a different global variable which also references the same
string?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33871