This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
LTO and asm specs...
- From: David Miller <davem at davemloft dot net>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 12 Mar 2010 21:33:14 -0800 (PST)
- Subject: LTO and asm specs...
There is one g++ LTO test case (g++.lto/20090303) that fails on sparc,
it compiles the intermediate objects with -fPIC but the final
compilation creates an executable.
The problem is that when LTO re-instantiates the options for the
individual builds, the proper ASM specs of the target are not
executed, so in this case "-K PIC" is not passed down to the assembler
in response to "-fPIC".
As a consequence, relocations against _GLOBAL_OFFSET_TABLE_
in code like this:
sethi %hi(_GLOBAL_OFFSET_TABLE_), %g1
use the R_SPARC_HI22 relocation instead of R_SPARC_PC22.
Thus the program crashes.
I couldn't figure out immediately how to fix this as the
way LTO does spec overriding and such looked non-trivial.
Thanks.