Issue while linking c++ applicatiopn on Linux Power

Abhay Singh abhay.singh at oracle.com
Mon Jan 16 23:38:03 EST 2006


Hi,
I am porting a huge c++ server application on Linux Power PC.
The compiler which I am using is IBM xlC 7.0 version. The gcc version
installed is 3.3.3.
I am using xlC for building the c++ application and shared objects, as
opposed for the gcc -fPIC option, Iam using -qpic=large for creating the
position independance code.
While linking one of out libraries, we encountered an issue like "
"relocation truncated to fit: R_PPC_LOCAL24PC
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc"
Then after using the -Wl,--relax as linker option we were able to create the
shared library.

Now but during the creation of the final executable during the link time, I
am facing a similar issue like

objws/opt/dcsdblk.o(.text+0xe620): In function `os_vector<DCWFormat
const*>::reserve(unsigned int)':
: relocation truncated to fit: R_PPC_LOCAL24PC
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc
objws/opt/dcsdblk.o(.text+0xe70c): In function `os_allocator<DCWFormat
const*>::allocate(unsigned int, void const*)':
: relocation truncated to fit: R_PPC_LOCAL24PC
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc
objws/opt/dcsdblk.o(.text+0xe790): In function `os_vector<DCWFormat
const*>::insert(DCWFormat const**, unsigned int, DCWFormat const* const&)':
: relocation truncated to fit: R_PPC_LOCAL24PC
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc

Even the Wl,--relax option is noy helping us.

I saw one small c test program as 

#include <stdio.h>
char realbig[36000032] = {1,2};

int main()
{
        printf ("&realbig = %#lx\n", &realbig);
}

while compiling gives the same kind of error. Although this error vanishes,
if we do a 64 bit build using option -q64 for xlC and -m64 for gcc.

Please let me know, if there is any resolution for the above described
issue.

Thanks and regards,
Abhay Kumar Singh
Oracle India Private Limited.
Tel: 91-80-51086837

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 2468 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20060116/2dc4100f/attachment.bin>


More information about the Linuxppc-dev mailing list