Issue while linking c++ applicatiopn on Linux Power

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

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
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
objws/opt/dcsdblk.o(.text+0xe70c): In function `os_allocator<DCWFormat
const*>::allocate(unsigned int, void const*)':
: relocation truncated to fit: R_PPC_LOCAL24PC
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

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

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: <>

More information about the Linuxppc-dev mailing list