segment size exceeds 64K

John Owens john at jetson.UPMA.MD.US
Fri Sep 2 03:00:24 AEST 1988


In article <4X78oOd68k-0I=K0RL at andrew.cmu.edu>, jl42+ at andrew.cmu.edu (Jay Mathew Libove) writes:
> /bin/ld: Segment size exceeds 64K
> So, what exactly is the problem? Did the compiler generate one segment
> of code that was more than 64K in length? I thought it was supposed to
> take care of that for me.

I wish the error message at least said which segment.  The compiler
cannot keep segments under 64K by itself, because some of the segments
it generates for each module are joined in the final module.  Since
you're using large model (-Ml), the code segments for each module are
separate, but all the data goes into _DATA, which is limited to 64K.

> How do I correct for this? I compiled all the modules with just the
> basics, -Ml2e -O -LARGE.

The first thing to try is to add the option -Mt###, where ### is the
threshold for moving an individual data item to another segment.  If
you can, set this such that all normal-sized varibles, single
structures, and small arrays stay in _DATA, but arrays of significant
size are moved to their own segment.  I'd recommend starting with
-Mt512, and not going lower than -Mt64.

The second thing to try is to cause specific modules to have all their
data in another segment.  Use the option -NDmodule_DATA, where module
is the base of the filename (for main.c, use -NDmain_DATA or
-NDMAIN_DATA, whichever you like).  Ideally, pick modules that have
lots of large data that's always or almost always accessed only by
routines in that module.  If you use this option, don't do the -Mt
thing above.  (You can do it, but since both of these degrade
performance, you don't want to do more than is necessary.)

Of course, the easiest solution is to get a 386 machine.... :-)

-- 
John Owens		john at jetson.UPMA.MD.US		uunet!jetson!john
+1 301 249 6000		john%jetson.uucp at uunet.uu.net



More information about the Comp.unix.xenix mailing list