This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: linking problem with gcc-4.2 and -O3
- From: Andrew Haley <aph-gcc at littlepinkcloud dot COM>
- To: Tim Blechmann <tim at klingt dot org>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 18 May 2007 10:23:37 +0100
- Subject: Re: linking problem with gcc-4.2 and -O3
- References: <1179440057.8283.42.camel@localhost>
Tim Blechmann writes:
> when trying to link my (non-trivial) program, i'm getting linking errors
> like this:
> `.L20447' referenced in section `.gnu.linkonce.r._ZN4nova4AtomC1ERKS0_'
> of release/kernel/build.os: defined in discarded section
> `.gnu.linkonce.t._ZN4nova4AtomC1ERKS0_' of release/kernel/build.os
>
> this is only an issue, when compiling with gcc-4.2 and -O3 (gcc-4.1/-O3
> and gcc-4.2/-O2 work fine).
> unfortunately, i haven't been able to reproduce it in a small
> program :/ ... is this a known bug/feature?
No, and I'm having a great deal of difficulty imagining what might
have caused it. It would be interesting to know the actual definition
of
nova::Atom::Atom(nova::Atom const&)
and the corresponding assemly code.
You could, of course, just turn off function-sections.
Andrew.