Subject: Global Offset Table (GOT) overflow from ld(1)
To: None <port-sparc@NetBSD.ORG>
From: Jarle Fredrik Greipsland <jarle.greipsland@idt.unit.no>
List: port-sparc
Date: 08/01/1995 16:16:29
Hi,

I've been trying to build the tcl/tk v4.0 shared libraries for
NetBSD/sparc (current), but the final ld of the tk-library fails.  The
command line is something ala:

 ld -x -Bshareable -o libtk.so.4.0 *.so

and the response from ld is:

 ld: Global Offset Table overflow
 ld: tkImage.so: GOT overflow for relocation at 0x234

It seems that this happens because the toolchain is based on
relocating 13-bit offsets within the sparc opcodes, at least that's
what I'm guessing at seeing the definitions of MIN_GOTOFF and
MAX_GOTOFF are set to -4096/4096.  Is there some way around this
problem, short of modifying the entire toolchain?

I've tried both -fpic and -fPIC to gcc, as well as making an lorder'ed
libtk_pic.a first as for the standard NetBSD build procedure.  I guess
I could try to reorder the files to decrease the "distance" between
functions, but then I would need a knapsack to hold the files......
Anything else I should try?

					-jarle
-- 
"The Circus Theory of Project Management: If you have too many balls in
 the air, throw one to some other clown..."
					-- arch@cisco.com