Bug 2174 - linking error : relocation truncated to fit: R_PPC_LOCAL24PC _GLOBAL_OFFSET_TABLE_+fffffffffffffffc
Summary: linking error : relocation truncated to fit: R_PPC_LOCAL24PC _GLOBAL_OFFSET_T...
Status: RESOLVED DUPLICATE of bug 2171
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.15
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-18 12:36 UTC by Kriti
Modified: 2006-01-19 06:28 UTC (History)
1 user (show)

See Also:
Host: Linux PPC
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kriti 2006-01-18 12:36:11 UTC
Currently  I am using the following to build my code:
binutils-2.15.90.0.1.1-32.5
glibc-2.3.3-98.38
gcc version 3.3.3

Initially while building one of our library we got the following error:-

usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/../../../../lib/crti.o(.text+0x10): In 
function `call_gmon_start':
/usr/src/packages/BUILD/glibc-2.3/cc/csu/crti.S:16: relocation truncated to 
fit: R_PPC_LOCAL24PC _GLOBAL_OFFSET_TABLE_+fffffffffffffffc
/usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/crtbeginS.o(.text+0xa4): In function 
`__do_global_dtors_aux':
: relocation truncated to fit: R_PPC_PLTREL24 __cxa_finalize@@GLIBC_2.1.3
/usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/crtbeginS.o(.fini+0x0): relocation 
truncated to fit: R_PPC_LOCAL24PC .text+4
/usr/lib/gcc-lib/powerpc-suse-linux/3.3.3/crtendS.o(.init+0x0): relocation 
truncated to fit: R_PPC_LOCAL24PC .text+4
obj/opt/dcbagg.o(.text+0x10): In function `__sinit65535()':
: relocation truncated to fit: R_PPC_LOCAL24PC 
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc
obj/opt/dcbagg.o(.text+0x28): In function `__sinit65535()':
: relocation truncated to fit: R_PPC_PLTREL24 
_ZNSt8ios_base4InitC1Ev@@GLIBCPP_3.2
obj/opt/dcbagg.o(.text+0x34): In function `__sinit65535()':
: relocation truncated to fit: R_PPC_PLTREL24 atexit
obj/opt/dcbagg.o(.text+0x3c): In function `__sinit65535()':
: relocation truncated to fit: R_PPC_PLTREL24 OLLogger_Dest::OLLogger_Dest()
obj/opt/dcbagg.o(.text+0x48): In function `__sinit65535()':
: relocation truncated to fit: R_PPC_PLTREL24 atexit
obj/opt/dcbagg.o(.text+0x7c): In function `__srterm__0()':
: relocation truncated to fit: R_PPC_LOCAL24PC 
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc
obj/opt/dcbagg.o(.text+0x90): In function `__srterm__0()':
: additional relocation overflows omitted from the output

A sample test program also gives a similar error:
#include <stdio.h>
char realbig[36000032] = {1,2};
int main()
{
printf ("&realbig = %#lx\n", &realbig);
}

Then by using the option "-Wl,--relax" to the link flag,the above error was 
solved.But now while building our final executabel I almost get the same kind 
of error:-

objws/opt/dcsdprvd.o(.text+0xaa224): In function `DCSFormatRule** 
std::__copy_trivial<DCSFormatRule*>(DCSFormatRule* const*, DCSFormatRule* 
const*, DCSFormatRule**)':
: relocation truncated to fit: R_PPC_LOCAL24PC 
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc
objws/opt/dcsdprvd.o(.text+0xaa294): In function `DCBAggregateReference** 
std::__copy_trivial<DCBAggregateReference*>(DCBAggregateReference* const*, 
DCBAggregateReference* const*, DCBAggregateReference**)':
: relocation truncated to fit: R_PPC_LOCAL24PC 
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc
objws/opt/dcsdprvd.o(.text+0xaa304): In function `DCBView** 
std::__copy_trivial<DCBView*>(DCBView* const*, DCBView* const*, DCBView**)':
: relocation truncated to fit: R_PPC_LOCAL24PC 
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc
objws/opt/dcsdprvd.o(.text+0xaa404): In function `DCBResultSet** 
std::__copy_trivial<DCBResultSet*>(DCBResultSet* const*, DCBResultSet* const*, 
DCBResultSet**)':
: relocation truncated to fit: R_PPC_LOCAL24PC 
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc
objws/opt/dcsdprvd.o(.text+0xaa474): In function `DCBParameterItemInstance** 
std::__copy_trivial<DCBParameterItemInstance*>(DCBParameterItemInstance* 
const*, DCBParameterItemInstance* const*, DCBParameterItemInstance**)':
: relocation truncated to fit: R_PPC_LOCAL24PC 
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc
objws/opt/dcsdprvd.o(.text+0xaa574): In function `unsigned short* 
std::__copy_trivial<unsigned short>(unsigned short const*, unsigned short 
const*, unsigned short*)':
: relocation truncated to fit: R_PPC_LOCAL24PC 
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc
objws/opt/dcsdprvd.o(.text+0xaa5e4): In function `int* std::__copy_trivial<int>
(int const*, int const*, int*)':
: relocation truncated to fit: R_PPC_LOCAL24PC 
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc
objws/opt/dcsdprvd.o(.text+0xaa654): In function `DCEPrivateFilterHandle** 
std::__copy_trivial<DCEPrivateFilterHandle*>(DCEPrivateFilterHandle* const*, 
DCEPrivateFilterHandle* const*, DCEPrivateFilterHandle**)':
: relocation truncated to fit: R_PPC_LOCAL24PC 
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc
objws/opt/dcsdprvd.o(.text+0xaa6c4): In function `DCEFilterHandle** 
std::__copy_trivial<DCEFilterHandle*>(DCEFilterHandle* const*, DCEFilterHandle* 
const*, DCEFilterHandle**)':
: relocation truncated to fit: R_PPC_LOCAL24PC 
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc
objws/opt/dcsdprvd.o(.text+0xaa734): In function `DCWExceptionRange** 
std::__copy_trivial<DCWExceptionRange*>(DCWExceptionRange* const*, 
DCWExceptionRange* const*, DCWExceptionRange**)':
: relocation truncated to fit: R_PPC_LOCAL24PC 
_GLOBAL_OFFSET_TABLE_+fffffffffffffffc
objws/opt/dcsdprvd.o(.text+0xaa7a4): In function `DCBViewMatrixSortKey** 
std::__copy_trivial<DCBViewMatrixSortKey*>(DCBViewMatrixSortKey* const*, 
DCBViewMatrixSortKey* const*, DCBViewMatrixSortKey**)':
: additional relocation overflows omitted from the output
collect2: ld returned 1 exit status

Its worth mentioning that if I comment out this file(dcsdprvd.cpp) from the 
makefile the same error is then thrown by some other object file and we have 
huge template instantiations in our code.So can anybody let me know where I am 
going wrong or do I need some patch to solve this issue.
Comment 1 Alan Modra 2006-01-19 06:28:42 UTC

*** This bug has been marked as a duplicate of 2171 ***