This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16625] Discarded Linkonce sections in .rodata
- From: "hjl at lucon dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Mar 2007 19:43:44 -0000
- Subject: [Bug c++/16625] Discarded Linkonce sections in .rodata
- References: <bug-16625-8878@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #35 from hjl at lucon dot org 2007-03-02 19:43 -------
(In reply to comment #34)
> Could the be related to
> http://sources.redhat.com/ml/binutils/2004-08/msg00187.html?
>
> I'm getting those linker errors with both gcc 4.1.1 and gcc 4.1.2 on
> x86-Solaris with GNU ld from binutils-070227, but only when compiling with -O2
> or -O3, but not with -O0.
>
> The referenced symbols shows up (gnm -a *.o) in several objects like this:
>
> 0000000000000000 t .gnu.linkonce.t._ZN10otl_streamlsEj
> 0000000000000000 W _ZN10otl_streamlsEj
>
> But in the object mentioned in the error messages like this:
>
> 0000000000000000 r .gnu.linkonce.r._ZN10otl_streamlsEj
> 0000000000000000 t .gnu.linkonce.t._ZN10otl_streamlsEj
> 0000000000000000 W _ZN10otl_streamlsEj
>
> One possible workaround is to reorder the objects during link, so that those
> with .gnu.linkonce.r.* come first.
>
> If this a compiler or a linker bug? (I'd blame the linker ;))
>
It is most likely a Solaris specific compiler bug.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16625