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: 3 Nov 2007 07:21:36 -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 #27 from geoffk at geoffk dot org 2007-11-03 07:21 -------
Subject: Re: [4.3 Regression] typeinfo name referenced in ... defined in
discarded section
On 30/10/2007, at 9:03 PM, amodra at bigpond dot net dot au wrote:
> ------- Comment #26 from amodra at bigpond dot net dot au
> 2007-10-31 04:03 -------
> I believe the linker is correct to reject relocations against local
> symbols in
> discarded sections. The reason being that the linker allows
> linkonce (and
> comdat group) section contents to differ between two files, so that
> for
> example, two files may be compiled with different optimisations yet
> still link
> correctly. Since the contents may differ, the location of symbols
> within the
> section may also differ between files. Using the value of
> "local_sym + offset"
> in one file (in the discarded section) may point to an entirely
> wrong location
> in the other file (in the kept section).
In this case, though, the contents of the linkonce section will never
actually differ; and I believe in this case the offset is zero, so
even if they did differ it would not matter. Perhaps a zero offset
should be special-cased?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33871