why is g++ relocation error linking only showing when listing objects explicitly?

Mark Galeck (CW) mgaleck@Brocade.com
Mon Dec 17 04:59:00 GMT 2012


Hello,

I think this question belongs here and not on a general Unix mailing list, but I am not sure, so please forgive me if I am posting in the wrong place.  

I am getting the error 

"relocation truncated to fit: R_PPC_PLTREL24 against symbol ..." 

when using g++ to link about 2300 .o files into a single library, total size about 29MB, and -mlongcall does not help.


Curiously, this only happens when listing the files explicitly.   That is:

This doesn't work (24-bit relocation error)

>g++ -fPIC `<command to list object files>`


However, this works correctly (!!!???)

>echo `<the same command to list object files>` | xargs g++ -fPIC



What is going on here??

Thank you for any insight.

Mark



More information about the Gcc-help mailing list