This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Cross Compiler and Name Mangling Differences
- To: gcc-help at gcc dot gnu dot org
- Subject: Cross Compiler and Name Mangling Differences
- From: Jonathan Pryor <jpryor at image dot kodak dot com>
- Date: Wed, 27 Dec 2000 14:06:10 -0500
I built a cross compiler to generate sparc-sun-solaris2.5.1 code
from i686-pc-linux-gnu (Red Hat 7.0).
The Solaris "native" compiler is GCC-2.95.2 with binutils-2.9.5.0.31,
so the cross compiler is using the same versions of binutils and gcc.
I have the cross-compiler built, but I'm facing a problem when
moving object files between platforms. It appears that the name
mangling is different between the solaris native gcc compiler and
the linux->Solaris cross compiler.
For example, the output of ``nm'' of the linux object file is:
00000000 a *ABS*
U _Q_qtod
00000000 ? __FRAME_BEGIN__
U __ls__7ostreamPCc
U __ls__7ostreamPFR7ostream_R7ostream
U __throw
U cout
U endl__FR7ostream
00000000 t gcc2_compiled.
00000000 T main
The output of ``nm'' for the solaris-gcc compiler object file is:
00000000 a *ABS*
U _Q_qtod
00000000 ? __FRAME_BEGIN__
U __ls__7ostreamPCc
U __ls__7ostreamPFRB0_RB0
U __throw
U cout
U endl__FR7ostream
00000000 t gcc2_compiled.
00000000 T main
The only difference is the 5th line. The Linux cross-compiler
mangling and the Solaris native mangling are different for the
function type ``ostream::operator<<(ostream &(*)(ostream &)).''
Is there any reason for this to be happening, and is there any
way to fix it?
Thanks.
- Jon