"Relocation out-of-range" errors

Jeff P.M. Hultquist hultquis at orville.nas.nasa.gov
Tue Oct 10 02:55:18 AEST 1989


> From: davea at quasar.wpd.sgi.com (David B. Anderson)
> > In article <14188 at shamash.cdc.com> pwp at shamash.UUCP (Pete Poorman) writes:
> > > A few weeks back Steve Maurer asked what caused 
> > > "jump relocation out of range" errors, ...
> > > Can someone please explain again?
> > 
> > The question was answered by:
> > len at synthesis.Synthesis.COM (Len Lattanzi) in <28025 at mips.mips.COM>
> > > ;;Typically this is caused by one importing module referencing a 
> > >  symbol as text and trying to jump to it. And the exporting module
> > > defining the symbol to be data.  Text and Data are normally too 
> > > far apart to jump between.
> 
> In the ZMAGIC format (the format used for executables in IRIX) code starts
> at 0x400000 and data starts at 0x10000000.

I ran into this problem when implemented a simple dynamic loader for
the Personal Iris.  The newly compiled code would be loaded into a
malloc'ed chunk of memory, and the address of that block would then be
treated as a pointer to a function.  The way around this problem is to
place Data and Text more closely together when building the
application.  How does one do this?

	cc -Wl,-D,a000000 <files.o>

This instructs the linker to place the Data segment lower in the
address space.



More information about the Comp.sys.sgi mailing list